Re-merge fix for bug 1398. RCL_3
authorPat Downey <patd@symbian.org>
Tue, 18 May 2010 17:12:08 +0100
branchRCL_3
changeset 28 4ae302afe336
parent 27 4284d6390a82 (current diff)
parent 22 35fa72f4c306 (diff)
child 30 664a5fed40c6
Re-merge fix for bug 1398.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/bmarm/WAPMSGCLIU.DEF	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,33 @@
+EXPORTS
+	__28CWapFullySpecDatagramService @ 1 NONAME R3UNUSED ; CWapFullySpecDatagramService::CWapFullySpecDatagramService(void)
+	ConstructL__24CWapBoundDatagramService @ 2 NONAME R3UNUSED ; CWapBoundDatagramService::ConstructL(void)
+	ConstructL__26CWapFullySpecCLPushService @ 3 NONAME R3UNUSED ; CWapFullySpecCLPushService::ConstructL(void)
+	ConstructL__28CWapFullySpecDatagramService @ 4 NONAME R3UNUSED ; CWapFullySpecDatagramService::ConstructL(void)
+	GetLocalAddressesL__16CWapMessageUtilsRt6RArray1ZQ23Wap12TAddressInfo @ 5 NONAME R3UNUSED ; CWapMessageUtils::GetLocalAddressesL(RArray<Wap::TAddressInfo> &)
+	NewL__22CWapBoundCLPushService @ 6 NONAME R3UNUSED ; CWapBoundCLPushService::NewL(void)
+	NewL__24CWapBoundDatagramService @ 7 NONAME R3UNUSED ; CWapBoundDatagramService::NewL(void)
+	NewL__26CWapFullySpecCLPushService @ 8 NONAME R3UNUSED ; CWapFullySpecCLPushService::NewL(void)
+	NewL__28CWapFullySpecDatagramService @ 9 NONAME R3UNUSED ; CWapFullySpecDatagramService::NewL(void)
+	"_._22CWapBoundCLPushService" @ 10 NONAME R3UNUSED ; CWapBoundCLPushService::~CWapBoundCLPushService(void)
+	"_._24CWapBoundDatagramService" @ 11 NONAME R3UNUSED ; CWapBoundDatagramService::~CWapBoundDatagramService(void)
+	"_._26CWapFullySpecCLPushService" @ 12 NONAME R3UNUSED ; CWapFullySpecCLPushService::~CWapFullySpecCLPushService(void)
+	"_._28CWapFullySpecDatagramService" @ 13 NONAME R3UNUSED ; CWapFullySpecDatagramService::~CWapFullySpecDatagramService(void)
+	__22CWapBoundCLPushService @ 14 NONAME R3UNUSED ; CWapBoundCLPushService::CWapBoundCLPushService(void)
+	__24CWapBoundDatagramService @ 15 NONAME R3UNUSED ; CWapBoundDatagramService::CWapBoundDatagramService(void)
+	__26CWapFullySpecCLPushService @ 16 NONAME R3UNUSED ; CWapFullySpecCLPushService::CWapFullySpecCLPushService(void)
+	ConstructL__22CWapBoundCLPushService @ 17 NONAME R3UNUSED ; CWapBoundCLPushService::ConstructL(void)
+	ConstructL__25CWapFullySpecCLWSPService @ 18 NONAME R3UNUSED ; CWapFullySpecCLWSPService::ConstructL(void)
+	NewL__21CWapBoundCLWSPService @ 19 NONAME R3UNUSED ; CWapBoundCLWSPService::NewL(void)
+	NewL__21CWapBoundCLWSPServiceRC4TUid @ 20 NONAME R3UNUSED ; CWapBoundCLWSPService::NewL(TUid const &)
+	NewL__22CWapBoundCLPushServiceRC4TUid @ 21 NONAME R3UNUSED ; CWapBoundCLPushService::NewL(TUid const &)
+	NewL__24CWapBoundDatagramServiceRC4TUid @ 22 NONAME R3UNUSED ; CWapBoundDatagramService::NewL(TUid const &)
+	NewL__25CWapFullySpecCLWSPService @ 23 NONAME R3UNUSED ; CWapFullySpecCLWSPService::NewL(void)
+	NewL__25CWapFullySpecCLWSPServiceRC4TUid @ 24 NONAME R3UNUSED ; CWapFullySpecCLWSPService::NewL(TUid const &)
+	NewL__26CWapFullySpecCLPushServiceRC4TUid @ 25 NONAME R3UNUSED ; CWapFullySpecCLPushService::NewL(TUid const &)
+	NewL__28CWapFullySpecDatagramServiceRC4TUid @ 26 NONAME R3UNUSED ; CWapFullySpecDatagramService::NewL(TUid const &)
+	"_._21CWapBoundCLWSPService" @ 27 NONAME R3UNUSED ; CWapBoundCLWSPService::~CWapBoundCLWSPService(void)
+	"_._25CWapFullySpecCLWSPService" @ 28 NONAME R3UNUSED ; CWapFullySpecCLWSPService::~CWapFullySpecCLWSPService(void)
+	__21CWapBoundCLWSPService @ 29 NONAME R3UNUSED ; CWapBoundCLWSPService::CWapBoundCLWSPService(void)
+	__25CWapFullySpecCLWSPService @ 30 NONAME R3UNUSED ; CWapFullySpecCLWSPService::CWapFullySpecCLWSPService(void)
+	ConstructL__21CWapBoundCLWSPService @ 31 NONAME R3UNUSED ; CWapBoundCLWSPService::ConstructL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/bwins/WAPMSGCLIU.DEF	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,33 @@
+EXPORTS
+	??0CWapBoundCLPushService@@IAE@XZ @ 1 NONAME ; protected: __thiscall CWapBoundCLPushService::CWapBoundCLPushService(void)
+	??0CWapBoundDatagramService@@IAE@XZ @ 2 NONAME ; protected: __thiscall CWapBoundDatagramService::CWapBoundDatagramService(void)
+	??0CWapFullySpecCLPushService@@IAE@XZ @ 3 NONAME ; protected: __thiscall CWapFullySpecCLPushService::CWapFullySpecCLPushService(void)
+	??0CWapFullySpecDatagramService@@IAE@XZ @ 4 NONAME ; protected: __thiscall CWapFullySpecDatagramService::CWapFullySpecDatagramService(void)
+	??1CWapBoundCLPushService@@UAE@XZ @ 5 NONAME ; public: virtual __thiscall CWapBoundCLPushService::~CWapBoundCLPushService(void)
+	??1CWapBoundDatagramService@@UAE@XZ @ 6 NONAME ; public: virtual __thiscall CWapBoundDatagramService::~CWapBoundDatagramService(void)
+	??1CWapFullySpecCLPushService@@UAE@XZ @ 7 NONAME ; public: virtual __thiscall CWapFullySpecCLPushService::~CWapFullySpecCLPushService(void)
+	??1CWapFullySpecDatagramService@@UAE@XZ @ 8 NONAME ; public: virtual __thiscall CWapFullySpecDatagramService::~CWapFullySpecDatagramService(void)
+	?ConstructL@CWapBoundCLPushService@@IAEXXZ @ 9 NONAME ; protected: void __thiscall CWapBoundCLPushService::ConstructL(void)
+	?ConstructL@CWapBoundDatagramService@@IAEXXZ @ 10 NONAME ; protected: void __thiscall CWapBoundDatagramService::ConstructL(void)
+	?ConstructL@CWapFullySpecCLPushService@@IAEXXZ @ 11 NONAME ; protected: void __thiscall CWapFullySpecCLPushService::ConstructL(void)
+	?ConstructL@CWapFullySpecDatagramService@@IAEXXZ @ 12 NONAME ; protected: void __thiscall CWapFullySpecDatagramService::ConstructL(void)
+	?GetLocalAddressesL@CWapMessageUtils@@SAHAAV?$RArray@VTAddressInfo@Wap@@@@@Z @ 13 NONAME ; public: static int __cdecl CWapMessageUtils::GetLocalAddressesL(class RArray<class Wap::TAddressInfo> &)
+	?NewL@CWapBoundCLPushService@@SAPAV1@XZ @ 14 NONAME ; public: static class CWapBoundCLPushService * __cdecl CWapBoundCLPushService::NewL(void)
+	?NewL@CWapBoundDatagramService@@SAPAV1@XZ @ 15 NONAME ; public: static class CWapBoundDatagramService * __cdecl CWapBoundDatagramService::NewL(void)
+	?NewL@CWapFullySpecCLPushService@@SAPAV1@XZ @ 16 NONAME ; public: static class CWapFullySpecCLPushService * __cdecl CWapFullySpecCLPushService::NewL(void)
+	?NewL@CWapFullySpecDatagramService@@SAPAV1@XZ @ 17 NONAME ; public: static class CWapFullySpecDatagramService * __cdecl CWapFullySpecDatagramService::NewL(void)
+	??0CWapBoundCLWSPService@@IAE@XZ @ 18 NONAME ; protected: __thiscall CWapBoundCLWSPService::CWapBoundCLWSPService(void)
+	??0CWapFullySpecCLWSPService@@IAE@XZ @ 19 NONAME ; protected: __thiscall CWapFullySpecCLWSPService::CWapFullySpecCLWSPService(void)
+	??1CWapBoundCLWSPService@@UAE@XZ @ 20 NONAME ; public: virtual __thiscall CWapBoundCLWSPService::~CWapBoundCLWSPService(void)
+	??1CWapFullySpecCLWSPService@@UAE@XZ @ 21 NONAME ; public: virtual __thiscall CWapFullySpecCLWSPService::~CWapFullySpecCLWSPService(void)
+	?ConstructL@CWapBoundCLWSPService@@IAEXXZ @ 22 NONAME ; protected: void __thiscall CWapBoundCLWSPService::ConstructL(void)
+	?ConstructL@CWapFullySpecCLWSPService@@IAEXXZ @ 23 NONAME ; protected: void __thiscall CWapFullySpecCLWSPService::ConstructL(void)
+	?NewL@CWapBoundCLPushService@@SAPAV1@ABVTUid@@@Z @ 24 NONAME ; public: static class CWapBoundCLPushService * __cdecl CWapBoundCLPushService::NewL(class TUid const &)
+	?NewL@CWapBoundCLWSPService@@SAPAV1@ABVTUid@@@Z @ 25 NONAME ; public: static class CWapBoundCLWSPService * __cdecl CWapBoundCLWSPService::NewL(class TUid const &)
+	?NewL@CWapBoundCLWSPService@@SAPAV1@XZ @ 26 NONAME ; public: static class CWapBoundCLWSPService * __cdecl CWapBoundCLWSPService::NewL(void)
+	?NewL@CWapBoundDatagramService@@SAPAV1@ABVTUid@@@Z @ 27 NONAME ; public: static class CWapBoundDatagramService * __cdecl CWapBoundDatagramService::NewL(class TUid const &)
+	?NewL@CWapFullySpecCLPushService@@SAPAV1@ABVTUid@@@Z @ 28 NONAME ; public: static class CWapFullySpecCLPushService * __cdecl CWapFullySpecCLPushService::NewL(class TUid const &)
+	?NewL@CWapFullySpecCLWSPService@@SAPAV1@ABVTUid@@@Z @ 29 NONAME ; public: static class CWapFullySpecCLWSPService * __cdecl CWapFullySpecCLWSPService::NewL(class TUid const &)
+	?NewL@CWapFullySpecCLWSPService@@SAPAV1@XZ @ 30 NONAME ; public: static class CWapFullySpecCLWSPService * __cdecl CWapFullySpecCLWSPService::NewL(void)
+	?NewL@CWapFullySpecDatagramService@@SAPAV1@ABVTUid@@@Z @ 31 NONAME ; public: static class CWapFullySpecDatagramService * __cdecl CWapFullySpecDatagramService::NewL(class TUid const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/client/wapmessage.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,508 @@
+// Copyright (c) 2001-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 <wapmessage.h>
+#include <ecom/ecom.h>
+
+/** The WAP Messaging API.  Four interfaces are defined that provide bound and fully-specified versions of WDP and Connectionless Push.
+	An instantiation of each may be obtained using the CreateImplementationL() function, and must be released using Release() when no
+	longer required.  Release() causes the instantiation to be deleted.
+*/
+
+// Use SWS as default WAP stack
+//  If undefined th3em NWSS stack will be used as default
+#define WAPUSE_SWS // since 8.0
+
+#ifndef WAPUSE_SWS
+// Symbian OS 7.0
+_LIT8(KDefBoundWdpCue, "wdp/bound");
+_LIT8(KDefFullSpecWdpCue, "wdp/fullyspec");
+_LIT8(KDefBoundCLPushCue, "clpush/bound");
+_LIT8(KDefFullSpecCLPushCue, "clpush/fullyspec");
+
+_LIT8(KAltBoundWdpCue, "swswdp/bound");
+_LIT8(KAltFullSpecWdpCue, "swswdp/fullyspec");
+_LIT8(KAltBoundCLPushCue, "swsclpush/bound");
+_LIT8(KAltFullSpecCLPushCue, "swsclpush/fullyspec");
+
+#else
+// Symbian OS 8.0
+_LIT8(KAltBoundWdpCue, "wdp/bound");
+_LIT8(KAltFullSpecWdpCue, "wdp/fullyspec");
+_LIT8(KAltBoundCLPushCue, "clpush/bound");
+_LIT8(KAltFullSpecCLPushCue, "clpush/fullyspec");
+
+_LIT8(KDefBoundWdpCue, "swswdp/bound");
+_LIT8(KDefFullSpecWdpCue, "swswdp/fullyspec");
+_LIT8(KDefBoundCLPushCue, "swsclpush/bound");
+_LIT8(KDefFullSpecCLPushCue, "swsclpush/fullyspec");
+#endif
+
+_LIT8(KBoundCLWSPCue, "swsclwsp/bound");
+_LIT8(KFullSpecCLWSPCue, "swsclwsp/fullyspec");
+
+/** Bound WDP
+*/
+
+EXPORT_C 
+CWapBoundDatagramService* CWapBoundDatagramService::NewL()
+	/** Allocates and creates a new CWapBoundDatagramService object. 
+	* 
+	* @return	A new CWapBoundDatagramService object.
+	* @leave	System wide error codes
+	*/
+	{
+	// CWapBoundDatagramService ECOM Interface UID = 101F4471
+	const TUid KUidBoundWDPInterface = {0x101F4471};
+
+	// Set resolving parameters
+	TEComResolverParams resolverParams;
+	resolverParams.SetDataType(KDefBoundWdpCue);
+	resolverParams.SetWildcardMatch(ETrue);
+
+	// Get the instantiation
+	TInt trapValue(0); 
+	TAny* ptr = NULL;
+	TRAP(trapValue, ptr = REComSession::CreateImplementationL(KUidBoundWDPInterface,
+								 _FOFF(CWapBoundDatagramService, iDtor_ID_Key),
+								 resolverParams));
+	if(trapValue)
+	{
+		resolverParams.SetDataType(KAltBoundWdpCue);
+		// Trying to load old wapmessage plug-in
+		ptr = REComSession::CreateImplementationL(KUidBoundWDPInterface,
+								 _FOFF(CWapBoundDatagramService, iDtor_ID_Key),
+								 resolverParams);
+	}
+
+	return REINTERPRET_CAST(CWapBoundDatagramService*, ptr);
+	}
+
+EXPORT_C 
+CWapBoundDatagramService* CWapBoundDatagramService::NewL(const TUid& aImplementation)
+	/** Allocates and creates a new CWapBoundDatagramService object. 
+	* 
+	* @param aImplementation
+	* @return					A new CWapBoundDatagramService object.
+	* @leave					System wide error codes
+	*/
+	{
+		TAny* ptr = REComSession::CreateImplementationL(aImplementation,
+								 _FOFF(CWapBoundDatagramService, iDtor_ID_Key));
+
+	return	REINTERPRET_CAST(CWapBoundDatagramService*, ptr);
+	}
+
+EXPORT_C 
+CWapBoundDatagramService::~CWapBoundDatagramService()
+	/** Destructor */
+	{
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+	}
+
+EXPORT_C 
+CWapBoundDatagramService::CWapBoundDatagramService()
+	{
+	}
+
+EXPORT_C 
+void CWapBoundDatagramService::ConstructL()
+	{
+	}
+	
+/** Fully-specified WDP
+*/
+
+EXPORT_C 
+CWapFullySpecDatagramService* CWapFullySpecDatagramService::NewL()
+	/** Allocates and creates a new CWapFullySpecDatagramService object. 
+	* 
+	* @return	A new CWapFullySpecDatagramService object.
+	* @leave	System wide error codes.
+	*/
+	{
+	// MWapFullySpecDatagramService ECOM Interface UID = 101F4473
+	const TUid KUidFullySpecDatagramInterface = {0x101F4473};
+
+	// Set resolving parameters
+	TEComResolverParams resolverParams;
+	resolverParams.SetDataType(KDefFullSpecWdpCue);
+	resolverParams.SetWildcardMatch(ETrue);
+
+	// Get the instantiation
+	TInt trapValue(0); 
+	TAny* ptr = NULL;
+	TRAP(trapValue, ptr = REComSession::CreateImplementationL(KUidFullySpecDatagramInterface,
+								 _FOFF(CWapFullySpecDatagramService, iDtor_ID_Key),
+								 resolverParams));
+	if(trapValue)
+	{
+		// Trying to load old wapmessage plug-in
+		resolverParams.SetDataType(KAltFullSpecWdpCue);
+		ptr = REComSession::CreateImplementationL(KUidFullySpecDatagramInterface,
+								 _FOFF(CWapFullySpecDatagramService, iDtor_ID_Key),
+								 resolverParams);
+	}
+
+	return REINTERPRET_CAST(CWapFullySpecDatagramService*, ptr);
+	}
+
+EXPORT_C 
+CWapFullySpecDatagramService* CWapFullySpecDatagramService::NewL(const TUid& aImplementation)
+	/** Allocates and creates a new CWapFullySpecDatagramService object. 
+	* 
+	* @param aImplementation	
+	* @return					A new CWapFullySpecDatagramService object.
+	* @leave					System wide error codes.
+	*/
+	{
+		TAny* ptr = REComSession::CreateImplementationL(aImplementation,
+								 _FOFF(CWapFullySpecDatagramService, iDtor_ID_Key));
+
+	return	REINTERPRET_CAST(CWapFullySpecDatagramService*, ptr);
+	}
+
+EXPORT_C 
+CWapFullySpecDatagramService::~CWapFullySpecDatagramService()
+	/** Destructor */
+	{
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+	}
+
+EXPORT_C 
+CWapFullySpecDatagramService::CWapFullySpecDatagramService()
+	{
+	}
+
+EXPORT_C 
+void CWapFullySpecDatagramService::ConstructL()
+	{
+	}
+
+/** Bound Connection-less Push
+*/
+
+EXPORT_C 
+CWapBoundCLPushService* CWapBoundCLPushService::NewL()
+	/** Allocates and creates a new CWapBoundCLPushService object. 
+	*
+	* @return	A new <code>CWapBoundCLPushService</code> object.
+	* @leave	System wide error codes.
+	*/
+	{
+	// MWapBoundCLPushService ECOM Interface UID = 101F4475
+	const TUid KUidBoundCLPushInterface = {0x101F4475};
+
+	// Set resolving parameters
+	TEComResolverParams resolverParams;
+	resolverParams.SetDataType(KDefBoundCLPushCue);
+	resolverParams.SetWildcardMatch(ETrue);
+
+	// Get the instantiation
+	TInt trapValue(0); 
+	TAny* ptr = NULL;
+	TRAP(trapValue, ptr = REComSession::CreateImplementationL(KUidBoundCLPushInterface,
+								 _FOFF(CWapBoundCLPushService, iDtor_ID_Key),
+								 resolverParams));
+	if(trapValue)
+	{
+		// Trying to load old wapmessage plug-in
+		resolverParams.SetDataType(KAltBoundCLPushCue);
+		ptr = REComSession::CreateImplementationL(KUidBoundCLPushInterface,
+								 _FOFF(CWapBoundCLPushService, iDtor_ID_Key),
+								 resolverParams);
+	}
+	return REINTERPRET_CAST(CWapBoundCLPushService*, ptr);
+	}
+
+EXPORT_C 
+CWapBoundCLPushService* CWapBoundCLPushService::NewL(const TUid& aImplementation)
+	/** Allocates and creates a new CWapBoundCLPushService object. 
+	*
+	* @param aImplementation	
+	* @return					A new CWapBoundCLPushService object.
+	* @leave					System wide error codes.
+	*/
+	{
+		TAny* ptr = REComSession::CreateImplementationL(aImplementation,
+								 _FOFF(CWapBoundCLPushService, iDtor_ID_Key));
+
+	return	REINTERPRET_CAST(CWapBoundCLPushService*, ptr);
+	}
+
+EXPORT_C 
+CWapBoundCLPushService::~CWapBoundCLPushService()
+	/** Destructor */
+	{
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+	}
+
+EXPORT_C 
+CWapBoundCLPushService::CWapBoundCLPushService()
+	{
+	}
+
+EXPORT_C 
+void CWapBoundCLPushService::ConstructL()
+	{
+	}
+
+/** Fully-specified Connection-less Push
+*/
+
+EXPORT_C 
+CWapFullySpecCLPushService* CWapFullySpecCLPushService::NewL()
+	/** Allocates and creates a new CWapFullySpecCLPushService object. 
+	*
+	* @return	A new CWapFullySpecCLPushService object.
+	* @leave	System wide error codes.
+	*/
+	{
+	// MWapFullySpecCLPushService ECOM Interface UID = 101F4477
+	const TUid KUidFullySpecCLPushInterface = {0x101F4477};
+
+	// Set resolving parameters
+	TEComResolverParams resolverParams;
+	resolverParams.SetDataType(KDefFullSpecCLPushCue);
+	resolverParams.SetWildcardMatch(ETrue);
+
+	// Get the instantiation
+	TInt trapValue(0); 
+	TAny* ptr = NULL;
+	TRAP(trapValue, ptr = REComSession::CreateImplementationL(KUidFullySpecCLPushInterface,
+								 _FOFF(CWapFullySpecCLPushService, iDtor_ID_Key),
+								 resolverParams));
+	if(trapValue)
+	{
+		// Trying to load old wapmessage plug-in
+		resolverParams.SetDataType(KAltFullSpecCLPushCue);
+		ptr = REComSession::CreateImplementationL(KUidFullySpecCLPushInterface,
+								 _FOFF(CWapFullySpecCLPushService, iDtor_ID_Key),
+								 resolverParams);
+	}
+
+	return REINTERPRET_CAST(CWapFullySpecCLPushService*, ptr);
+	}
+
+EXPORT_C 
+CWapFullySpecCLPushService* CWapFullySpecCLPushService::NewL(const TUid& aImplementation)
+	/** Allocates and creates a new CWapFullySpecCLPushService object. 
+	*
+	* @param aImplementation
+	* @return					A new CWapFullySpecCLPushService object.
+	* @leave					System wide error codes.
+	*/
+	{
+		TAny* ptr = REComSession::CreateImplementationL(aImplementation,
+								 _FOFF(CWapFullySpecCLPushService, iDtor_ID_Key));
+
+	return	REINTERPRET_CAST(CWapFullySpecCLPushService*, ptr);
+	}
+
+EXPORT_C 
+CWapFullySpecCLPushService::~CWapFullySpecCLPushService()
+	/** Destructor */
+	{
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+	}
+
+EXPORT_C 
+CWapFullySpecCLPushService::CWapFullySpecCLPushService()
+	{
+	}
+
+EXPORT_C 
+void CWapFullySpecCLPushService::ConstructL()
+	{
+	}
+
+/** Bound WSP
+	New interface and implementation
+*/
+
+EXPORT_C 
+CWapBoundCLWSPService* CWapBoundCLWSPService::NewL()
+	/** Allocates and creates a new CWapBoundCLWSPService object. 
+	*
+	* @return					A new CWapBoundCLWSPService object.
+	* @leave					System wide error codes.
+	*/
+	{
+	// CWapBoundWSPService ECOM Interface UID = 101FBB3B
+	const TUid KUidBoundCLWSPInterface = {0x101FBB3B};
+
+	// Set resolving parameters
+	TEComResolverParams resolverParams;
+	resolverParams.SetDataType(KBoundCLWSPCue);
+	resolverParams.SetWildcardMatch(ETrue);
+
+	// Get the instantiation
+	TAny* ptr = REComSession::CreateImplementationL(KUidBoundCLWSPInterface,
+								 _FOFF(CWapBoundCLWSPService, iDtor_ID_Key),
+								 resolverParams);
+
+	return REINTERPRET_CAST(CWapBoundCLWSPService*, ptr);
+	}
+
+EXPORT_C 
+CWapBoundCLWSPService* CWapBoundCLWSPService::NewL(const TUid& aImplementation)
+	/** Allocates and creates a new CWapBoundCLWSPService object. 
+	*
+	* @param aImplementation
+	* @return					A new CWapBoundCLWSPService object.
+	* @leave					System wide error codes.
+	*/
+	{
+		TAny* ptr = REComSession::CreateImplementationL(aImplementation,
+								 _FOFF(CWapBoundCLWSPService, iDtor_ID_Key));
+
+	return	REINTERPRET_CAST(CWapBoundCLWSPService*, ptr);
+	}
+
+EXPORT_C 
+CWapBoundCLWSPService::~CWapBoundCLWSPService()
+	/** Destructor */
+	{
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+	}
+
+EXPORT_C 
+CWapBoundCLWSPService::CWapBoundCLWSPService()
+	{
+	}
+
+EXPORT_C 
+void CWapBoundCLWSPService::ConstructL()
+	{
+	}
+
+/** Fully-specified Connection-less WSP
+	New interface and implementation
+*/
+
+EXPORT_C 
+CWapFullySpecCLWSPService* CWapFullySpecCLWSPService::NewL()
+	/** Allocates and creates a new CWapFullySpecCLWSPService object. 
+	*
+	* @return					A new CWapFullySpecCLWSPService object.
+	* @leave					System wide error codes.
+	*/
+	{
+	// CWapFullySpecCLWSPService ECOM Interface UID = 101FBB3D
+	const TUid KUidFullySpecCLWSPInterface = {0x101FBB3D};
+
+	// Set resolving parameters
+	TEComResolverParams resolverParams;
+	resolverParams.SetDataType(KFullSpecCLWSPCue);
+	resolverParams.SetWildcardMatch(ETrue);
+
+	// Get the instantiation
+	TAny* ptr = REComSession::CreateImplementationL(KUidFullySpecCLWSPInterface,
+								 _FOFF(CWapFullySpecCLWSPService, iDtor_ID_Key),
+								 resolverParams);
+
+	return REINTERPRET_CAST(CWapFullySpecCLWSPService*, ptr);
+	}
+
+EXPORT_C 
+CWapFullySpecCLWSPService* CWapFullySpecCLWSPService::NewL(const TUid& aImplementation)
+	/** Allocates and creates a new CWapFullySpecCLWSPService object. 
+	*
+	* @param aImplementation
+	* @return					A new CWapFullySpecCLWSPService object.
+	* @leave					System wide error codes.
+	*/
+	{
+		TAny* ptr = REComSession::CreateImplementationL(aImplementation,
+								 _FOFF(CWapFullySpecCLWSPService, iDtor_ID_Key));
+
+	return	REINTERPRET_CAST(CWapFullySpecCLWSPService*, ptr);
+	}
+
+EXPORT_C 
+CWapFullySpecCLWSPService::~CWapFullySpecCLWSPService()
+	/** Destructor */
+	{
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+	}
+
+EXPORT_C 
+CWapFullySpecCLWSPService::CWapFullySpecCLWSPService()
+	{
+	}
+
+EXPORT_C 
+void CWapFullySpecCLWSPService::ConstructL()
+	{
+	}
+
+   
+EXPORT_C TInt CWapMessageUtils::GetLocalAddressesL(RArray<Wap::TAddressInfo>& aAddressInfo)
+	/** Gets a list of all the available network interface addresses.
+	*
+	* @param aAddressInfo	On return, an array of the available network interface addresses.
+	* @return				KErrNone if successful, KErrNotFound if there are no addresses available. */
+	{
+	Wap::TAddressInfo addrInfo;
+
+	// Check if the esock ini file has been parsed
+//	User::LeaveIfError(Nifman::CheckIniConfig());
+
+	// The list of interfaces is available from a RSocket.GetOpt
+	TAutoClose<RSocketServ> sockServer;
+	User::LeaveIfError(sockServer.iObj.Connect());
+	sockServer.PushL();
+
+	TAutoClose<RSocket> sock;
+	User::LeaveIfError(sock.iObj.Open(sockServer.iObj, _L("udp")));
+	sock.PushL();
+
+	User::LeaveIfError(sock.iObj.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl));
+
+	TPckgBuf<TSoInetInterfaceInfo> info, next;
+
+	TInt res=sock.iObj.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, info);
+	if(res!=KErrNone)
+		User::Leave(res);
+
+	TInt validAddr = KErrNotFound;
+
+	while(res==KErrNone)
+		{
+		res=sock.iObj.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, next);
+
+		// Only consider the address is its up, and is point to point.
+		// (TODO-would it be right to include pending state addresses too????)
+		if ( (info().iState == EIfUp) &&
+			 (info().iFeatures & KIfIsPointToPoint) )
+			{
+			// Just want the interface name
+			// = info().iName;
+			// and the address
+			// = info().iAddress;
+			validAddr = KErrNone;	   
+			
+			addrInfo.iAddress = info().iAddress;
+			addrInfo.iName = info().iName;
+			aAddressInfo.Append(addrInfo);
+			}
+		}
+
+	sock.Pop();
+	sockServer.Pop();
+
+	return validAddr;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/client/wapmsgclisource.mmpi	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,19 @@
+/*
+* 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: 
+*
+*/
+// Contains just source of wapmsg, not including file that defines the dll entry point
+
+SOURCE			wapmessage.cpp
Binary file wapstack/wapmessageapi/documentation/WAP_stack-design.doc has changed
Binary file wapstack/wapmessageapi/documentation/WapMsgAPI_Test_Specification.doc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/eabi/wapmsgcliU.DEF	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,56 @@
+EXPORTS
+	_ZN16CWapMessageUtils18GetLocalAddressesLER6RArrayIN3Wap12TAddressInfoEE @ 1 NONAME
+	_ZN21CWapBoundCLWSPService10ConstructLEv @ 2 NONAME
+	_ZN21CWapBoundCLWSPService4NewLERK4TUid @ 3 NONAME
+	_ZN21CWapBoundCLWSPService4NewLEv @ 4 NONAME
+	_ZTV28CWapFullySpecDatagramService @5 NONAME ; #<VT>#
+	_ZN21CWapBoundCLWSPServiceC2Ev @ 6 NONAME
+	_ZN21CWapBoundCLWSPServiceD0Ev @ 7 NONAME
+	_ZN21CWapBoundCLWSPServiceD1Ev @ 8 NONAME
+	_ZN21CWapBoundCLWSPServiceD2Ev @ 9 NONAME
+	_ZN22CWapBoundCLPushService10ConstructLEv @ 10 NONAME
+	_ZN22CWapBoundCLPushService4NewLERK4TUid @ 11 NONAME
+	_ZN22CWapBoundCLPushService4NewLEv @ 12 NONAME
+	_ZTV26CWapFullySpecCLPushService @13 NONAME ; #<VT>#
+	_ZN22CWapBoundCLPushServiceC2Ev @ 14 NONAME
+	_ZN22CWapBoundCLPushServiceD0Ev @ 15 NONAME
+	_ZN22CWapBoundCLPushServiceD1Ev @ 16 NONAME
+	_ZN22CWapBoundCLPushServiceD2Ev @ 17 NONAME
+	_ZN24CWapBoundDatagramService10ConstructLEv @ 18 NONAME
+	_ZN24CWapBoundDatagramService4NewLERK4TUid @ 19 NONAME
+	_ZN24CWapBoundDatagramService4NewLEv @ 20 NONAME
+	_ZTV25CWapFullySpecCLWSPService @21 NONAME ; #<VT>#
+	_ZN24CWapBoundDatagramServiceC2Ev @ 22 NONAME
+	_ZN24CWapBoundDatagramServiceD0Ev @ 23 NONAME
+	_ZN24CWapBoundDatagramServiceD1Ev @ 24 NONAME
+	_ZN24CWapBoundDatagramServiceD2Ev @ 25 NONAME
+	_ZN25CWapFullySpecCLWSPService10ConstructLEv @ 26 NONAME
+	_ZN25CWapFullySpecCLWSPService4NewLERK4TUid @ 27 NONAME
+	_ZN25CWapFullySpecCLWSPService4NewLEv @ 28 NONAME
+	_ZTV24CWapBoundDatagramService @29 NONAME ; #<VT>#
+	_ZN25CWapFullySpecCLWSPServiceC2Ev @ 30 NONAME
+	_ZN25CWapFullySpecCLWSPServiceD0Ev @ 31 NONAME
+	_ZN25CWapFullySpecCLWSPServiceD1Ev @ 32 NONAME
+	_ZN25CWapFullySpecCLWSPServiceD2Ev @ 33 NONAME
+	_ZN26CWapFullySpecCLPushService10ConstructLEv @ 34 NONAME
+	_ZN26CWapFullySpecCLPushService4NewLERK4TUid @ 35 NONAME
+	_ZN26CWapFullySpecCLPushService4NewLEv @ 36 NONAME
+	_ZTV22CWapBoundCLPushService @37 NONAME ; #<VT>#
+	_ZN26CWapFullySpecCLPushServiceC2Ev @ 38 NONAME
+	_ZN26CWapFullySpecCLPushServiceD0Ev @ 39 NONAME
+	_ZN26CWapFullySpecCLPushServiceD1Ev @ 40 NONAME
+	_ZN26CWapFullySpecCLPushServiceD2Ev @ 41 NONAME
+	_ZN28CWapFullySpecDatagramService10ConstructLEv @ 42 NONAME
+	_ZN28CWapFullySpecDatagramService4NewLERK4TUid @ 43 NONAME
+	_ZN28CWapFullySpecDatagramService4NewLEv @ 44 NONAME
+	_ZTV21CWapBoundCLWSPService @45 NONAME ; #<VT>#
+	_ZN28CWapFullySpecDatagramServiceC2Ev @ 46 NONAME
+	_ZN28CWapFullySpecDatagramServiceD0Ev @ 47 NONAME
+	_ZN28CWapFullySpecDatagramServiceD1Ev @ 48 NONAME
+	_ZN28CWapFullySpecDatagramServiceD2Ev @ 49 NONAME
+	_ZTI21CWapBoundCLWSPService @ 50 NONAME ; #<TI>#
+	_ZTI22CWapBoundCLPushService @ 51 NONAME ; #<TI>#
+	_ZTI24CWapBoundDatagramService @ 52 NONAME ; #<TI>#
+	_ZTI25CWapFullySpecCLWSPService @ 53 NONAME ; #<TI>#
+	_ZTI26CWapFullySpecCLPushService @ 54 NONAME ; #<TI>#
+	_ZTI28CWapFullySpecDatagramService @ 55 NONAME ; #<TI>#
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/group/bld.inf	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+
+@SYMPurpose WAP messaging
+*/
+
+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
+
+../inc/wapmessage.h SYMBIAN_OS_LAYER_PUBLIC_EXPORT_PATH(wapmessage.h)
+../inc/wapmsgerr.h SYMBIAN_OS_LAYER_PLATFORM_EXPORT_PATH(wapmsgerr.h)
+
+wapmessage.iby /epoc32/rom/include/wapmessage.iby
+
+// Following file is identical to wapstacksuite_config.ini. The
+// hw one is used by iby file to configure wap-stack to use CdmaWapProt
+hwWapStackConfig.ini  z:/system/data/hwwapstackconfig.ini
+
+PRJ_TESTEXPORTS
+// Shortened WAP stack test IBY
+../te_wapstack/group/WapStackSuite.iby   	/epoc32/rom/include/wapstacksuite.iby
+
+
+// .script and .ini files for the test suite
+../te_wapstack/scripts/Te_WapStackSuite.script	/epoc32/release/wins/udeb/z/testdata/scripts/te_wapstacksuite.script
+../te_wapstack/scripts/Te_WapStackSuite.script	/epoc32/release/wins/urel/z/testdata/scripts/te_wapstacksuite.script
+../te_wapstack/scripts/Te_WapStackSuite.script	/epoc32/release/winscw/udeb/z/testdata/scripts/te_wapstacksuite.script
+../te_wapstack/scripts/Te_WapStackSuite.script	/epoc32/release/winscw/urel/z/testdata/scripts/te_wapstacksuite.script
+../te_wapstack/scripts/WapBoundWDP.script	/epoc32/release/wins/udeb/z/testdata/scripts/wapboundwdp.script
+../te_wapstack/scripts/WapBoundWDP.script	/epoc32/release/wins/urel/z/testdata/scripts/wapboundwdp.script
+../te_wapstack/scripts/WapBoundWDP.script	/epoc32/release/winscw/udeb/z/testdata/scripts/wapboundwdp.script
+../te_wapstack/scripts/WapBoundWDP.script	/epoc32/release/winscw/urel/z/testdata/scripts/wapboundwdp.script
+
+../te_wapstack/scripts/WapBoundPush.script	/epoc32/release/wins/udeb/z/testdata/scripts/wapboundpush.script
+../te_wapstack/scripts/WapBoundPush.script	/epoc32/release/wins/urel/z/testdata/scripts/wapboundpush.script
+../te_wapstack/scripts/WapBoundPush.script	/epoc32/release/winscw/udeb/z/testdata/scripts/wapboundpush.script
+../te_wapstack/scripts/WapBoundPush.script	/epoc32/release/winscw/urel/z/testdata/scripts/wapboundpush.script
+
+../te_wapstack/scripts/WapBoundWSP.script	/epoc32/release/wins/udeb/z/testdata/scripts/wapboundwsp.script
+../te_wapstack/scripts/WapBoundWSP.script	/epoc32/release/wins/urel/z/testdata/scripts/wapboundwsp.script
+../te_wapstack/scripts/WapBoundWSP.script	/epoc32/release/winscw/udeb/z/testdata/scripts/wapboundwsp.script
+../te_wapstack/scripts/WapBoundWSP.script	/epoc32/release/winscw/urel/z/testdata/scripts/wapboundwsp.script
+
+../te_wapstack/scripts/WapFullySpecWDP.script	/epoc32/release/wins/udeb/z/testdata/scripts/wapfullyspecwdp.script
+../te_wapstack/scripts/WapFullySpecWDP.script	/epoc32/release/wins/urel/z/testdata/scripts/wapfullyspecwdp.script
+../te_wapstack/scripts/WapFullySpecWDP.script	/epoc32/release/winscw/udeb/z/testdata/scripts/wapfullyspecwdp.script
+../te_wapstack/scripts/WapFullySpecWDP.script	/epoc32/release/winscw/urel/z/testdata/scripts/wapfullyspecwdp.script
+
+../te_wapstack/scripts/WapFullySpecPush.script	/epoc32/release/wins/udeb/z/testdata/scripts/wapfullyspecpush.script
+../te_wapstack/scripts/WapFullySpecPush.script	/epoc32/release/wins/urel/z/testdata/scripts/wapfullyspecpush.script
+../te_wapstack/scripts/WapFullySpecPush.script	/epoc32/release/winscw/udeb/z/testdata/scripts/wapfullyspecpush.script
+../te_wapstack/scripts/WapFullySpecPush.script	/epoc32/release/winscw/urel/z/testdata/scripts/wapfullyspecpush.script
+
+../te_wapstack/scripts/WapFullySpecWSP.script	/epoc32/release/wins/udeb/z/testdata/scripts/wapfullyspecwsp.script
+../te_wapstack/scripts/WapFullySpecWSP.script	/epoc32/release/wins/urel/z/testdata/scripts/wapfullyspecwsp.script
+../te_wapstack/scripts/WapFullySpecWSP.script	/epoc32/release/winscw/udeb/z/testdata/scripts/wapfullyspecwsp.script
+../te_wapstack/scripts/WapFullySpecWSP.script	/epoc32/release/winscw/urel/z/testdata/scripts/wapfullyspecwsp.script
+
+../te_wapstack/scripts/UDPPush.script		/epoc32/release/wins/udeb/z/testdata/scripts/udppush.script
+../te_wapstack/scripts/UDPPush.script		/epoc32/release/wins/urel/z/testdata/scripts/udppush.script
+../te_wapstack/scripts/UDPPush.script		/epoc32/release/winscw/udeb/z/testdata/scripts/udppush.script
+../te_wapstack/scripts/UDPPush.script		/epoc32/release/winscw/urel/z/testdata/scripts/udppush.script
+
+../te_wapstack/testdata/WapStackSuite.ini	/epoc32/release/wins/udeb/z/testdata/configs/wapstacksuite.ini
+../te_wapstack/testdata/WapStackSuite.ini	/epoc32/release/wins/urel/z/testdata/configs/wapstacksuite.ini
+../te_wapstack/testdata/WapStackSuite.ini	/epoc32/release/winscw/udeb/z/testdata/configs/wapstacksuite.ini
+../te_wapstack/testdata/WapStackSuite.ini	/epoc32/release/winscw/urel/z/testdata/configs/wapstacksuite.ini
+
+../te_wapstack/testdata/UDPPush.ini		/epoc32/release/wins/udeb/z/testdata/configs/udppush.ini
+../te_wapstack/testdata/UDPPush.ini		/epoc32/release/wins/urel/z/testdata/configs/udppush.ini
+../te_wapstack/testdata/UDPPush.ini		/epoc32/release/winscw/udeb/z/testdata/configs/udppush.ini
+../te_wapstack/testdata/UDPPush.ini		/epoc32/release/winscw/urel/z/testdata/configs/udppush.ini
+
+../te_wapstack/testdata/pushpdu.bin		/epoc32/release/wins/udeb/z/testdata/configs/pushpdu.bin
+../te_wapstack/testdata/pushpdu.bin		/epoc32/release/wins/urel/z/testdata/configs/pushpdu.bin
+../te_wapstack/testdata/pushpdu.bin		/epoc32/release/winscw/udeb/z/testdata/configs/pushpdu.bin
+../te_wapstack/testdata/pushpdu.bin		/epoc32/release/winscw/urel/z/testdata/configs/pushpdu.bin
+
+../te_wapstack/testdata/WapStackSuite.xml	/epoc32/release/wins/udeb/z/testdata/configs/wapstacksuite.xml
+../te_wapstack/testdata/WapStackSuite.xml	/epoc32/release/wins/urel/z/testdata/configs/wapstacksuite.xml
+../te_wapstack/testdata/WapStackSuite.xml	/epoc32/release/winscw/udeb/z/testdata/configs/wapstacksuite.xml
+../te_wapstack/testdata/WapStackSuite.xml	/epoc32/release/winscw/urel/z/testdata/configs/wapstacksuite.xml
+
+../te_wapstack/testdata/WapSIMTSY.txt		/epoc32/release/wins/udeb/z/testdata/configs/wapsimtsy.txt
+../te_wapstack/testdata/WapSIMTSY.txt		/epoc32/release/wins/urel/z/testdata/configs/wapsimtsy.txt
+../te_wapstack/testdata/WapSIMTSY.txt		/epoc32/release/winscw/udeb/z/testdata/configs/wapsimtsy.txt
+../te_wapstack/testdata/WapSIMTSY.txt		/epoc32/release/winscw/urel/z/testdata/configs/wapsimtsy.txt
+
+../te_wapstack/testdata/WapStackSuite_Config.ini	/epoc32/release/wins/udeb/z/testdata/configs/wapstacksuite_config.ini
+../te_wapstack/testdata/WapStackSuite_Config.ini	/epoc32/release/wins/urel/z/testdata/configs/wapstacksuite_config.ini
+../te_wapstack/testdata/WapStackSuite_Config.ini	/epoc32/release/winscw/udeb/z/testdata/configs/wapstacksuite_config.ini
+../te_wapstack/testdata/WapStackSuite_Config.ini	/epoc32/release/winscw/urel/z/testdata/configs/wapstacksuite_config.ini
+
+PRJ_MMPFILES
+// Client API implementation
+../group/wapmsgcli.mmp
+// Shortened WAP stack
+../group/swapmsg.mmp
+
+PRJ_TESTMMPFILES
+// Shortened WAP stack tests
+../te_wapstack/group/WapStackSuite.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/group/hwWapStackConfig.ini	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,1 @@
+RadioBearer= CDMA
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/group/releasenote.txt	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,46 @@
+TEXT OF RELEASE NOTE  for Wap Messaging API:
+
+Release 4:
+19/12/2001
+Pending  Changelist number: 139990
+
+Releasenote.txt created and backdated using changelist information.
+Fixed defects:
+ BEU-55DJG3 "4 test harnesses panic with KWapMsgPanicDescriptor "
+ BEU-55DKCJ "Under mem leak testing: ALL the  test harnesses commit an Access Violation"
+ BEU-55HNAZ "T_WDPFullySpec has got 3 resources leaked under OOM testing"
+ BEU-55HG9S "Bad Handle panic  running T_WDPFullySpec OOM  test "
+
+Release 3:
+10/12/2001
+Changelist number: 137374
+
+Changes made after code review of component.
+
+Placed error codes in Wap namespace, and made more unique.
+Removed non relevant comments.
+Replaced empty _LIT's with KNullDesC8
+Added a panic if non-null pointer is passed in to GetLocalAddress
+
+
+Release 2:
+28/11/2001
+Change list number: 133670
+Second release of Wap Messaging API.
+All functions now implemented, and test code submitted as well.
+
+
+Release 1:
+09/11/2001
+Change list number: 128473
+
+Early release of new Hurricane WAP Messaging API.
+This is being released into the mainline now so clients can start to implement code changes against this incomplete, but frozen API, release.
+
+This is a new replacement API for part of the wapstack, but the existing APIs still remain at present, and so no clients will be effected by this components early release.
+
+The new component has been added to the gt.txt file to be build as part of the mainline.
+
+
+END OF RELEASE NOTE TEXT
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/group/swapmsg.mmp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,55 @@
+// Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+// WAP message API ECOM plug-in
+// swswapmsg.dll Supports connectionless WDP, WSP, Push.
+// 
+//
+
+/**
+ @file 
+*/
+
+OPTION CW   -w off
+target swswapmsg.dll
+targettype plugin
+
+UID	0x10009D8D 	0x101fbb36
+VENDORID 0x70000001
+	
+#include <comms-infras/commsdebugutility.mmh>
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE		 ../. ../inc
+
+SOURCEPATH ../sws
+
+SOURCE			swswapmsg.cpp 
+#include "../sws/swswapmsgsource.mmpi"
+
+
+start resource 101fbb36.rss
+target swswapmsg.rsc
+end
+
+// Get GDB symbols included?
+SRCDBG
+
+LIBRARY	euser.lib wapmsgcli.lib insock.lib esock.lib efsrv.lib
+
+
+
+CAPABILITY ALL -Tcb
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/group/wap-stack_wapmessage.history.xml	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<relnotes name="WAP Message API">
+  <purpose>
+    WAP Push, connectionless WSP, and WDP datagram APIs.
+  </purpose>
+
+  <defect number="PDEF105298" title="Cannot recreate watcher plugin thread if Wap Watcher in ROM and watchers panic" revision="001">
+  <defect number="PDEF118743" title="No checks for null in CWapMessageApiAgent::~CWapMessageApiAgent()" revision="002">
+    
+  </defect>
+</relnotes>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/group/wap-stack_wapmessage.mrp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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	wap-stack_wapmessage
+source	\sf\os\cellularsrv\wapstack\wapmessageapi
+binary	\sf\os\cellularsrv\wapstack\wapmessageapi\group	all
+exports	\sf\os\cellularsrv\wapstack\wapmessageapi\group
+notes_source	\component_defs\release.src
+
+
+ipr E 
+ipr T \sf\os\cellularsrv\wapstack\wapmessageapi\te_wapstack
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/group/wapmessage.iby	Tue May 18 17:12:08 2010 +0100
@@ -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: 
+*
+*/
+
+#ifndef __WAPMESSAGE_IBY__
+#define __WAPMESSAGE_IBY__
+
+file=ABI_DIR\DEBUG_DIR\wapmsgcli.dll	System\Libs\wapmsgcli.dll
+ECOM_PLUGIN(swswapmsg.dll,101fbb36.rsc)
+
+    #ifdef CDMA
+    data=ZSYSTEM\Data\hwWapstackConfig.ini System\Data\wapstackconfig.ini
+    #endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/group/wapmsgcli.mmp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+
+@SYMPurpose wapmsgcli.dll Wap messaging Ecom plug-in
+*/
+
+OPTION CW   -w off
+TARGET		wapmsgcli.dll
+TARGETTYPE	DLL
+
+UID	0x1000008D 	0x101f447A
+VENDORID 0x70000001
+	
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+USERINCLUDE		 ../. ../inc
+
+SOURCEPATH ../client
+
+#include "../client/wapmsgclisource.mmpi"
+
+// Get GDB symbols included?
+//SRCDBG
+
+LIBRARY	euser.lib ecom.lib esock.lib insock.lib
+
+CAPABILITY ALL -Tcb
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/inc/wapmessage.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,902 @@
+// Copyright (c) 2001-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 __WAPMESSAGE_H__
+#define __WAPMESSAGE_H__
+
+
+#include <e32base.h>
+#include <e32std.h>
+#include <in_sock.h>
+#include <nifman.h>
+#include <in_iface.h>
+
+/** 
+* @file
+*
+* The WAP Messaging API.  
+*
+* Four interfaces are defined that provide bound and fully-specified versions of WDP and Connectionless Push.
+* An instantiation of each may be obtained using the CreateImplementationL() function, and must be released 
+* using Release() when no longer required.  Release() causes the instantiation to be deleted.
+*
+* For error codes returned by methods in this API, see <wapmsgerr.h>.  Most methods can return a set of general 
+* errors, with some returning additional specific errors.
+*
+* @publishedAll
+* @released since v7.0
+*/
+
+/** 
+* Defines WAP-related types and error codes. 
+*/
+namespace Wap
+	{
+	// Bearer type definition
+	typedef enum
+	/** Type definition for an enum defining WAP bearer types. */
+		{
+		/** All bearers. */
+		EAll,
+		/** Internet Protocol. */
+		EIP,
+		/** 7-bit SMS. */
+		ESMS7,
+		/** 8-bit SMS. */
+		ESMS,
+		/** 7-bit SMS. The bearers WAPSMS and WAPSMS7 are intended for WAP browsing where 
+		delivery reports are not required and the validity period is much shorter (5 minutes). */
+		EWAPSMS7,
+		/** 8-bit SMS. */
+		EWAPSMS
+		} TBearer;
+
+	// Port number definition
+	/** A port number. */
+	typedef TUint16 TPort;
+ 
+	class TAddressInfo
+	/** Encapsulates an interface name and address. */
+		{
+	public:
+		/** Interface name. */
+		TName iName;
+		/** Interface IP address. */
+		TInetAddr iAddress;
+		};
+	}
+
+
+/**
+* The WSP status type definition.
+* @internalComponent
+*/
+typedef TUint8 TWSPStatus;
+	
+/** Bound WDP */
+class CWapBoundDatagramService : public CBase
+/** 
+* Sends and receives datagrams over WDP using a specified local port.
+*
+* The class is an ECom plug-in interface. Clients use NewL() to request an implementation 
+* of the interface, and then call the interface's virtual functions to access 
+* the implementation's services. 
+*
+* The use of the plug-in architecture allows different implementations to use 
+* different underlying WAP stacks.
+*
+* Functions can return system wide error codes, and also API-specific errors 
+* as defined in wapmsgerr.h. 
+* 
+*/
+	{
+public: // creation/deletion
+	IMPORT_C static CWapBoundDatagramService* NewL();
+	IMPORT_C static CWapBoundDatagramService* NewL(const TUid& aImplementation);
+	IMPORT_C virtual ~CWapBoundDatagramService();
+
+public: // API methods
+
+	/** 
+	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
+	* subsequent incoming datagrams.
+	*
+	* This overload of Connect() allows an IP address associated with a network 
+	* interface to be specified. In multihomed systems, this can be used to specify 
+	* the network interface to which the endpoint should be bound.
+	* 
+	* All CWapBoundDatagramService implementations must automatically close this 
+	* endpoint upon destruction.
+	* 
+	* @param aBearer	The bearer to listen on. Use EAll to specify all bearers.
+	* @param aPort		The port to listen on. If set to 0, a local port will be chosen 
+	* 					for the client's first SendTo()
+	* @param aInetAddr	The IP address of the network interface that should be used 
+	*					in a multihomed system.
+	* @return			KErrNone on successful completion, or one of the system error codes 
+	* 					on failure.
+	*/
+	virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort,TInetAddr aInetAddr)=0;
+
+	/** 
+	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
+	* subsequent incoming datagrams.
+	* 
+	* All CWapBoundDatagramService implementations must automatically close this 
+	* endpoint upon destruction. 
+	* 
+	* @param aBearer	The bearer to listen on. Use EAll to specify all bearers.
+	* @param aPort		The port to listen on. If set to 0, a local port will be chosen 
+	* 					for the client's first SendTo()
+	* @return			KErrNone on successful completion, or one of the system error codes 
+	* 					on failure.
+	*/
+	virtual TInt Connect(Wap::TBearer aBearer,Wap::TPort aPort)=0;
+
+	/** Sends data to a remote endpoint. 
+	* 
+	* @param aRemoteHost	The address of the remote host to which to send the data. 
+	* 						The format of the address is bearer-specific.
+	* @param aRemotePort	The port on the remote host to which the data will be sent
+	* @param aBuffer		The data buffer to be sent
+	* @param aBearer		The bearer to be used, if the bound connection was opened with EAll
+	* @return				KErrNone on successful completion, or one of the system error codes 
+	* 						on failure.
+	*/
+virtual TInt SendTo(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, const TDesC8& aBuffer, Wap::TBearer aBearer)=0;
+
+	/** 
+	* Waits for a datagram to be received, and discovers the size of buffer required 
+	* to retrieve it.
+	* 
+	* This asynchronous method waits for a datagram to be received and will then 
+	* complete allowing the client to discover how large a buffer is needed to retrieve 
+	* the entire datagram that has been received. A later call to RecvFrom() with 
+	* a buffer of sufficient size will then allow the client to retrieve the datagram 
+	* fully. 
+	* 
+	* @param aDataSizePckg	On completion, the size of data received, in bytes
+	* @param aReqStatus		Asynchonrous status word, used to signal when a data size is known
+	* @return				KErrNone on successful completion, or one of the system error codes 
+	* 						on failure.
+	*/
+	virtual TInt AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus)=0;
+
+	/** 
+	* Receives data on a bound port. 
+	* 
+	* An asynchronous notification is sent to the client when data arrives. 
+	* 
+	* @param aRemoteHost	On completion, the bearer-dependent address of the remote 
+	* 						host from which the data was received
+	* @param aRemotePort	On completion, the port on the remote host from which the 
+	* 						data was received
+	* @param aBuffer		A client-allocated data buffer that on completion is filled 
+	* 						with data received. Data that overflows the buffer is discarded.
+	* @param aTruncated		On completion, indicates whether the received datagram was 
+	* 						truncated to fit in the client's supplied buffer
+	* @param aReqStatus		Asynchronous status word, used to notify the client that 
+	* 						a datagram was received
+	* @param aTimeout		An optional millisecond time-out which allows a timed read 
+	* 						to be made. If no data is received within the timeout period, the request 
+	* 						completes with KErrTimedOut. If a value of 0 is supplied, the timeout is infinite.
+	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt RecvFrom(TDes8& aRemoteHost, Wap::TPort& aRemotePort, TDes8& aBuffer, TBool& aTruncated, 
+							TRequestStatus& aReqStatus, TUint32 aTimeout)=0;
+ 
+	/** 
+	* Cancels a previously asynchronous RecvFrom() or AwaitRecvDataSize() request. 
+	*
+	* If a datagram arrives at the local host, it will be discarded. 
+	* 
+	*/
+	virtual void CancelRecv()=0;
+
+	/** 
+	* Gets the local port of this endpoint.
+	* 
+	* This is useful if the port was chosen automatically.
+	* 
+	* @param aPort	On return, the port number
+	* @return		KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;
+
+	/** 
+	* Gets the local address of this endpoint. 
+	* 
+	* @param aLocalHost	On return, the address of the local host. Clients must pass 
+	* 					in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
+	* 					buffer to hold the address, and passes ownership of the buffer to the client.
+	* @return			KErrNone on successful completion, or one of the system error codes on failure.
+	*/
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;
+
+	/** 
+	* Gets the bearer on which a received datagram arrived. 
+	* 
+	* This is useful when EAll was specified as the bearer in Connect().
+	* 
+	* @param aBearer	On return, the bearer
+	* @return			KErrNone on successful completion, or one of the system error codes on failure.	
+	*/
+	virtual TInt GetBearer(Wap::TBearer& aBearer)=0;
+
+	/** 
+	* Queries the WDP bearer for its maximum datagram size and its nominal datagram size.
+	*
+	* The nominal size is the size within which a datagram won't have to be split 
+	* into smaller individual messages and then re-assembled at the other end. 
+	* 
+	* The function will fail for a stream connection.
+	*
+	* @param aMaxSize		On return, the maximum datagram size
+	* @param aNominalSize	On return, the nominal datagram size
+	* @return				KErrNone on successful completion, or one of the system error codes 
+	*						on failure.
+	*/	
+	virtual TInt GetDatagramSizes(TUint16& aMaxSize, TUint16& aNominalSize)=0;
+	
+protected: // methods
+	IMPORT_C CWapBoundDatagramService();
+	IMPORT_C void ConstructL();
+
+private: // attributes
+	// D'tor Key identification required for ECOM
+	TUid iDtor_ID_Key;
+	};
+
+/** Fully-Specified WDP
+*/
+class CWapFullySpecDatagramService : public CBase
+/** 
+* Sends and receives datagrams over WDP using a specified local port and a single, 
+* named remote host.
+* 
+* The class is an ECom plug-in interface. Clients use NewL() to request an implementation 
+* of the interface, and then call the interface's virtual functions to access 
+* the implementation's services. 
+* 
+* The use of the plug-in architecture allows different implementations to use 
+* different underlying WAP stacks.
+* 
+* Functions can return system wide error codes, and also API-specific errors 
+* as defined in wapmsgerr.h. 
+*/
+	{
+public: // creation/deletion
+	IMPORT_C static CWapFullySpecDatagramService* NewL();
+	IMPORT_C static CWapFullySpecDatagramService* NewL(const TUid& aImplementation);
+	IMPORT_C virtual ~CWapFullySpecDatagramService();
+
+public: // API methods
+
+	// Connect to the wapstack, opening an endpoint which is to be used only with a single, named remote host.
+	/** 
+	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
+	* subsequent incoming datagrams.
+	*	
+	* This overload of Connect() allows an IP address associated with a network 
+	* interface to be specified. In multihomed systems, this can be used to specify 
+	* the network interface to which the endpoint should be bound.
+	* 
+	* All CWapFullySpecDatagramService implementations must automatically close 
+	* this endpoint upon destruction.
+	* 
+	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
+	* 						the data will be exchanged
+	* @param aRemotePort	The port on the remote host to which data will be sent
+	* @param aBearer		The bearer to use. EAll cannot be used.
+	* @param aInetAddr		The IP address of the network interface that should be used 
+	* 						in a multihomed system.
+	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TInetAddr aInetAddr)=0;
+
+	// Connect to the wapstack, opening an endpoint which is to be used only with a single, named remote host.
+	/** 
+	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
+	* subsequent incoming datagrams.
+	* 
+	* All CWapFullySpecDatagramService implementations must automatically close 
+	* this endpoint upon destruction.
+	* 
+	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
+	* 						the data will be exchanged
+	* @param aRemotePort	The port on the remote host to which data will be sent
+	* @param aBearer		The bearer to use. EAll cannot be used.
+	* @return 				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer)=0;
+
+	/** 
+	* Sends data on a fully-specified connection.
+	* 
+	* @param aBuffer	The data buffer to be written over the connection
+	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt Send(const TDesC8& aBuffer)=0;
+
+	/** 
+	* Waits for a datagram to be received, and discover how large a buffer is required 
+	* to retrieve it.
+	* 
+	* This asynchronous request waits for a datagram to be received and will then 
+	* complete allowing the client to discover how large a buffer is needed to retrieve 
+	* the entire datagram that has been received. A later call to Recv() with a 
+	* buffer of sufficent size will then allow the client to retrieve the datagram 
+	* fully. 
+	* 
+	* @param aDataSizePckg	On completion, the size of data received, in bytes
+	* @param aReqStatus		Asynchonrous status word, used to signal when a data size is known
+	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus)=0;
+
+	/** 
+	* Receives data on a bound port. 
+	* 
+	* An asynchronous notification is sent to the client when data arrives. 
+	* 
+	* @param aBuffer	A client-allocated data buffer that, on completion, is filled 
+	* 					with data received. Data that overflows the buffer is discarded.
+	* @param aTruncated	On completion, indicates whether the received datagram was 
+	* 					truncated to fit in the client's supplied buffer
+	* @param aReqStatus	Asynchronous status word, used to notify the client that 
+	* 					a datagram was received
+	* @param aTimeout	An optional millisecond time-out which allows a timed read 
+	* 					to be made. If no data is received within the timeout period, the request 
+	* 					completes with KErrTimedOut. If a value of 0 is supplied, the timeout is infinite.
+	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt Recv(TDes8& aBuffer, TBool& aTruncated, TRequestStatus& aReqStatus, TUint32 aTimeout)=0;
+
+	/** 
+	* Cancels a previously asynchronous Recv() or AwaitRecvDataSize() request. 
+	* 
+	* If a datagram arrives at the local host, it will be discarded. 
+	* 
+	*/
+	virtual void CancelRecv()=0;
+
+	/** 
+	* Gets the local port of this endpoint.
+	* 
+	* This is useful if the port was chosen automatically.
+	* 
+	* @param aPort	On return, the port number
+	* @return		KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;
+
+	/** 
+	* Gets the local address of this endpoint. 
+	* 
+	* @param aLocalHost	On return, the address of the local host. Clients must pass 
+	* 					in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
+	* 					buffer to hold the address, and passes ownership of the buffer to the client.
+	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;
+
+	/** 
+	* Queries the WDP bearer for its maximum datagram size and its nominal datagram size.
+	* 
+	* The nominal size is the size within which a datagram won't have to be split 
+	* into smaller individual messages and then re-assembled at the other end. 
+	* 
+	* @param aMaxSize		On return, the maximum datagram size
+	* @param aNominalSize	On return, the nominal datagram size
+	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt GetDatagramSizes(TUint16& aMaxSize, TUint16& aNominalSize)=0;
+	
+protected: // methods
+	IMPORT_C CWapFullySpecDatagramService();
+	IMPORT_C void ConstructL();
+
+private: // ECOM
+	// D'tor Key identification required for ECOM
+	TUid iDtor_ID_Key;
+	};
+
+/** Bound Connectionless Push
+*/
+class CWapBoundCLPushService : public CBase
+/** 
+* Listens for WAP Push messages from any sender.
+* 
+* The class is an ECom plug-in interface. Clients use NewL() to request an implementation 
+* of the interface, and then call the interface's virtual functions to access 
+* the implementation's services. 
+* 
+* The use of the plug-in architecture allows different implementations to use 
+* different underlying WAP stacks.
+* 
+* Functions can return system wide error codes, and also API-specific errors 
+* as defined in wapmsgerr.h. 
+* 
+*/
+{
+public: // creation/deletion
+	IMPORT_C static CWapBoundCLPushService* NewL();
+	IMPORT_C static CWapBoundCLPushService* NewL(const TUid& aImplementation);
+	IMPORT_C virtual ~CWapBoundCLPushService();
+
+public: // API methods
+
+	
+	// Opens a socket which is to be used to listen for subsequent incoming Push messages from any sender;
+	// i.e. it has only been 'bound' to the local address	 
+	/** 
+	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
+	* Push messages from any sender.
+	* 
+	* This overload of Connect() allows an IP address associated with a network 
+	* interface to be specified. In multihomed systems, this can be used to specify 
+	* the network interface to which the endpoint should be bound.
+	* 
+	* All CWapBoundCLPushService implementations must automatically close this endpoint 
+	* upon destruction.
+	* 
+	* @param aBearer	The bearer to listen on. Use EAll to specify all bearers.
+	* @param aPort		The port to listen on. If set to 0, a local port will be chosen 
+	* 					for the client's first SendTo()
+	* @param aSecure	Security flag to indicate whether WTLS should be used or not
+	* @param aInetAddr	The address of the adapter to use
+	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure, TInetAddr aInetAddr)=0;
+
+	
+	// Opens a socket which is to be used to listen for subsequent incoming Push messages from any sender;
+	// i.e. it has only been 'bound' to the local address
+	/** 
+	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
+	* Push messages from any sender.
+	* 
+	* All CWapBoundCLPushService implementations must automatically close this endpoint 
+	* upon destruction.
+	* 
+	* @param aBearer	The bearer to listen on. Use EAll to specify all bearers.
+	* @param aPort		The port to listen on. If set to 0, a local port will be chosen 
+	* 					for the client's first SendTo()
+	* @param aSecure	Security flag to indicate whether WTLS should be used or not
+	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure)=0;
+
+	/** 
+	* Requests an asynchronous notification upon arrival of the next push message 
+	* on the listening connection.
+	* 
+	* The request completes upon receipt of the message, filling the buffers with 
+	* as much received data as possible. A return code indicates whether further 
+	* data remains. The call must be re-issued for subsequent messages or to receive 
+	* remaining data from a previous push message.
+	* 
+	* @param aPushHeaders	A client-allocated buffer that, on completion, is filled 
+	* 						with the push message's header data
+	* @param aPushBody		A client-allocated buffer that, on completion, is filled with 
+	* 						the push message's body data
+	* @param aPushIdPckg	On completion, an integer ID that uniquely specifies the 
+	* 						push message
+	* @param aReqStatus		Asynchonrous status word, used by the service provider to 
+	* 						notify the client when a push message has arrived. 
+	*						EMoreData is returned if more pushed data is available.
+	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt AwaitPush(TDes8& aPushHeaders, TDes8& aPushBody, TPckgBuf<TUint8>& aPushIdPckg, TRequestStatus& aReqStatus)=0;
+
+	/** 
+	* Cancels a previous push message request.
+	* 
+	* If a push message arrives, the client will not be notified. 
+	*
+	*/
+	virtual void CancelAwaitPush()=0;
+
+	/** 
+	* Gets the local port of this endpoint.
+	* 
+	* This is useful if the port was chosen automatically. 
+	* 
+	* @param aPort	On return, the port number
+	* @return		KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;
+
+	/** 
+	* Gets the local address of this endpoint. 
+	* 
+	* @param aLocalHost	On return, the address of the local host. Clients must pass 
+	* 					in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
+	* 					buffer to hold the address, and passes ownership of the buffer to the client.
+	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;
+
+	/** 
+	* Gets the bearer on which a received datagram arrived. 
+	* 
+	* This is useful when EAll was specified as the bearer in Connect().
+	* 
+	* @param aBearer	On return, the bearer
+	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt GetBearer(Wap::TBearer& aBearer)=0;
+
+	/**
+	 * Gets the address of the remote server.
+	 *
+	 * This function cannot be called when there is an outstanding AwaitPush().
+	 *
+	 * @param aRemoteHost	On return, the address of the remote host. Clients must pass 
+	 * 						in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
+	 * 						buffer to hold the address, and passes ownership of the buffer to the client.
+	 * @return				KErrNone on successful completion, KErrNotSupported if not implemented,
+	 * 						or one of the system error codes on failure.
+	 */
+	virtual TInt GetServerAddress(HBufC8*& aRemoteHost)=0;
+	
+protected: // methods
+	IMPORT_C CWapBoundCLPushService();
+	IMPORT_C void ConstructL();
+
+private: // ECOM
+	// D'tor Key identification required for ECOM
+	TUid iDtor_ID_Key;
+};
+
+/** Fully-Specified Connectionless Push
+*/
+class CWapFullySpecCLPushService : public CBase
+/** 
+* Listens for WAP Push messages from a single, named remote host.
+* 
+* The class is an ECom plug-in interface. Clients use NewL() to request an implementation 
+* of the interface, and then call the interface's virtual functions to access 
+* the implementation's services. 
+* 
+* The use of the plug-in architecture allows different implementations to use 
+* different underlying WAP stacks.
+* 
+* Functions can return system wide error codes, and also API-specific errors 
+* as defined in wapmsgerr.h. 
+*/
+{
+public: // creation/deletion
+	IMPORT_C static CWapFullySpecCLPushService* NewL();
+	IMPORT_C static CWapFullySpecCLPushService* NewL(const TUid& aImplementation);
+	IMPORT_C virtual ~CWapFullySpecCLPushService();
+
+public: // API methods
+
+ 	// Opens a socket which is to be used only with a single, named remote host.
+	/** 
+	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
+	* Push messages from a specified remote host.
+	* 
+	* This overload of Connect() allows an IP address associated with a network 
+	* interface to be specified. In multihomed systems, this can be used to specify 
+	* the network interface to which the endpoint should be bound.
+	* 
+	* All CWapFullySpecCLPushService implementations must automatically close this 
+	* endpoint upon destruction.
+	* 
+	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
+	* 						the data will be exchanged
+	* @param aRemotePort	The port on the remote host to which data will be sent
+	* @param aBearer		The bearer to listen on. You cannot use EAll.
+	* @param aSecure		Security flag to indicate whether WTLS should be used or not
+	* @param aInetAddr		The address of the adapter to use
+	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure, TInetAddr aInetAddr)=0;
+
+	// Opens a socket which is to be used only with a single, named remote host.
+	/** 
+	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
+	* Push messages from a specified remote host.
+	* 
+	* All CWapFullySpecCLPushService implementations must automatically close this 
+	* endpoint upon destruction.
+	* 
+	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
+	* 						the data will be exchanged
+	* @param aRemotePort	The port on the remote host to which data will be sent
+	* @param aBearer		The bearer to listen on. You cannot use EAll.
+	* @param aSecure		Security flag to indicate whether WTLS should be used or not
+	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure)=0;
+
+	/** 
+	* Requests an asynchronous notification upon arrival of the next push message 
+	* on the listening connection.
+	* 
+	* The request completes upon receipt of the message, filling the buffers with 
+	* as much received data as possible. A return code indicates whether further 
+	* data remains. The call must be re-issued for subsequent messages or to receive 
+	* remaining data from a previous push message.
+	* 
+	* @param aPushHeaders	A client-allocated buffer that, on completion, is filled 
+	* 						with the push message's header data
+	* @param aPushBody		A client-allocated buffer that, on completion, is filled with 
+	* 						the push message's body data
+	* @param aPushIdPckg	On completion, an integer ID that uniquely specifies the 
+	* 						push message
+	* @param aReqStatus		Asynchronous status word, used by the service provider to 
+	* 						notify the client when a push message has arrived.  
+	* 						EMoreData is returned if more pushed data is available.
+	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt AwaitPush(TDes8& aPushHeaders, TDes8& aPushBody, TPckgBuf<TUint8>& aPushIdPckg, TRequestStatus& aReqStatus)=0;
+
+	/** 
+	* Cancels a previous push message request.
+	* 
+	* If a push message arrives, the client will not be notified. 
+	*
+	*/
+	virtual void CancelAwaitPush()=0;
+
+
+	/** 
+	* Gets the local port of this endpoint.
+	* 
+	* This is useful if the port was chosen automatically. 
+	* 
+	* @param aPort	On return, the port number
+	* @return		KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;	// // (out) the port number
+
+
+	/** 
+	* Gets the local address of this endpoint. 
+	* 
+	* @param aLocalHost	On return, the address of the local host. Clients must pass 
+	* 					in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
+	* 					buffer to hold the address, and passes ownership of the buffer to the client.
+	* @return			KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;	// // (out) the address of the local host
+
+protected: // methods
+	IMPORT_C CWapFullySpecCLPushService();
+	IMPORT_C void ConstructL();
+
+private: // ECOM
+	// D'tor Key identification required for ECOM
+	TUid iDtor_ID_Key;
+};
+
+/** Bound Connectionless WSP
+*  @released since v8.0
+*/
+class CWapBoundCLWSPService : public CBase
+{
+public: // creation/deletion
+	IMPORT_C static CWapBoundCLWSPService* NewL();
+	IMPORT_C static CWapBoundCLWSPService* NewL(const TUid& aImplementation);
+	IMPORT_C virtual ~CWapBoundCLWSPService();
+
+public: // API methods
+
+	/** 
+	 * Connects to the WAP stack, opening an endpoint that can be used for S-Unit-MethodInvoke and 
+	 * S-Unit-MethodResult primitives.
+	 *
+	 * @param aBearer	The bearer to listen on (use EAll for all bearers)
+	 * @param aPort		The port to listen on. If set to 0, a local port will be chosen for the 
+	 *					client's first MethodInvoke()
+	 * @return			KErrNone on successful completion, or one of the system error codes on failure.
+	 */
+	virtual TInt Connect(Wap::TBearer aBearer,Wap::TPort aPort, TBool aSecure)=0;
+
+	/**
+	 * Sends a request to a remote endpoint.
+	 *
+	 * @param aBearer			The bearer to be used, if the bound connection was opened with EAll
+	 * @param aRemoteHost		The address of the remote host to which to send the request. 
+	 * 							The format of the address is bearer-specific.
+	 * @param aRemotePort		The port on the remote host to which the request will be sent
+	 * @param aMethod
+	 * @param aURI
+	 * @param aReqHeaders
+	 * @param aReqBody
+	 * @param aTransactionId
+	 * @return					KErrNone on successful completion, or one of the system error codes on failure.
+	 */ 
+	virtual TInt MethodInvoke(Wap::TBearer aBearer, const TDesC8& aRemoteHost, Wap::TPort aRemotePort, TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, const TUint8 aTransactionId)=0;
+
+	/**
+	 * Waits for a datagram to be received.
+	 *
+	 * @param aReqHeaders
+	 * @param aReqBody
+	 * @param aTransactionIdPckg
+	 * @param aWspStatus
+	 * @param aReqStatus			Asynchonrous status word, used to signal when a data size is known
+	 * @param aTimeout
+	 * @return 						KErrNone on successful completion, or one of the system error codes on failure.
+	 */
+	virtual TInt MethodResult(TDes8& aReqHeaders, TDes8& aReqBody, TPckgBuf<TUint8>& aTransactionIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout)=0;
+
+	/**
+	 * Cancels a previously requested asynchronous MethodResult() notification.
+	 * 
+	 * If a datagram arrives at the local host, it will be discarded.
+	 * 
+	 */	
+	virtual void CancelReq()=0;
+
+
+	/** 
+	 * Gets the local port of this endpoint.
+	 *
+	 * This is useful if the port was chosen automatically.
+ 	 * 
+ 	 * @param aPort	On return, the port number
+	 * @return		KErrNone on successful completion, or one of the system error codes on failure.
+	 */
+	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;	// // (out) the port number
+
+	/**
+	 * Gets the local address of this endpoint.
+	 * 
+	 * @param aLocalHost	On return, the address of the local host. Clients must pass 
+	 * 						in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
+	 * 						buffer to hold the address, and passes ownership of the buffer to the client.
+	 * @return				KErrNone on successful completion, or one of the system error codes on failure.
+	 */
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;	// // (out) the address of the local host
+
+	/**
+	 * Gets the bearer on which a received datagram arrived.
+	 *
+	 * Useful when EAll was specified in Connect()
+	 *
+	 * @param aBearer	On return, the bearer
+	 * @return			KErrNone on successful completion, or one of the system error codes on failure.
+	 */
+	virtual TInt GetBearer(Wap::TBearer& /*aBearer*/)=0;
+	
+	/**
+	 * Gets the remote server address.
+	 * 
+	 * @param aServerAddress	On return, the address of the remote server. Clients must pass 
+	 * 							in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
+	 * 							buffer to hold the address, and passes ownership of the buffer to the client.
+	 * @return					KErrNone on successful completion, or one of the system error codes on failure.
+	 */
+	virtual TInt GetServerAddress(HBufC8*& aServerAddress)=0;	// // (out) the address of the remote server
+	
+protected: // methods
+	IMPORT_C CWapBoundCLWSPService();
+	IMPORT_C void ConstructL();
+
+private: // ECOM
+	// D'tor Key identification required for ECOM
+	TUid iDtor_ID_Key;
+};
+
+/** 
+* Fully-Specified Connectionless WSP
+*  @released since v8.0
+*/
+class CWapFullySpecCLWSPService : public CBase
+{
+public: // creation/deletion
+	IMPORT_C static CWapFullySpecCLWSPService* NewL();
+	IMPORT_C static CWapFullySpecCLWSPService* NewL(const TUid& aImplementation);
+	IMPORT_C virtual ~CWapFullySpecCLWSPService();
+
+public: // API methods
+
+	// Opens a socket which is to be used only with a single, named remote host.
+	/** 
+	* Connects to the WAP stack, opening an endpoint that can be used to listen for 
+	* Push messages from a specified remote host.
+	* 
+	* All CWapFullySpecCLWSPService implementations must automatically close this 
+	* endpoint upon destruction.
+	* 
+	* @param aRemoteHost	The bearer-dependent address of the remote host with which 
+	*						the data will be exchanged
+	* @param aRemotePort	The port on the remote host to which data will be sent
+	* @param aBearer		The bearer to listen on. You cannot use EAll.
+	* @param aSecure		Security flag to indicate whether WTLS should be used or not
+	* @return				KErrNone on successful completion, or one of the system error codes on failure. 
+	*/
+	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure)=0;
+
+	/**
+	 * Sends a request to a remote endpoint.
+	 * 
+	 * @param aMethod
+	 * @param aURI
+	 * @param aReqHeaders
+	 * @param aReqBody
+	 * @param aTransactionId
+	 * @return					KErrNone on successful completion, or one of the system error codes on failure.
+	 */ 
+	virtual TInt MethodInvoke(TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, TUint8 aTransactionId)=0;
+
+	/**
+	 * Waits for a datagram to be received
+	 * 
+	 * @param aReqHeaders
+	 * @param aReqBody
+	 * @param aTransactionIdPckg
+	 * @param aWspStatus
+	 * @param aReqStatus			Asynchonrous status word, used to signal when a data size is known
+	 * @param aTimeout
+	 * @return						KErrNone on successful completion, or one of the system error codes on failure.
+	 */
+	virtual TInt MethodResult(TDes8& aReqHeaders, TDes8& aReqBody, TPckgBuf<TUint8>& aTransactionIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout)=0;
+
+
+	/**
+	 * Cancels a previously-requested MethodResult() notification. 
+	 *
+	 * If a message arrives the client will not be notified.
+	 * 
+	 */ 
+	virtual void CancelReq()=0;
+
+	/** 
+	 * Gets the local port of this endpoint.
+	 *
+	 * This is useful if the port was chosen automatically.
+ 	 * 
+ 	 * @param aPort	On return, the port number
+	 * @return		KErrNone on successful completion, or one of the system error codes on failure.
+	 */
+	virtual TInt GetLocalPort(Wap::TPort& aPort)=0;	// // (out) the port number
+
+	/**
+	 * Gets the local address of this endpoint.
+	 *
+	 * @param aLocalHost	On return, the address of the local host. Clients must pass 
+	 * 						in a reference to a NULL HBufC8 pointer. The function allocates a new HBufC8 
+	 * 						buffer to hold the address, and passes ownership of the buffer to the client.
+	 * @return				KErrNone on successful completion, or one of the system error codes on failure.
+	 */
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost)=0;	// // (out) the address of the local host
+	
+protected: // methods
+	IMPORT_C CWapFullySpecCLWSPService();
+	IMPORT_C void ConstructL();
+
+private: // ECOM
+	// D'tor Key identification required for ECOM
+	TUid iDtor_ID_Key;
+};
+
+
+// Utility class for client/implementation use.
+class CWapMessageUtils : public CBase
+/** Utility functions for use with WAP Messaging. */
+	{
+public:
+	// // Return a list of all the addresses that are available
+	IMPORT_C static TInt GetLocalAddressesL(RArray<Wap::TAddressInfo>& aAddressInfo); 
+	};
+
+	
+#endif // __WAPMESSAGE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/inc/wapmsgerr.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,249 @@
+// Copyright (c) 2001-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 __WAPMSGERR_H__
+#define __WAPMSGERR_H__
+
+#include <e32base.h>
+
+namespace Wap
+/** 
+* Defines WAP-related types and error codes. 
+*/
+	{
+	_LIT(KWapMsgPanicDescriptor, "WAPMESSAGE");
+
+/** Defines start values for categories of WAP-related error codes. */
+enum 
+	{
+	/** Base value for all error codes. */
+	ERetCodeBase      = -5500,
+	/** Base value for connection-orientated WSP error codes. */
+	EWSPCORetCodeBase = ERetCodeBase + 25,
+	/** Base value for connectionless WSP error codes. */
+	EWSPCLRetCodeBase = ERetCodeBase + 50,
+	/** Base value for WTP error codes. */
+	EWTPRetCodeBase   = ERetCodeBase + 75,
+	/** Base value for WDP error codes. */
+	EWDPRetCodeBase   = ERetCodeBase + 100,
+	/** Base value for WTLS error codes. */
+	EWTLSRetCodeBase  = ERetCodeBase + 125,
+	/** Maximum value for WAP-related error codes. */
+	ERetCodeTop       = ERetCodeBase + 200
+	};
+	
+/** General WAP error codes. */
+enum TGeneralReturnCodes
+	{  
+	/** There is more data to be read. */
+	EMoreData           = ERetCodeBase + 0,
+	/** One of: no bearer set; unknown bearer; a connection exists with different bearer; 
+	* unable to get a local host name from bearer. */
+	EBearerError        = ERetCodeBase + 1,
+	/** The port is already used in another bound connection. */
+	EPortAlreadyBound   = ERetCodeBase + 2,
+	/** Local port cannot be opened. */
+	ECannotOpenPort     = ERetCodeBase + 3,
+	/** There are too many existing connections. */
+	ETooManyConnections = ERetCodeBase + 4,
+	/** Connection handle is invalid. */
+	EBadConnection      = ERetCodeBase + 5,
+	/** Passed buffer is too small. */
+	EBufferTooSmall     = ERetCodeBase + 6
+	};
+
+/** WTLS-related error codes. */
+enum TWtlsReturnCodes
+	{
+	/** Out of memory. */
+	EWtlsOutOfMemory            = EWTLSRetCodeBase + 0,
+	/** Socket error. */
+	EWtlsSocketError            = EWTLSRetCodeBase + 1,
+	/** Invalid parameter used. */
+	EWtlsBadParameters          = EWTLSRetCodeBase + 2,
+	/** Socket error. */
+	EWtlsSocketError2           = EWTLSRetCodeBase + 3,
+	/** Resume ID not found. */
+	EWtlsResumeIDNotFound       = EWTLSRetCodeBase + 4,
+	/** Resume error. */
+	EWtlsResumeError            = EWTLSRetCodeBase + 5,
+	/** Renegotiation request error. */
+	EWtlsRenegotiationRequest   = EWTLSRetCodeBase + 6,
+	/** Illegal call. */
+	EWtlsIllegalCall            = EWTLSRetCodeBase + 7,
+	/** Connection close notify error. */
+	EWtlsConnectionCloseNotify  = EWTLSRetCodeBase + 8,
+	/** Close notify error. */
+	EWtlsSessionCloseNotify     = EWTLSRetCodeBase + 9,
+	/** No connection. */
+	EWtlsNoConnection           = EWTLSRetCodeBase + 10,
+	/** Unexpected message. */
+	EWtlsUnexpectedMessage      = EWTLSRetCodeBase + 11,
+	/** Bad MAC record. */
+	EWtlsBadRecordMac           = EWTLSRetCodeBase + 12,
+	/** Decryption failed. */
+	EWtlsDecryptionFailed       = EWTLSRetCodeBase + 13,
+	/** Record overflow. */
+	EWtlsRecordOverflow         = EWTLSRetCodeBase + 14,
+	/** Handshake failure. */
+	EWtlsHandshakeFailure       = EWTLSRetCodeBase + 15,
+	/** Decompression failure. */
+	EWtlsDecompressionFailure   = EWTLSRetCodeBase + 16,
+	/** Bad certificate. */
+	EWtlsBadCertificate         = EWTLSRetCodeBase + 17,
+	/** Unsupported certificate. */
+	EWtlsUnsupportedCertificate = EWTLSRetCodeBase + 18,
+	/** Certificate revoked. */
+	EWtlsCertificateRevoked     = EWTLSRetCodeBase + 19,
+	/** Certificate expired. */
+	EWtlsCertificateExpired     = EWTLSRetCodeBase + 20,
+	/** Certificate unknown. */
+	EWtlsCertificateUnknown     = EWTLSRetCodeBase + 21,
+	/** Illegal parameter. */
+	EWtlsIllegalParameter       = EWTLSRetCodeBase + 22,
+	/** Unknown certificate authority. */
+	EWtlsUnknownCA              = EWTLSRetCodeBase + 23,
+	/** Access denied. */
+	EWtlsAccessDenied           = EWTLSRetCodeBase + 24,
+	/** Decoding error. */
+	EWtlsDecodeError            = EWTLSRetCodeBase + 25,
+	/** Decryption error. */
+	EWtlsDecryptError           = EWTLSRetCodeBase + 26,
+	/** Unknown key ID. */
+	EWtlsUnknownKeyId           = EWTLSRetCodeBase + 27,
+	/** Disabled key ID. */
+	EWtlsDisableKeyId           = EWTLSRetCodeBase + 28,
+	/** Key exchange disabled. */
+	EWtlsKeyExchangeDisabled    = EWTLSRetCodeBase + 29,
+	/** Session not ready. */
+	EWtlsSessionNotReady        = EWTLSRetCodeBase + 30,
+	/** Unknown parameter index. */
+	EWtlsUnknownParameterIndex  = EWTLSRetCodeBase + 31,
+	/** Duplicate finished Recv() call. */
+	EWtlsDuplicateFinishedRecv  = EWTLSRetCodeBase + 32,
+	/** Export restriction error. */
+	EWtlsExportRestriction      = EWTLSRetCodeBase + 33,
+	/** Protocol version error. */
+	EWtlsProtocolVersion        = EWTLSRetCodeBase + 34,
+	/** Insufficient security. */
+	EWtlsInsufficientSecurity   = EWTLSRetCodeBase + 35,
+	/** Internal error. */
+	EWtlsInternalError          = EWTLSRetCodeBase + 36,
+	/** User cancelled operation. */
+	EWtlsUserCanceled           = EWTLSRetCodeBase + 37,
+	/** No renegotiation. */
+	EWtlsNoRenegotiation        = EWTLSRetCodeBase + 38,
+
+	/** General error. */
+	EWtlsErrGeneral             = EWTLSRetCodeBase + 39,
+	/** Bulk algorithm error. */
+	EWtlsErrBulk                = EWTLSRetCodeBase + 40,
+	/** MAC algorithm error. */
+	EWtlsErrMac                 = EWTLSRetCodeBase + 41,
+	/** Sequence number mode error. */
+	EWtlsErrSequenceNumberMode  = EWTLSRetCodeBase + 42,
+	/** Key refresh rate error. */
+	EWtlsErrKeyRefreshRate      = EWTLSRetCodeBase + 43,
+
+	};
+
+/** Connection-orientated WSP error codes. */
+enum TWspCoReturnCodes
+	{
+	/** Given buffer is too small. */
+	EWspCoBufferTooSmall      = EWSPCORetCodeBase + 0,
+	/** Session handle is not valid. */
+	EWspCoInvalidSession      = EWSPCORetCodeBase + 1,
+	/** Invalid transaction. */
+	EWspCoInvalidTransaction  = EWSPCORetCodeBase + 2,
+	/** Given parameter is invalid. */
+	EWspCoParameterError      = EWSPCORetCodeBase + 3,
+	/** Session is not connected. */
+	EWspCoSessionNotConnected = EWSPCORetCodeBase + 4,
+	/** Functionality is not supported in this session. */
+	EWspCoNotSupported        = EWSPCORetCodeBase + 5,
+	/** Function is not applicable in this state of an object. */
+	EWspCoInvalidState        = EWSPCORetCodeBase + 6,
+	/** Session has been closed. */
+	EWspCoSessionClosed       = EWSPCORetCodeBase + 7,
+	/** Server MRU exceeded. */
+	EWspCoMRUExceeded         = EWSPCORetCodeBase + 8,
+	/** Invalid buffer size. */
+	EWspCoInvalidBufferSize   = EWSPCORetCodeBase + 9,
+	/** Data not available. */
+	EWspCoDataNotAvailable    = EWSPCORetCodeBase + 10,
+	/** Timeout error. */
+	EWspCoErrorTimeout        = EWSPCORetCodeBase + 11
+	};
+	
+
+/** Connectionless WSP error codes. */
+enum TWspClReturnCodes
+	{			
+	/** Given buffer is too small. */
+	EWspClBufferTooSmall      = EWSPCLRetCodeBase + 0,
+	/** Session handle is not valid. */
+	EWspClInvalidSession      = EWSPCLRetCodeBase + 1,
+	/** Given parameter is invalid. */
+	EWspClParameterError      = EWSPCLRetCodeBase + 2,
+	/** Session is not connected. */
+	EWspClSessionNotConnected = EWSPCLRetCodeBase + 3,
+	/** Functionality is not supported in this session. */
+	EWspClNotSupported        = EWSPCLRetCodeBase + 4,
+	/** Function is not applicable in this state of an object. */
+	EWspClInvalidState        = EWSPCLRetCodeBase + 5,
+	/** Session has been closed. */
+	EWspClSessionClosed       = EWSPCLRetCodeBase + 6,
+	/** Server MRU exceeded. */
+	EWspClMRUExceeded		 = EWSPCLRetCodeBase + 7,	
+	/** Invalid buffer size. */
+	EWspClInvalidBufferSize   = EWSPCLRetCodeBase + 8,
+	/** Data not available. */
+	EWspClDataNotAvailable    = EWSPCLRetCodeBase + 9,
+	/** Timeout error. */
+	EWspClErrorTimeout        = EWSPCLRetCodeBase + 10
+	};
+
+/** WTP-related error codes. */
+enum TWtpReturnCodes
+	{
+	/** Out of memory. */
+	EWtpNoMemory                 = EWTPRetCodeBase + 0,
+	/** Invalid argument. */
+	EWtpBadArgument              = EWTPRetCodeBase + 1,
+	/** Provider aborted. */
+	EWtpProviderProtoErr         = EWTPRetCodeBase + 2,
+	/** Provider aborted. */
+	EWtpProviderAbortInvalidTID  = EWTPRetCodeBase + 3,
+	/** Provider aborted. */
+	EWtpProviderAbortNoClass2    = EWTPRetCodeBase + 4,
+	/** Provider aborted. */
+	EWtpProviderAbortNoSAR       = EWTPRetCodeBase + 5,
+	/** Provider aborted. */
+	EWtpProviderAbortNoUACK      = EWTPRetCodeBase + 6,
+	/** Provider aborted. */
+	EWtpProviderAbortVers1       = EWTPRetCodeBase + 7,
+	/** Provider aborted. */
+	EWtpProviderAbortNoResponse  = EWTPRetCodeBase + 8,
+	/** Provider aborted. */
+	EWtpProviderAbortMsgTooLarge = EWTPRetCodeBase + 9,
+	/** Provider aborted. */
+	EWtpProviderAbortGeneral     = EWTPRetCodeBase + 10,
+	/** Service has shutdown. */
+	EWtpShutdownError            = EWTPRetCodeBase + 11
+	};
+}
+
+#endif // __WAPMSGERR_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/101fbb36.rss	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,133 @@
+// Copyright (c) 1997-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:
+// Registry file for WAP Messaging API, 8.0 WAP Stack bindings DLL
+// Interfaces : MWapBoundDatagramService, MWapFullySpecDatagramService,
+// MWapBoundCLPushService, MWapFullySpecCLPushService,
+// MWapBoundCLWSPService, MWapFullySpecCLWSPService,
+// 
+//
+
+#include <ecom/registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	// KUidWapMsg
+	dll_uid = 0x101FBB36;
+	interfaces = 
+		{
+		INTERFACE_INFO
+			{
+			// KUidBoundWDPInterface - MWapBoundDatagramService UID
+			interface_uid = 0x101F4471;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					// KUidSWSBoundWDPService - CSWSWapBoundWDPService UID
+					implementation_uid = 0x101FBB37;
+					version_no = 1;
+					display_name = "CSSWapBoundWDPService";
+					default_data = "swswdp/bound";
+					opaque_data = "";
+					}
+				};
+			},
+		INTERFACE_INFO
+			{
+			// KUidFullySpecWDPInterface - MWapFullySpecDatagramService UID
+			interface_uid = 0x101F4473;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					// KUidSWSFullySpecWDPService - CSWSWapFullySpecWDPService UID
+					implementation_uid = 0x101FBB38;
+					version_no = 1;
+					display_name = "CSWSWapFullySpecWDPService";
+					default_data = "swswdp/fullyspec";
+					opaque_data = "";
+					}
+				};
+			},
+		INTERFACE_INFO
+			{
+			// KUidBoundCLPushInterface - MWapBoundCLPushService UID
+			interface_uid = 0x101F4475;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					// KUidSWSBoundCLPushService - CSWSWapBoundCLPushService UID
+					implementation_uid = 0x101FBB39;
+					version_no = 1;
+					display_name = "CSWSWapBoundCLPushService";
+					default_data = "swsclpush/bound";
+					opaque_data = "";
+					}
+				};
+			},
+		INTERFACE_INFO
+			{
+			// KUidFullySpecCLPushInterface - MWapFullySpecCLPushService UID
+			interface_uid = 0x101F4477;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					// KUidSWSFullySpecCLPushService - CSWSWapFullySpecCLPushService UID
+					implementation_uid = 0x101FBB3A;
+					version_no = 1;
+					display_name = "CSWSWapFullySpecCLPushService";
+					default_data = "swsclpush/fullyspec";
+					opaque_data = "";
+					}
+				};
+			},
+		INTERFACE_INFO
+			{
+			// KUidBoundCLWSPInterface - MWapBoundCLWSPService UID
+			interface_uid = 0x101FBB3B;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					// KUidSWSBoundCLWSPService - CSWSWapBoundCLService UID
+					implementation_uid = 0x101FBB3C;
+					version_no = 1;
+					display_name = "CSWSWapBoundCLWSPService";
+					default_data = "swsclwsp/bound";
+					opaque_data = "";
+					}
+				};
+			},
+		INTERFACE_INFO
+			{
+			// KUidFullySpecCLWSPInterface - MWapFullySpecCLWSPService UID
+			interface_uid = 0x101FBB3D;
+			implementations = 
+				{
+				IMPLEMENTATION_INFO
+					{
+					// KUidSWSFullySpecCLWSPService - CSWSWapFullySpecCLWSPService UID
+					implementation_uid = 0x101FBB3E;
+					version_no = 1;
+					display_name = "CSWSWapFullySpecCLWSPService";
+					default_data = "swsclwsp/fullyspec";
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/ActiveSocket.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,1126 @@
+// Copyright (c) 2003-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 "ActiveSocket.h"
+#include <es_wsms.h>
+#include "CLWSPPduHandler.h"
+#include "wapmsgerr.h"
+#include <wap_sock.h>
+#include "WapMessageApiAgent.h"
+#include "WapSwsLog.h"
+#include "WapMsgUtils.h"
+
+using namespace Wap;
+
+void CActiveSocket::NewL(RSocketServ& aSocketServ, RPointerArray<CActiveSocket>& aActiveSockets, Wap::TBearer aBearer, TWapMessageType aType, MProgressNotify* aNotify, Wap::TPort aLocalPort, RConnection* aConnection)
+/**
+The static new function instanciates corresponding Bearers in terms of the input bearer type.
+This function is used by Bound Wap APIs which listen the incoming packet to a specific port. 
+@internalComponent
+@released
+@since v8.0
+@param aSocketServ the shared RSocketServ instance used in the Wap messaging API which owns this bearer
+@param aActiveSockets the bearer array used in the Wap messaging API which owns the bearer
+@param aBearer  the bearer to listen on (use EAll for all bearers)
+@param aType  the type of the wap message that will received
+@param aNotify  the instance to be notified when a wap message is received
+@param aLocalPort  the port to listen on
+@param aConnection the shared connection from Wap messaging API client
+*/
+	{
+	//Instanciate the corresponding
+	switch(aBearer)
+		{
+		case Wap::ESMS7:
+		case Wap::ESMS:
+		case Wap::EWAPSMS7:
+		case Wap::EWAPSMS:
+			{
+			CActiveSocket* me = new(ELeave) CActiveSocketSMS(aSocketServ, aNotify, aBearer, aLocalPort);
+			CleanupStack::PushL(me);
+			me->ConstructL(aType);
+			aActiveSockets.AppendL(me);
+			CleanupStack::Pop(me);
+			break;
+			}
+		case Wap::EIP:
+			{
+			CActiveSocket* me = new(ELeave) CActiveSocketUDP(aSocketServ, aNotify, aBearer, aLocalPort, aConnection);
+			CleanupStack::PushL(me);
+			me->ConstructL(aType);
+			aActiveSockets.AppendL(me);
+			CleanupStack::Pop(me);
+			break;
+			}
+		case Wap::EAll:
+			{
+			CActiveSocket* me = new(ELeave) CActiveSocketUDP(aSocketServ, aNotify, Wap::EIP, aLocalPort, aConnection);
+			CleanupStack::PushL(me);
+			me->ConstructL(aType);          
+			CActiveSocket* me1 = new(ELeave) CActiveSocketSMS(aSocketServ, aNotify, Wap::ESMS, aLocalPort);
+			CleanupStack::PushL(me1);
+			me1->ConstructL(aType);
+			aActiveSockets.ReserveL(2); // pre-allocate the memory                                           
+			aActiveSockets.AppendL(me1);
+			CleanupStack::Pop(me1);
+			aActiveSockets.AppendL(me);
+			CleanupStack::Pop(me);
+			break;
+			}
+		default:
+		    {
+			LOG(SwsLog::Printf(_L("CActiveSocket::NewL Unknown Bearer Type"));)
+			User::Leave(Wap::EBearerError);
+		    }
+		}
+	}
+
+void CActiveSocket::NewL(RSocketServ& aSocketServ, RPointerArray<CActiveSocket>& aActiveSockets, Wap::TBearer aBearer, TWapMessageType aType, MProgressNotify* aNotify, const TSockAddr& aRemoteAddr, RConnection* aConnection)
+/**
+The static new function instanciates corresponding Bearers in terms of the input bearer type.
+This function is used by Fully specified Wap APIs which will open a socket with a single, named remote host. 
+@internalComponent
+@released
+@since v8.0
+@param aSocketServ the shared RSocketServ instance used in the Wap messaging API which owns this bearer
+@param aActiveSockets the bearer array used in the Wap messaging API which owns the bearer
+@param aBearer the bearer to listen on (use EAll for all bearers)
+@param aType the type of the wap message that will received
+@param aNotify the instance to be notified when a wap message is received
+@param aRemoteAddr the remote host to be communicate with
+@param aConnection the shared connection from Wap messaging API client
+*/
+	{
+	//Instanciate the corresponding
+	switch(aBearer)
+		{
+		case Wap::ESMS7:
+		case Wap::ESMS:
+		case Wap::EWAPSMS7:
+		case Wap::EWAPSMS:
+			{
+			CActiveSocket* me = new(ELeave) CActiveSocketSMS(aSocketServ, aNotify, aBearer, aRemoteAddr);
+			CleanupStack::PushL(me);
+			me->ConstructL(aType);
+            aActiveSockets.AppendL(me);
+			CleanupStack::Pop(me);
+			break;
+			}
+		case Wap::EIP:
+			{
+			CActiveSocket* me = new(ELeave) CActiveSocketUDP(aSocketServ, aNotify, aBearer, aRemoteAddr, aConnection);
+			CleanupStack::PushL(me);
+			me->ConstructL(aType);
+            aActiveSockets.AppendL(me);
+			CleanupStack::Pop(me);
+			break;
+			}
+		case Wap::EAll:
+			{
+			CActiveSocket* me = new(ELeave) CActiveSocketUDP(aSocketServ, aNotify, aBearer, aRemoteAddr, aConnection);
+			CleanupStack::PushL(me);
+			me->ConstructL(aType);
+			CActiveSocket* me1 = new(ELeave) CActiveSocketSMS(aSocketServ, aNotify, aBearer, aRemoteAddr);
+			CleanupStack::PushL(me1);
+			me1->ConstructL(aType);
+            aActiveSockets.ReserveL(2); // pre-allocate the memory    
+			aActiveSockets.AppendL(me1);
+            CleanupStack::Pop(me1);
+            aActiveSockets.AppendL(me);
+            CleanupStack::Pop(me);
+			break;
+			}
+		default:
+		    {
+			LOG(SwsLog::Printf(_L("CActiveSocket::NewL Unknown Bearer Type"));)
+			User::Leave(Wap::EBearerError);
+		    }
+		}
+	}
+
+CActiveSocket::CActiveSocket(RSocketServ& aSocketServ, Wap::TBearer aBearerType, MProgressNotify* aNotify, Wap::TPort aLocalPort)
+:CActive(EPriorityStandard), iLocalAddr(0), iSocketServ(aSocketServ), iBearerType(aBearerType), iLocalPort(aLocalPort), iSocketState(ESocketIdle),iNotify(aNotify), iBuf(0,0), iRxlength(0), iBufCon(0,0)
+/**
+Constructor of bearer base class for Bound Wap APIs
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CActiveSocket::CActiveSocket(RSocketServ& aSocketServ, Wap::TBearer aBearerType, MProgressNotify* aNotify, const TSockAddr& aRemoteAddr, Wap::TPort aLocalPort): CActive(EPriorityStandard), 
+iRemoteAddr(aRemoteAddr), iLocalAddr(0), iSocketServ(aSocketServ), iBearerType(aBearerType), iLocalPort(aLocalPort), iSocketState(ESocketIdle), iNotify(aNotify), iBuf(0,0), iRxlength(0), iBufCon(0,0)
+/**
+Constructor of bearer base class for fully specified Wap APIs
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CActiveSocket::~CActiveSocket()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	Cancel();
+	iSocket.Close();
+	if (iMessageRecord) 
+		{
+		delete iMessageRecord;
+		}
+	}
+
+void CActiveSocket::ConstructL(TWapMessageType aType)
+/**
+Second Phase Constructor
+@internalComponent
+@released
+@param aType the type of Wap message which is received. 
+@since v8.0
+*/
+	{
+	iMessageRecord=CWapMessageRecord::NewL(aType);
+	}
+
+RSocket& CActiveSocket::Socket()
+/**
+To get the RSocket instance ownd by this bearer
+@internalComponent
+@released
+@since v8.0
+@returns the reference of the RSocket instance.
+*/
+	{
+	return iSocket;
+	}
+
+Wap::TBearer CActiveSocket::GetBearerType()
+/**
+To get the bearer type of this bearer
+@internalComponent
+@released
+@since v8.0
+@returns the bearer type
+*/
+	{
+	return iBearerType;
+	}
+
+TSockAddr& CActiveSocket::GetLocalAddress()
+/**
+To get the local address of this bearer
+@internalComponent
+@released
+@since v8.0
+@returns the lcoal address instance
+*/
+	{
+	iSocket.LocalName(iLocalAddr);
+	return iLocalAddr;
+	}
+
+TSockAddr& CActiveSocket::GetRemoteAddress()
+/**
+To get the remote address of the last received packet
+@internalComponent
+@released
+@since v8.0
+@returns the remote address instance
+*/
+	{
+	return iRemoteAddr;
+	}
+
+TInt CActiveSocket::GetRemoteAddress(HBufC8*& aAddr)
+/**
+To get the remote address of the last received packet
+@internalComponent
+@released
+@since v8.0
+@param aAddr the remote host name
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TRAPD(err, aAddr=iRemoteAddr.AllocL())
+	if (err==KErrNone)
+		{
+		Wap::TPort port;
+		TPtr8 des=aAddr->Des();
+		TRAP(err, CSWSWapMsgUtils::AnalyseAddrL(iRemoteAddr, iBearerType, des, port))
+		}
+	else
+		{
+		LOG(SwsLog::Printf(_L("CActiveSocketUDP::GetServerAddress: Alloc Memory Err=%d"), err);)
+		}
+	return err;
+	}
+
+TInt CActiveSocket::GetLocalPort(Wap::TPort& aLocalPort)
+/**
+To get the lcoal port of this bearer
+@internalComponent
+@released
+@since v8.0
+@param aLocalPort the local port of this bearer
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	GetLocalAddress();
+	aLocalPort=Wap::TPort(iLocalAddr.Port());
+	return KErrNone;
+	}
+
+TUint32 CActiveSocket::GetPduSize()
+/**
+To get the received Wdp Pdu length
+@internalComponent
+@released
+@since v8.0
+@returns the length of the received Wdp pdu.
+*/
+	{
+	return iMessageRecord->GetPduSize();
+	}
+
+TWapMessageState CActiveSocket::GetDataState()
+/**
+To get the state of the data that is being received
+@internalComponent
+@released
+@since v8.0
+@returns the state of the data that is being received
+*/
+	{
+	return iMessageRecord->GetDataState();
+	}
+
+void CActiveSocket::SetDataState(TWapMessageState aState)
+/**
+To set the state of the data that is being received
+@internalComponent
+@released
+@since v8.0
+@param aState the state of the data that is being received
+*/
+	{
+	iMessageRecord->SetDataState(aState);
+	}
+
+TInt CActiveSocket::GetPduData(TDes8& aBuffer, TBool& aTruncated)
+/**
+To get the received Wdp pdu.
+@internalComponent
+@released
+@since v8.0
+@param aBuffer the buffer to read the received WDP pdu
+@param aTruncated the flag to represent if the data has be truncated or not
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iMessageRecord->GetPduData(aBuffer, aTruncated);
+	}
+
+TInt CActiveSocket::GetWspData(TDes8& aWspHeader, TDes8& aWspBody, TUint8& aTransactionId, TWSPStatus& aStatus)
+/**
+To get the received Wsp header, body, tranaction ID and Wsp status.
+@internalComponent
+@released
+@since v8.0
+@param aWspHeader the buffer to read the received Wsp header
+@param aWspBody the buffer to read the received Wsp body
+@param aTransactionId the transaction ID of the received Wsp Message
+@param aStatus the Wsp status of  the received Wsp Message
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iMessageRecord->GetWspData(aWspHeader, aWspBody, aTransactionId, aStatus);
+	}
+void CActiveSocket::UnpackPduToWspDataL()
+/**
+To extract the Wsp header, body, transaction ID and status from the received WDP pdu
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	iMessageRecord->UnpackPduToWspDataL();
+	}
+
+void CActiveSocket::CleanUpData()
+	{
+	TPtr8 zero(0,0);
+	iBuf.Set(zero);
+	iBufCon.Set(zero);
+	iMessageRecord->CleanUpData();
+	}
+
+/** SMS active socket
+*/
+CActiveSocketSMS::CActiveSocketSMS(RSocketServ& aSocketServ, MProgressNotify* aNotify, Wap::TBearer aBearer, Wap::TPort aLocalPort)
+:CActiveSocket(aSocketServ, aBearer, aNotify, aLocalPort)
+/**
+Constructor of SMS bearer for Bound Wap APIs
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+CActiveSocketSMS::CActiveSocketSMS(RSocketServ& aSocketServ, MProgressNotify* aNotify, Wap::TBearer aBearer, const TSockAddr& aRemoteAddr)
+:CActiveSocket(aSocketServ, aBearer, aNotify, aRemoteAddr, (Wap::TPort)EWapPortUnspecified)
+/**
+Constructor of SMS bearer for fully specified Wap APIs
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+CActiveSocketSMS::~CActiveSocketSMS() 
+/**
+Destructor of SMS bearer for fully specified Wap APIs
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+void CActiveSocketSMS::ConstructL(TWapMessageType aType)
+/**
+Second Phase Constructor
+@internalComponent
+@released
+@param aType the type of Wap message which is received.
+@since v8.0
+*/
+	{
+	CActiveSocket::ConstructL(aType);
+	User::LeaveIfError(iSocket.Open(iSocketServ, KWAPSMSAddrFamily, KSockDatagram, KWAPSMSDatagramProtocol));
+	User::LeaveIfError(iSocket.SetOpt(KWapSmsOptionNewStyleClient,KWapSmsOptionLevel, 0));
+	TWapAddr wapAddr;
+	wapAddr.SetWapPort(TWapPortNumber(iLocalPort));
+	TInt err=iSocket.Bind(wapAddr);
+	if (err==KErrInUse)
+		{
+		User::Leave(Wap::EPortAlreadyBound);
+		}
+	}
+
+TInt CActiveSocketSMS::AwaitRecvDataSize()
+/**
+Read the received Wdp pdu length.
+@internalComponent
+@released
+@since v8.0
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TPckgBuf<TUint32>* length=iMessageRecord->GetPduSizeRef();
+	iSocket.Ioctl(KSOGetLength, iStatus, length, KSolWapProv);
+	iMessageRecord->SetDataState(ERequestingLength);
+	iSocketState=ESocketWaitingForLength;
+	SetActive();
+	return KErrNone;
+	}
+
+TInt CActiveSocketSMS::Receive()
+/**
+Read the received Wdp pdu.
+@internalComponent
+@released
+@since v8.0
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInt err=KErrNone;
+	TRAP(err, iMessageRecord->CreatePduBufferL(EFalse))
+	if (err!=KErrNone)
+		{
+		return err;
+		}
+	HBufC8*& pdu=iMessageRecord->GetPduPtr();
+	iBuf.Set(pdu->Des());
+	iSocket.RecvFrom(iBuf, iRemoteAddr, 0, iStatus);
+	iMessageRecord->SetDataState(ERequestingData);
+	iSocketState=ESocketWaitingForData;
+	SetActive();
+	return KErrNone;
+	}
+
+void CActiveSocketSMS::RunL() 
+/**
+Overload the CActive virtual methods
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	switch (iSocketState)
+		{
+	case ESocketWaitingForLength:
+			{
+			LOG(SwsLog::Printf(_L("CActiveSocketSMS::RunL() ESocketWaitingForLength"));)
+			iMessageRecord->SetDataState(EPendingLength);
+			iSocketState=ESocketIdle;
+			TWapNotificationInfo info(iBearerType, iStatus.Int());
+			TWapNotificationInfoBuf infoBuf(info);
+			iNotify->Notification(EPduLengthReceived, infoBuf);
+			break;
+			}
+	case ESocketWaitingForData:
+			{
+			LOG(SwsLog::Printf(_L("CActiveSocketSMS::RunL() ESocketWaitingForData"));)
+			iMessageRecord->SetDataState(EPendingData);
+			iSocketState=ESocketIdle;
+			TWapNotificationInfo info(iBearerType, iStatus.Int());
+			TWapNotificationInfoBuf infoBuf(info);
+			iNotify->Notification(EPduReceived, infoBuf);
+			iSocket.SetOpt(KWapSmsOptionOKToDeleteMessage,KWapSmsOptionLevel, 0);
+			break;
+			}
+	default:
+		LOG(SwsLog::Printf(_L("CActiveSocketSMS::RunL() Unknown State")););
+		}
+	}
+void CActiveSocketSMS::DoCancel() 
+/**
+Overload the CActive virtual methods
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	switch (iSocketState)
+		{
+	case ESocketWaitingForLength:
+			{
+			iSocket.CancelIoctl();
+			break;
+			}
+	case ESocketWaitingForData:
+			{
+			iSocket.CancelRecv();
+			break;
+			}
+	default:
+		LOG(SwsLog::Printf(_L("CActiveSocketSMS::DoCancel() Unknown State")););	
+		}
+	}
+
+//
+// UDP active socket
+//
+CActiveSocketUDP::CActiveSocketUDP(RSocketServ& aSocketServ, MProgressNotify* aNotify, Wap::TBearer aBearer, Wap::TPort aLocalPort, RConnection* aConnection)
+:CActiveSocket(aSocketServ, aBearer, aNotify, aLocalPort),iConnection(aConnection)
+/**
+Constructor for Bound Wap APIs
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+	
+CActiveSocketUDP::CActiveSocketUDP(RSocketServ& aSocketServ, MProgressNotify* aNotify, Wap::TBearer aBearer, const TSockAddr& aRemoteAddr, RConnection* aConnection)
+:CActiveSocket(aSocketServ, aBearer, aNotify, aRemoteAddr,0), iConnection(aConnection)
+/**
+Constructor for FullySpec Wap APIs
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+void CActiveSocketUDP::ConstructL(TWapMessageType aType)
+/**
+Second Phase constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CActiveSocket::ConstructL(aType);
+	if (!iConnection)
+		{
+		User::LeaveIfError(iSocket.Open(iSocketServ, KAfInet, KSockDatagram, KProtocolInetUdp));
+		}
+	else
+		{
+		User::LeaveIfError(iSocket.Open(iSocketServ, KAfInet, KSockDatagram, KProtocolInetUdp, *iConnection));
+		}
+	TInetAddr inetAddr(iLocalPort);
+	TInt err=iSocket.Bind(inetAddr);
+	if (err==KErrInUse)
+		{
+		User::Leave(Wap::EPortAlreadyBound);
+		}
+	}
+
+CActiveSocketUDP::~CActiveSocketUDP() 
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+TInt CActiveSocketUDP::AwaitRecvDataSize()
+/**
+Wait for Pdu data size
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	iRxlength=0;
+	TRAPD(err, iMessageRecord->CreatePduBufferL(ETrue))
+	if (err!=KErrNone)
+		{
+		return err;
+		}
+	HBufC8*& pdu=iMessageRecord->GetPduPtr();
+	iBuf.Set(pdu->Des());
+	iSocket.RecvFrom(iBuf, iRemoteAddr, 0, iStatus, iRxlength);
+	iMessageRecord->SetDataState(ERequestingLength);
+	iSocketState=ESocketWaitingForLength;
+	SetActive();
+	return KErrNone;	
+	}
+
+TInt CActiveSocketUDP::Receive()
+/**
+Receive the pdu
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	if(iMessageRecord->GetDataState()==EContinuous)
+		{
+		TRAPD(err, iMessageRecord->CreatePduBufferL(ETrue))
+		if (err!=KErrNone)
+			{
+			return err;
+			}
+		HBufC8*& pdu=iMessageRecord->GetPduPtr();
+		iBuf.Set(pdu->Des());
+		iBuf.SetLength(iBuf.Length()+1);
+		iBufCon.Set(&iBuf[iBuf.Length()-1],0,iBuf.MaxLength()-iBuf.Length());
+		iBuf.SetLength(iBuf.Length()+iRxlength()-1);
+		iSocket.RecvFrom(iBufCon, iRemoteAddr, KSockReadContinuation, iStatus,iRxlength);
+		iMessageRecord->SetDataState(ERequestingData);
+		iSocketState=ESocketWaitingForData;
+		SetActive();	
+		}
+	else
+		{
+		iMessageRecord->SetDataState(ERequestingData);
+		iSocketState=ESocketWaitingForData;
+		iStatus = KRequestPending;
+		SetActive();
+		TRequestStatus* reqStatus=&iStatus;
+		User::RequestComplete(reqStatus, KErrNone);
+		}
+	return KErrNone;
+	}
+
+void CActiveSocketUDP::RunL()
+/**
+RunL()
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	switch (iSocketState)
+		{
+	case ESocketWaitingForLength:
+			{
+			LOG(SwsLog::Printf(_L("CActiveSocketUDP::RunL() ESocketWaitingForLength"));)
+			iMessageRecord->SetPduSize(iBuf.Length()+ iRxlength());
+			if(iRxlength() > 0)
+				{
+				iMessageRecord->SetDataState(EContinuous);
+				}
+			else 
+				{
+				iMessageRecord->SetDataState(EPendingLength);
+				}
+			iSocketState=ESocketIdle;
+			TWapNotificationInfo info(iBearerType, iStatus.Int());
+			TWapNotificationInfoBuf infoBuf(info);
+			iNotify->Notification(EPduLengthReceived, infoBuf);
+			break;
+			}
+	case ESocketWaitingForData:
+			{
+			LOG(SwsLog::Printf(_L("CActiveSocketUDP::RunL() ESocketWaitingForData"));)
+			iMessageRecord->SetDataState(EPendingData);
+			iSocketState=ESocketIdle;
+			TWapNotificationInfo info(iBearerType, iStatus.Int());
+			TWapNotificationInfoBuf infoBuf(info);
+			iNotify->Notification(EPduReceived, infoBuf);
+			break;
+			}
+	default:
+		LOG(SwsLog::Printf(_L("CActiveSocketUDP::RunL() Unknown State"));)
+		break;
+		}
+	}
+
+void CActiveSocketUDP::DoCancel()
+/**
+Cancel the outstanding request on UDP bearer
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	switch (iSocketState)
+		{
+	case ESocketWaitingForLength:
+			{
+			iSocket.CancelRecv();
+			break;
+			}
+	case ESocketWaitingForData:
+			{
+			break;
+			}
+	default:
+		LOG(SwsLog::Printf(_L("CActiveSocketUDP::DoCancel() Unknown State")););	
+		}
+	}
+
+//
+//CWapMessageRecord
+//
+CWapMessageRecord* CWapMessageRecord::NewL(TWapMessageType aType)
+/**
+The static funtion to instanciate the Pdu data record
+@internalComponent
+@released
+@since v8.0
+@param aType the type of Wap message which is received.
+@returns the data record instance.
+*/
+	{
+	CWapMessageRecord* me;
+	if (aType==EWapWsp)
+		{
+		me = new(ELeave) CWspMessageRecord();
+		}
+	else
+		{
+		me = new(ELeave) CWdpMessageRecord();
+		}
+	return me;
+	}
+
+CWapMessageRecord::CWapMessageRecord()
+/**
+Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+CWapMessageRecord::~CWapMessageRecord()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	if (iPdu)
+		{
+		delete iPdu;
+		}
+	}
+
+TWapMessageState CWapMessageRecord::GetDataState()
+/**
+To get the state of the data that is being received
+@internalComponent
+@released
+@since v8.0
+returns the state of the data that is being received
+*/
+	{
+	return iState;
+	}
+
+void CWapMessageRecord::SetDataState(TWapMessageState aState)
+/**
+To set the state of the data that is being received
+@internalComponent
+@released
+@since v8.0
+@param the state of the data that is being received
+*/
+	{
+	iState=aState;
+	}
+
+TPckgBuf<TUint32>* CWapMessageRecord::GetPduSizeRef()
+/**
+To get the buffer which is used to contain the received data length
+@internalComponent
+@released
+@since v8.0
+@returns the pointer to the buffer length
+*/
+	{
+	return &iDataLength;
+	}
+
+void CWapMessageRecord::SetPduSize(TUint32 aLength)
+	{
+	iDataLength=aLength;
+	}
+
+TUint32 CWapMessageRecord::GetPduSize()
+/**
+To get the received wdp pdu length
+@internalComponent
+@released
+@since v8.0
+@returns the received wdp pdu length
+*/
+	{
+	iState=EGotLength;
+	return iDataLength();
+	}
+
+HBufC8*& CWapMessageRecord::GetPduPtr()
+/**
+To get the received wdp pdu.
+@internalComponent
+@released
+@since v8.0
+@returns the pointer the received wdp buffer
+*/
+	{
+	return iPdu;
+	}
+
+void CWapMessageRecord::CreatePduBufferL(TBool aFixLengthFlag)
+/**
+create the wdp pdu buffer according to the length
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	if (iState==EContinuous)
+		{
+		iPdu->ReAllocL(iDataLength());
+		}
+	else if (!aFixLengthFlag)
+		{
+		iPdu=HBufC8::NewL(iDataLength());
+		}
+	else
+		{
+		iPdu=HBufC8::NewL(KMaxUdpBearerDataBufferLength);
+		}
+	}
+
+void CWapMessageRecord::CleanUpData()
+/**
+clean up the receive buffer.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	if (iPdu)
+		{
+		delete iPdu;
+		iPdu=NULL;
+		}
+	iDataLength.FillZ();
+	iState=EIdle;
+	}
+
+//
+//CWspMessageRecord methods
+//
+CWspMessageRecord::CWspMessageRecord()
+/**
+Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+CWspMessageRecord::~CWspMessageRecord()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	if (iWspHeader)
+		{
+		delete iWspHeader;
+		}
+	if (iWspBody)
+		{
+		delete iWspBody;
+		}
+	}
+
+void CWspMessageRecord::UnpackPduToWspDataL()
+/**
+To unpack the received wdp pdu to wsp message.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	TWSPPduType type;
+	CCLWSPPduHandler::UnpackWSPPduL(iPdu, type, iWspHeader, iWspBody, iTransactionId, iWspStatus);
+	}
+
+TInt CWspMessageRecord::GetWspData(TDes8& aWspHeader, TDes8& aWspBody, TUint8& aTransactionId, TWSPStatus& aWspStatus)
+/**
+To read the wsp message from the buffer
+@internalComponent
+@released
+@since v8.0
+@param aWspHeader the buffer to contain the wsp header
+@param aWspBody the buffer to contain the wsp body
+@param iTransactionId the received transaction ID
+@param aWspStatus the received wsp status
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iWspHeader && !iWspBody)
+		{
+		// if no data, should not be here at all
+		LOG(SwsLog::Printf(_L("CWspMessageRecord::GetWspData() No Data Available"));)
+		CleanUpData();
+		return KErrBadDescriptor;
+		}
+	TInt ret=KErrNone;
+	//Copy the transaction ID
+	aTransactionId=iTransactionId;
+	aWspStatus=iWspStatus;
+	//Copy the header
+	TInt bufferLength;
+	if (iWspHeader)
+		{
+		bufferLength=aWspHeader.MaxLength();
+		TPtrC8 remainHeader=iWspHeader->Mid(iHeaderOffset);
+		//Client Header buffer is not long enough
+		if (bufferLength<remainHeader.Length())
+			{
+			aWspHeader.Copy(remainHeader.Ptr(), bufferLength);
+			iHeaderOffset+=bufferLength;
+			iState=EReading;
+			ret=Wap::EMoreData;
+			}
+		else
+			{
+			aWspHeader.Copy(remainHeader);
+			iHeaderOffset=0;
+			delete iWspHeader;
+			iWspHeader=NULL;
+			}
+		}
+	if (iWspBody)
+		{
+		//Copy the Body
+		bufferLength=aWspBody.MaxLength();
+		TPtrC8 remainBody=iWspBody->Mid(iBodyOffset);
+
+		//Client Header buffer is not long enough
+		if (bufferLength<remainBody.Length())
+			{
+			aWspBody.Copy(remainBody.Ptr(), bufferLength);
+			iBodyOffset+=bufferLength;
+			iState=EReading;
+			ret=Wap::EMoreData;
+			}
+		else
+			{
+			aWspBody.Copy(remainBody);
+			iBodyOffset=0;
+			delete iWspBody;
+			iWspBody=NULL;
+			}
+		}
+	//All Wsp Data has been read.
+	if (ret==KErrNone)
+		{
+		delete iPdu;
+		iPdu=NULL;
+		iDataLength.FillZ();
+		iState=EIdle;
+		}
+	return ret;
+	}
+
+TInt CWspMessageRecord::GetPduData(TDes8& /*aBuffer*/, TBool& /*aTruncated*/)
+/**
+Not supported
+@internalComponent
+@released
+@since v8.0
+*/
+	{//Should not be used
+	return KErrNotSupported;
+	}
+
+void CWspMessageRecord::CleanUpData()
+/**
+To clean up the wsp related data
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CWapMessageRecord::CleanUpData();
+	if (iWspHeader)
+		{
+		delete iWspHeader;
+		iWspHeader=NULL;
+		}
+	if (iWspBody)
+		{
+		delete iWspBody;
+		iWspBody=NULL;
+		}
+	iTransactionId=0;
+	iHeaderOffset=0;
+	iBodyOffset=0;
+	}
+//
+//CWspMessageRecord method
+//
+CWdpMessageRecord::CWdpMessageRecord()
+/**
+Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+CWdpMessageRecord::~CWdpMessageRecord()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+TInt CWdpMessageRecord::GetPduData(TDes8& aBuffer, TBool& aTruncated)
+/**
+To read the received Wdp pdu
+@internalComponent
+@released
+@since v8.0
+@param aBuffer the buffer to contain the received wdp pdu
+@param aTruncated the flag to represent if the data is truncated or not
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iPdu)
+		{
+		//Should not be here at all
+		LOG(SwsLog::Printf(_L("CWdpMessageRecord::GetPduData No Data Available"));)
+		CleanUpData();
+		return KErrBadDescriptor;
+		}
+	TInt ret=KErrNone;
+	TInt bufLength=aBuffer.MaxLength();
+	TPtrC8 remainPdu=iPdu->Mid(iPduOffset);
+	if (bufLength<remainPdu.Length())
+		{
+		aBuffer.Copy(remainPdu.Ptr(), bufLength);
+		iPduOffset+=bufLength;
+		iState=EReading;
+		aTruncated=ETrue;
+		ret=Wap::EMoreData;
+		}
+	else
+		{
+		aBuffer.Copy(remainPdu);
+		aTruncated=EFalse;
+		CleanUpData();
+		}
+	return ret;
+	}
+
+void CWdpMessageRecord::UnpackPduToWspDataL()
+/**
+Not supported
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	//Should not be used
+	User::Leave(KErrNotSupported);
+	}
+
+TInt CWdpMessageRecord::GetWspData(TDes8& /*aWspHeader*/, TDes8& /*aWspBody*/, TUint8& /*aTransactionId*/, TWSPStatus& /*aWspStatus*/)
+/**
+Not supported
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	//Should not be used
+	return KErrNotSupported;
+	}
+
+void CWdpMessageRecord::CleanUpData()
+/**
+To clean up the wdp related data
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CWapMessageRecord::CleanUpData();
+	iPduOffset=0;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/ActiveSocket.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,385 @@
+// Copyright (c) 2003-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 __ACTIVESOCKET_H__
+#define __ACTIVESOCKET_H__
+
+#include <e32std.h>
+#include <wapmessage.h>
+#include "WapSwsTimeOut.h"
+
+
+class CActiveSocketSMS;
+class CActiveSocketUDP;
+class MProgressNotify;
+
+enum TWapMessageState
+	{
+	/**
+	The state that is no outstanding request.
+	*/
+	EIdle,
+	/**
+	The state that the messaging API client is requesting data length
+	*/
+	ERequestingLength,
+	/**
+	The state the the messaging API client is requesting data
+	*/
+	ERequestingData,
+	/**
+	The state that the data size is ready to be read
+	*/
+	EPendingLength,
+	/**
+	The state that the messaging API client got the data length
+	*/
+	EGotLength,
+	/**
+	The state that the received data is ready to be read
+	*/
+	EPendingData,
+	/**
+	The state the data is being reading, but not finished
+	*/
+	EReading,
+	/**
+	The state that there are more data to be received from ESock (PRT 1.5)
+	*/
+	EContinuous
+	};
+enum TWapMessageType
+	{
+	/**
+	Wsp message
+	*/
+	EWapWsp,
+	/**
+	Wdp message
+	*/
+	EWapWdp
+	};
+enum TWapActiveSocketState
+	{
+	/**
+	No outstanding request state
+	*/
+	ESocketIdle,
+	/**
+	Waiting for the PDU length state
+	*/
+	ESocketWaitingForLength,
+	/**
+	Waiting for the PDU data state
+	*/
+	ESocketWaitingForData
+	};
+enum TWapNotificationEvent
+	{
+	/**
+	The event that PDU length is ready.
+	*/
+	EPduLengthReceived,
+	/**
+	The event thst PDU us ready
+	*/
+	EPduReceived
+	};
+
+class TWapNotificationInfo
+	{
+public:
+	inline TWapNotificationInfo(Wap::TBearer aBearer, TInt aError);
+	Wap::TBearer iBearer;
+	TInt iError;
+	};
+
+inline TWapNotificationInfo::TWapNotificationInfo(Wap::TBearer aBearer, TInt aError):
+iBearer(aBearer), iError(aError)
+	{
+	}
+
+typedef TPckgBuf<TWapNotificationInfo> TWapNotificationInfoBuf;
+
+const TUint KMaxUdpBearerDataBufferLength=1024;
+
+class CWapMessageRecord: public CBase
+/** 
+The Base class to represent the received WSP and WDP PDU
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+public:
+	static CWapMessageRecord* NewL(TWapMessageType aType);
+	virtual ~CWapMessageRecord();
+	TWapMessageState GetDataState();
+	void SetDataState(TWapMessageState aStatus);
+	void CreatePduBufferL(TBool aFixLengthFlag);
+	TPckgBuf<TUint32>* GetPduSizeRef();
+	void SetPduSize(TUint32 aLength);
+	TUint32 GetPduSize();
+	HBufC8*& GetPduPtr();
+	/**
+	To read the received Wdp pdu
+	@internalComponent
+	@released
+	@since v8.0
+	@param aBuffer(out) the buffer to contain the received wdp pdu
+	@param aTruncated(out) the flag to represent if the data is truncated or not
+	@returns KErrNone on successful completion, or one of the system error codes on failure.
+	*/
+	virtual TInt GetPduData(TDes8& aBuffer, TBool& aTruncated)=0;
+	/**
+	To unpack the received wdp pdu to wsp message.
+	@internalComponent
+	@released
+	@since v8.0
+	*/
+	virtual void UnpackPduToWspDataL()=0;
+	/**
+	To read the wsp message from the buffer
+	@internalComponent
+	@released
+	@since v8.0
+	@param aWspHeader(out) the buffer to contain the wsp header
+	@param aWspBody(out) the buffer to contain the wsp body
+	@param iTransactionId(out) the received transaction ID
+	@param aWspStatus(out) the received wsp status
+	@returns KErrNone on successful completion, or one of the system error codes on failure.
+	*/
+	virtual TInt GetWspData(TDes8& aWspHeader, TDes8& aWspBody, TUint8& aTransactionId, TWSPStatus& aWspStatus)=0;
+	virtual void CleanUpData();
+public:
+	/**The received WDP PDU Data buffer
+	*/
+	HBufC8* iPdu;
+	/**The received WDP PDU length buffer
+	*/
+	TPckgBuf<TUint32> iDataLength;
+
+protected:
+	CWapMessageRecord();
+	/**The state of the received the WSP or WDP data
+	*/
+	TWapMessageState iState;
+	};
+
+class CWspMessageRecord: public CWapMessageRecord
+/** 
+The class to represent the received WSP PDU
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+public: 
+	CWspMessageRecord();
+	~CWspMessageRecord();
+	void UnpackPduToWspDataL();
+	TInt GetWspData(TDes8& aWspHeader, TDes8& aWspBody, TUint8& aTransactionId, TWSPStatus& aWspStatus);
+	TInt GetPduData(TDes8& aBuffer, TBool& aTruncated);
+	void CleanUpData();
+private:
+	/**
+	The buffer for received Wsp header.
+	*/
+	HBufC8* iWspHeader;
+	/**
+	The buffer for received Wsp body.
+	*/
+	HBufC8* iWspBody;
+	/**
+	The received the transaction Id.
+	*/
+	TUint8 iTransactionId;
+	/**
+	The received WSP layer status
+	*/
+	TWSPStatus iWspStatus;
+	/**
+	The offset of the header for next reading
+	*/
+	TInt iHeaderOffset;
+	/**
+	The offset of the body for next reading
+	*/
+	TInt iBodyOffset;
+	};
+
+class CWdpMessageRecord: public CWapMessageRecord
+/** 
+The class to represent the received WDP PDU
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+public:
+	CWdpMessageRecord();
+	~CWdpMessageRecord();
+	void UnpackPduToWspDataL();
+	TInt GetWspData(TDes8& aWspHeader, TDes8& aWspBody, TUint8& aTransactionId, TWSPStatus& aWspStatus);
+	TInt GetPduData(TDes8& aBuffer, TBool& aTruncated);
+	void CleanUpData();
+private:
+	/**
+	The offset of the pdu for next reading
+	*/
+	TUint32 iPduOffset;
+	};
+
+class CActiveSocket: public CActive
+/** 
+The base class for the different bearer classes.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+public:
+	static void NewL(RSocketServ& aSocketServ, RPointerArray<CActiveSocket>& aActiveSockets, Wap::TBearer aBearer, TWapMessageType aType, MProgressNotify* aNotify, Wap::TPort aLocalPort, RConnection* aConnection=NULL);
+	static void NewL(RSocketServ& aSocketServ, RPointerArray<CActiveSocket>& aActiveSockets, Wap::TBearer aBearer, TWapMessageType aType, MProgressNotify* aNotify, const TSockAddr& aRemoteAddr, RConnection* aConnection=NULL);
+	virtual ~CActiveSocket();
+	virtual void ConstructL(TWapMessageType aType);
+	/**
+	Read the received Wdp pdu length.
+	@internalComponent
+	@released
+	@since v8.0
+	@returns KErrNone on successful completion, or one of the system error codes on failure.
+	*/
+	virtual TInt AwaitRecvDataSize() = 0;
+	/**
+	Read the received Wdp pdu.
+	@internalComponent
+	@released
+	@since v8.0
+	@returns KErrNone on successful completion, or one of the system error codes on failure.
+	*/
+	virtual TInt Receive() = 0;
+	TSockAddr& GetLocalAddress();
+	TInt GetLocalPort(Wap::TPort& aLocalPort);
+	TInt GetRemoteAddress(HBufC8*& aAddr);
+	TSockAddr& GetRemoteAddress();
+
+	TWapMessageState GetDataState();
+	void SetDataState(TWapMessageState aState);
+	TUint32 GetPduSize();
+	TInt GetPduData(TDes8& aBuffer, TBool& aTruncated);
+	TInt GetWspData(TDes8& aWspHeader, TDes8& aWspBody, TUint8& aTransactionId, TWSPStatus& aStatus);	
+	void UnpackPduToWspDataL();
+	Wap::TBearer GetBearerType();
+	RSocket& Socket();
+	void CleanUpData();
+
+public:
+	/**The RSocket instance to send and receive WDP PDU.
+	*/
+	RSocket iSocket;
+	/**The remote address for the last received message
+	*/
+	TSockAddr iRemoteAddr;
+	/**The local address for the last received message
+	*/
+	TSockAddr iLocalAddr;
+
+protected:
+	CActiveSocket(RSocketServ& aSocketServ, Wap::TBearer aBearerType, MProgressNotify* aNotify, Wap::TPort aLocalPort);
+	CActiveSocket(RSocketServ& aSocketServ, Wap::TBearer aBearerType, MProgressNotify* aNotify, const TSockAddr& aRemoteAddr, Wap::TPort aLocalPort);
+
+protected:
+	/**The data buffer to receive WDP or WSP message
+	*/
+	CWapMessageRecord* iMessageRecord;
+	/**The RSocketServ reference from WAP message API
+	*/
+	RSocketServ& iSocketServ;
+	/**The Bearer type
+	*/
+	Wap::TBearer iBearerType;
+	/**The port number for the last received message
+	*/
+	Wap::TPort iLocalPort;
+	/**The state of the bearer
+	*/
+	TWapActiveSocketState iSocketState;
+	/**
+	The instance that to be notified when data is received
+	*/
+	MProgressNotify* iNotify;
+	/**
+	Buffer for the first read from ESock
+	*/
+	TPtr8 iBuf;
+	/**
+	Reported remaining length for PRT 1.5 
+	*/
+	TSockXfrLength iRxlength;
+	/**
+	Buffer for continious read from ESock
+	*/
+	TPtr8 iBufCon;
+	};
+
+class CActiveSocketSMS : public CActiveSocket
+/** 
+The class represent the SMS bearer. It will open a RSocket over WapSMS protocol, send and 
+receive WDP PDU.
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	CActiveSocketSMS(RSocketServ& aSocketServ, MProgressNotify* aNotify, Wap::TBearer aBearer, Wap::TPort aLocalPort);
+	CActiveSocketSMS(RSocketServ& aSocketServ, MProgressNotify* aNotify, Wap::TBearer aBearer, const TSockAddr& aRemoteAddr);
+	virtual ~CActiveSocketSMS();
+	TInt AwaitRecvDataSize();
+	TInt Receive();
+	void ConstructL(TWapMessageType aType);
+private:
+	void RunL();
+	void DoCancel();
+};
+
+class CActiveSocketUDP : public CActiveSocket
+/** 
+The class represent the UDP bearer. It will open a RSocket over UDP protocol, send and 
+receive WDP PDU. It is not supported in released v8.0.
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	CActiveSocketUDP(RSocketServ& aSocketServ, MProgressNotify* aNotify, Wap::TBearer aBearer, Wap::TPort aLocalPort, RConnection* aConnection);
+	CActiveSocketUDP(RSocketServ& aSocketServ, MProgressNotify* aNotify, Wap::TBearer aBearer, const TSockAddr& aRemoteAddr, RConnection* aConnection);
+	virtual ~CActiveSocketUDP();
+	TInt AwaitRecvDataSize();
+	TInt Receive();
+	void ConstructL(TWapMessageType aType);
+private:
+	void RunL();
+	void DoCancel();
+	/**
+	The RConnection shared with the WAP message API client.
+	*/
+	RConnection* iConnection;
+};
+
+#endif // __ACTIVESOCKET_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/CLWSPPduHandler.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,346 @@
+// Copyright (c) 2003-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 "CLWSPPduHandler.h"
+#include "wapmsgerr.h"
+#include "WapSwsLog.h"
+
+void CCLWSPPduHandler::UnpackWSPPduL(HBufC8* aWSPPdu, TWSPPduType& aType, HBufC8*& aWSPHeader, HBufC8*& aBody, TUint8& aId, TWSPStatus& aStatus)
+/** 
+Unpack the received WSP PDU from remote peer to several data structure expected by the client.
+@internalComponent
+@released 
+@since v8.0 
+@param aWSPPdu the received WSP PDU from the remote peer. 
+@param aType the type of the received WSP PDU.
+@param aWSPHeader the WSP header of the received WSP PDU.
+@param aBody the data body of the received WSP PDU.
+@param aId the transaction ID or Push ID of the received WSP PDU.
+@param aStatus the WSP status of the received WSP PDU.
+@returns TInt KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TPtr8 des=aWSPPdu->Des();
+	if(des.Length() < KPDUTransactionIDAndPDUTypeLength)
+	{
+		LOG(SwsLog::Printf(_L("CCLWSPPduHandler::UnpackWSPPduL() Corrupted InComing Wsp PDU"));)
+		User::Leave(KErrCorrupt);
+	}
+	aId=des[KPDUHeaderTransactionIDOffSet];
+	aType=TWSPPduType(des[KPDUHeaderWSPPDUTypeOffSet]);
+	switch (aType)
+		{
+	case EReply:
+		UnpackReplyPduL(aWSPPdu, aWSPHeader, aBody, aStatus);
+		break;
+	case EPush:
+		UnpackPushPduL(aWSPPdu, aWSPHeader, aBody);
+		break;
+	default:
+		LOG(SwsLog::Printf(_L("CCLWSPPduHandler::UnpackWSPPduL() Unknown InComing Wsp PDU Type"));)
+		User::Leave(KErrCorrupt);
+		}
+	}
+
+void CCLWSPPduHandler::PackWSPPduL(HBufC8*& aWSPPdu, TWSPPduType aType, const TDesC& aURI, const TDesC8& aWSPHeader, const TDesC8& aBody, const TUint8 aId)
+/** 
+Pack the information to be sent into WSP PDU.
+@internalComponent
+@released 
+@since v8.0 
+@param aWSPPdu the WSP PDU that is to sent 
+@param aType the WSP PDU type(the method is to be invoked) 
+@param aURI  the URI where the WSP PDU goes
+@param aWSPHeader the WSP header
+@param aBody the data body
+@param aId the transaction ID
+@returns TInt KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	switch (aType)
+		{
+	case EGet:
+	case EGetOptions:
+	case EGetHead:
+	case EGetDelete:
+	case EGetTrace:
+		PackGetPduL(aWSPPdu, aType, aURI, aWSPHeader, aId);
+		break;
+	
+	case EPost:
+	case EPostPut:
+		PackPostPduL(aWSPPdu, aType, aURI, aWSPHeader, aBody, aId);
+		break;
+
+	default:
+		LOG(SwsLog::Printf(_L("CCLWSPPduHandler::PackWSPPduL() Unknown Method Invoke Wsp PDU Type"));)
+		User::Leave(Wap::EWspClParameterError);
+		}
+	}
+
+void CCLWSPPduHandler::UnpackPushPduL(HBufC8* aWSPPdu, HBufC8*& aWSPHeader, HBufC8*& aBody)
+/**
+Unpack the WSP PUSH PDU.
+@internalComponent
+@released 
+@since v8.0 
+@param aWSPPdu the received WSP PDU from the remote peer. 
+@param aWSPHeader the WSP header of the received WSP PDU.
+@param aBody the data body of the received WSP PDU.
+@returns TInt KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TPtrC8 pduBuffer(*aWSPPdu);
+	TUint32 pduLength=pduBuffer.Length();
+	TUint32 headerLength(0);
+	TInt uintvarLength(0);
+
+	// if uintvarLength less than KErrNone, then it is a error code.
+	if ((uintvarLength=UintVar(headerLength, pduBuffer, KPDUTransactionIDAndPDUTypeLength))<KErrNone)
+		{
+		User::Leave(uintvarLength);
+		}
+ 	TInt32 bodyLength= pduLength-KPDUTransactionIDAndPDUTypeLength-uintvarLength-headerLength;
+	if (bodyLength<0)
+		{
+		User::Leave(KErrCorrupt);
+		}
+	// Extract the WSP Header.
+	aWSPHeader=HBufC8::NewL(headerLength);
+	TPtr8 headerDes=aWSPHeader->Des();
+	headerDes.Copy(pduBuffer.Mid(KPDUTransactionIDAndPDUTypeLength+uintvarLength, headerLength));
+	// Extract the WSP data body.
+	aBody=HBufC8::NewL(bodyLength);
+	TPtr8 bodyDes=aBody->Des();
+	bodyDes.Copy(pduBuffer.Mid(KPDUTransactionIDAndPDUTypeLength+uintvarLength+headerLength));
+	}
+
+void CCLWSPPduHandler::UnpackReplyPduL(HBufC8* aWSPPdu, HBufC8*& aWSPHeader, HBufC8*& aBody, TWSPStatus& aStatus)
+/**
+Unpack the WSP Reply PDU.
+@internalComponent
+@released 
+@since v8.0 
+@param aWSPPdu the received WSP PDU from the remote peer. 
+@param aWSPHeader the WSP header of the received WSP PDU.
+@param aBody the data body of the received WSP PDU.
+@param aStatus the WSP status of the received WSP PDU.  
+@returns TInt KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TPtrC8 pduBuffer(*aWSPPdu);
+	TUint32 pduLength=pduBuffer.Length();
+
+	//Extract the WSP status
+	aStatus=pduBuffer[KPDUTransactionIDAndPDUTypeLength];
+
+	TUint32 headerLength(0);
+	TInt uintvarLength(0);
+	// if uintvarLength less than KErrNone, then it is a error code.
+	if ((uintvarLength=UintVar(headerLength, pduBuffer, KPDUTransactionIDAndPDUTypeLength+KWSPStatusLength))<KErrNone)
+		{
+		User::Leave(uintvarLength);
+		}
+		
+	TInt32 bodyLength= pduLength-KPDUTransactionIDAndPDUTypeLength-KWSPStatusLength-uintvarLength-headerLength;
+	if (bodyLength<0)
+		{
+		User::Leave(KErrCorrupt);
+		}
+		
+	// Extract the WSP Header.
+	aWSPHeader=HBufC8::NewL(headerLength);
+	TPtr8 headerDes=aWSPHeader->Des();
+	headerDes.Copy(pduBuffer.Mid(KPDUTransactionIDAndPDUTypeLength+KWSPStatusLength+uintvarLength, headerLength));
+
+	// Extract the WSP data body.
+	aBody=HBufC8::NewL(bodyLength);
+	TPtr8 bodyDes=aBody->Des();
+	bodyDes.Copy(pduBuffer.Mid(KPDUTransactionIDAndPDUTypeLength+KWSPStatusLength+uintvarLength+headerLength));
+	}
+
+void CCLWSPPduHandler::PackPostPduL(HBufC8*& aWSPPdu, TWSPPduType aType, const TDesC& aURI, const TDesC8& aWSPHeader, const TDesC8& aBody, const TUint8 aId)
+/** 
+Pack the WSP Post PDU.
+@internalComponent
+@released 
+@since v8.0 
+@param aWSPPdu the WSP PDU that is to sent 
+@param aType the WSP PDU type(the method is to be invoked) 
+@param aURI the URI where the WSP PDU goes
+@param aWSPHeader the WSP header
+@param aBody the data body
+@param aId the transaction ID
+@returns TInt KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	//Convert the URI length to Varible length unsigned integer
+	TUint32 uriLength=aURI.Length();
+	HBufC8* uriLengthDes=UintVarL(uriLength);
+
+	//Convert the URI length to Varible length unsigned integer
+	TUint32 headerLength=aWSPHeader.Length();
+	HBufC8* headerLengthDes=UintVarL(headerLength);
+
+	// Calculate the pdu length
+	TUint32 pduLength = KPDUTransactionIDAndPDUTypeLength+
+						uriLengthDes->Length()+
+						headerLengthDes->Length()+
+						uriLength+
+						headerLength+
+						aBody.Length();
+
+	//Build the PDU.
+	aWSPPdu = HBufC8::NewL(pduLength);
+	TPtr8 pduPtr(aWSPPdu->Des());
+	pduPtr.Append(aId);
+	pduPtr.Append(aType);
+	pduPtr.Append(*uriLengthDes);
+	pduPtr.Append(*headerLengthDes);
+	pduPtr.Append(aURI);
+	pduPtr.Append(aWSPHeader);
+	pduPtr.Append(aBody);
+
+	// delete the temporary buffers
+	delete uriLengthDes;
+	delete headerLengthDes;
+	}
+void CCLWSPPduHandler::PackGetPduL(HBufC8*& aWSPPdu, TWSPPduType aType, const TDesC& aURI, const TDesC8& aWSPHeader, const TUint8 aId)
+/** 
+Pack the WSP Get PDU.
+@internalComponent
+@released 
+@since v8.0 
+@param aWSPPdu the WSP PDU that is to sent 
+@param aType the WSP PDU type(the method is to be invoked) 
+@param aURI the URI where the WSP PDU goes
+@param aWSPHeader the WSP header
+@param aId the transaction ID
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+
+	//Convert the URI length to Varible length unsigned integer
+	TUint32 uriLength=aURI.Length();
+	HBufC8* uriLengthDes=UintVarL(uriLength);
+
+	// Calculate the pdu length
+	TUint32 pduLength =	KPDUTransactionIDAndPDUTypeLength+
+						uriLengthDes->Length()+
+						uriLength+
+						aWSPHeader.Length();
+
+	// Build the PDU.
+	aWSPPdu = HBufC8::NewL(pduLength);
+	TPtr8 pduPtr(aWSPPdu->Des());
+	pduPtr.Append(aId);
+	pduPtr.Append(aType);
+	pduPtr.Append(*uriLengthDes);
+	pduPtr.Append(aURI);
+	pduPtr.Append(aWSPHeader);
+	
+	//Delete the temporary buffer
+	delete uriLengthDes;
+	}
+TInt CCLWSPPduHandler::UintVar(TUint32& aVal, TPtrC8& aBuffer, TUint aOffset)
+/** 
+Decode the variable length Unsigned integer to TUint32
+@internalComponent
+@released 
+@since v8.0 
+@param aVal the value of the variable length Unsigned integer
+@param aBuffer the descriptor that contains the variable length Unsigned integer
+@param aOffset the offset of the variable length Unsigned integer
+@returns one of the system error codes on failure, or the size of variable length Unsigned integer.
+*/
+	{
+	// have we run out of buffer?
+	if (aOffset >= (TUint)aBuffer.Length())
+		{
+		return KErrCorrupt;
+		}
+		
+	// maximum length for a uintvar is 5
+	TInt lenLeft = Min(aBuffer.Mid(aOffset).Length(), KMaxUintVarLength);
+
+	// get the first octet
+	TUint8 byte = aBuffer[aOffset++];
+	TInt numBytes = 1;
+	--lenLeft;
+
+	// Check if any of the top 3 bits, ignoring the very top 'continue' bit, are set.  
+	// Later if we see that this is a 5 byte number - we'll know it is corrupt.  
+	// Encoding uses 7 bits/number 7x5=35 and we only support a maxiumum number 
+	// of 32 bits.
+	TBool topThreeBitsSet = byte & KTop3BitSet; 
+
+	// copy over data from the byte into our return value (the top bit is a carry bit)
+	aVal = byte & KWapQuote;
+
+	// while the 'continue' bit is set and we have more data
+	while ((byte & KCarryBitMask) && (lenLeft > 0))
+		{
+		// shift our last value up
+		aVal <<= KUIntVarOctetShift;
+		// get the next byte
+		byte = aBuffer[aOffset++];
+		// copy it over to the lowest byte
+		aVal |= byte & KWapQuote;
+		--lenLeft;
+		++numBytes;
+		} 
+
+	// last octet has continue bit set ... NOT allowed Or
+	// this was encoded wrong - can't have a number bigger than 32 bits
+	if ((byte & KCarryBitMask) || (numBytes == 5 && topThreeBitsSet))
+		{
+		return KErrCorrupt;
+		}
+	// number of bytes read
+	return numBytes;
+
+	}
+
+HBufC8* CCLWSPPduHandler::UintVarL(const TUint32 aInt)
+/** 
+Encode the TUint32 to the variable length Unsigned integer
+@internalComponent
+@released 
+@since v8.0 
+@param aInt the length of the data
+@returns the descriptor that contains the variable length Unsigned integer
+*/
+	{
+	TUint8 size = 0; // maximum value is 5 with a 32bit integer
+	TUint32 value=aInt;
+	do {
+		++size;
+		value >>=KUIntVarOctetShift; ; // shift by 7 bits.
+		} while (value>0);
+
+	HBufC8* output = HBufC8::NewL(size);
+	TPtr8 outPtr(output->Des());
+
+	TInt ii = size; 
+	while (--ii > 0)
+		{
+		outPtr.Append( (TUint8)(aInt>>(KUIntVarOctetShift*(ii))  & KWapQuote) | KCarryBitMask); 
+		} 
+
+	// Finally the first 7 bits, last octet, do not set first bit.
+	outPtr.Append( (TUint8)(aInt & KWapQuote) ); // Add even if 0 value.
+
+	return output;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/CLWSPPduHandler.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,141 @@
+// Copyright (c) 2003-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 __CLWSPPDUHANDLER_H__
+#define __CLWSPPDUHANDLER_H__
+#include <e32std.h>
+#include <wapmessage.h>
+
+
+/** 
+The connectionless WSP PDU type definition.
+@internalComponent
+*/
+enum TWSPPduType
+	{
+	/** the Reply PDU type assignment 
+	*/
+	EReply			=0x04,
+	/** the Push PDU type assignment 
+	*/
+	EPush			=0x06,
+	/** the Get PDU type assignment 
+	*/
+	EGet			=0x40,
+	/** the GetOption PDU type assignment 
+	*/
+	EGetOptions		=0x41,
+	/** the Gethead PDU type assignment 
+	*/
+	EGetHead		=0x42,
+	/** the GetDelete PDU type assignment 
+	*/
+	EGetDelete		=0x43,
+	/** the GetTrace PDU type assignment 
+	*/
+	EGetTrace		=0x44,
+	/** the Post PDU type assignment 
+	*/
+	EPost			=0x60,
+	/** the PostPut PDU type assignment 
+	*/
+	EPostPut		=0x61
+	};
+
+
+	/** 
+	The offset of the transactionID field in WSP PDU.
+	@internalComponent
+	 */
+	const TUint KPDUHeaderTransactionIDOffSet	=0;
+	/** 
+	The offset of the WSP PDU type field in WSP PDU.
+	@internalComponent
+	 */
+	const TUint KPDUHeaderWSPPDUTypeOffSet		=1;
+	/** 
+	The offset of WSP field.
+	@internalComponent
+	*/
+	const TUint KPDUFieldOffset					=2;
+
+	/** 
+	The length of transactionID+PDUType
+	@internalComponent
+	*/
+	const TUint8 KPDUTransactionIDAndPDUTypeLength	=2;
+	/** 
+	The length of WSP status
+	@internalComponent
+	*/
+	const TUint8 KWSPStatusLength					=1;
+
+	/**
+	The mask of top 3 bits in varible length Unsigned integer
+	@internalComponent
+	*/
+	const TUint8 KTop3BitSet		= 0x70;
+
+	/**
+	The mask to valide each byte in varible length Unsigned integer
+	@internalComponent
+	*/
+	const TUint8 KWapQuote			= 0x7F;
+
+	/**
+	The mask of carry bit in each byte in varible length Unsigned integer
+	@internalComponent
+	*/
+	const TUint8 KCarryBitMask		= 0x80;
+
+	/**
+	Maximum length for varible length Unsigned integer
+	@internalComponent
+	*/
+	const TUint8 KMaxUintVarLength	= 5;
+
+	/**
+	shift 7 bits for each byte in Uint32
+	@internalComponent
+	*/
+	const TUint8 KUIntVarOctetShift	= 7;
+
+
+
+class CCLWSPPduHandler
+/** 
+The Connectionless WSP PDU Handler. This class provides a set of static interfaces 
+for WAP message APIs to pack and unpack the WSP PDU.   
+For error codes returned by methods in this class, see <wapmsgerr.h>.  Most methods can 
+return a set of general errors, with some returning additional specific errors.
+*/
+	{
+public: 
+
+
+
+public: // Public Interfaces
+	static void UnpackWSPPduL(HBufC8* aWSPPdu, TWSPPduType& aType, HBufC8*& aWSPHeader, HBufC8*& aBody, TUint8& aId, TWSPStatus& aStatus);
+	static void PackWSPPduL(HBufC8*& aWSPPdu, TWSPPduType aType, const TDesC& aURI, const TDesC8& aWSPHeader, const TDesC8& aBody, const TUint8 aId);
+
+private: // private methods
+	static void UnpackPushPduL(HBufC8* aWSPPdu, HBufC8*& aWSPHeader, HBufC8*& aBody);
+	static void UnpackReplyPduL(HBufC8* aWSPPdu, HBufC8*& aWSPHeader, HBufC8*& aBody, TWSPStatus& aStatus);
+	static void PackPostPduL(HBufC8*& aWSPPdu, TWSPPduType aType, const TDesC& aURI, const TDesC8& aWSPHeader, const TDesC8& aBody, const TUint8 aId);
+	static void PackGetPduL(HBufC8*& aWSPPdu, TWSPPduType aType, const TDesC& aURI, const TDesC8& aWSPHeader, const TUint8 aId);
+	static TInt UintVar(TUint32& aVal, TPtrC8& aBuffer, TUint aOffset);
+	static HBufC8* UintVarL(const TUint32 aInt);
+	};
+#endif // __CLWSPPDUHANDLER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapBoundCLPush.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,198 @@
+// Copyright (c) 2003-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 "WapBoundCLPush.h"
+#include "WapMsgUtils.h"
+#include <wapmsgerr.h>
+
+CSWSWapBoundCLPushService* CSWSWapBoundCLPushService::NewL()
+/**
+Static new function
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CSWSWapBoundCLPushService* me = new(ELeave)CSWSWapBoundCLPushService();
+	CleanupStack::PushL(me);
+	me->ConstructL();
+	CleanupStack::Pop(me);
+	return me;
+	}
+
+CSWSWapBoundCLPushService::~CSWSWapBoundCLPushService()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	delete iAgent;
+	}
+
+CSWSWapBoundCLPushService::CSWSWapBoundCLPushService()
+/**
+Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+void CSWSWapBoundCLPushService::ConstructL()
+/**
+Second Phase Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	// Parent class construction
+	CWapBoundCLPushService::ConstructL();
+	iAgent=CWspMessageApiAgent::NewL();
+	}
+
+TInt CSWSWapBoundCLPushService::Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure, TInetAddr /*aInetAddr*/)
+/**
+Opens a Wsp EndPoint which is to be used to listen for subsequent incoming Push messages from any sender;
+@internalComponent
+@released
+@since v8.0
+@param aBearer (in) the bearer to listen on (use EAll for all bearers)
+@param aPort (in) the port to listen on. If set to 0, a local port will be chosen for the client's first SendTo
+@param aSecure (in) security flag indicates whether WTLS will be used or not
+@param aInetAddr (in) the address of the adapter to use
+@returns TInt KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if(aSecure) 
+		{
+		return KErrNotSupported;
+		}
+	return iAgent->Connect(aBearer, aPort, aSecure);
+	}
+
+TInt CSWSWapBoundCLPushService::Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure)
+/**
+Opens a socket which is to be used to listen for subsequent incoming Push messages from any sender;
+@internalComponent
+@released
+@since v8.0
+@param aBearer (in) the bearer to listen on (use EAll for all bearers)
+@param aPort (in) the port to listen on. If set to 0, a local port will be chosen for the client's first SendTo
+@param aSecure (in) security flag indicates whether WTLS will be used or not
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInetAddr inetAddr( KInetAddrAny, 0);
+	return( Connect(aBearer, aPort, aSecure, inetAddr) );
+	}
+
+TInt CSWSWapBoundCLPushService::AwaitPush(TDes8& aPushHeaders, TDes8& aPushBody, TPckgBuf<TUint8>& aPushIdPckg, TRequestStatus& aReqStatus)
+/**
+Request an asynchronous notification upon arrival of the next push messages on the listening connection.
+The request completes upon receipt of the message, filling the buffers with as much received data as possible.
+A return code will indicate whether further data remains.  The call must be re-issued for subsequent messages
+or to receive remaining data from a previous push message.
+@internalComponent
+@released
+@since v8.0
+@param aPushHeaders (out) (client-allocated) - when a push message arrives the header data is written here
+@param aPushBody (out) (client-allocated) - when a push message arrives the body data is written here
+@param aPushIdPckg (out) when a push message arrives an integer ID that uniquely specifies the message is written here
+@param aReqStatus (inout) used by the service provider to notify the client when a push has arrived.
+EMoreData is returned if more pushed data is available
+@retval KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInt err = iAgent->ReceiveWspMessage(aPushHeaders, aPushBody, aPushIdPckg, iWspStatus, aReqStatus, 0);
+	if(err == Wap::EMoreData)
+	{
+		return KErrNone;
+	}
+	return err;
+	}
+
+void CSWSWapBoundCLPushService::CancelAwaitPush()
+/**
+Cancel a previously-requested push message notification. If a push message arrives the client will not be notified.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	iAgent->CancelRequest();
+	}
+
+TInt CSWSWapBoundCLPushService::GetLocalPort(Wap::TPort& aPort)
+/**
+Get the local address of this endpoint.
+@internalComponent
+@released
+@since v8.0
+@param aPort (out) the port of the local host
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalPort(aPort);
+	}
+
+TInt CSWSWapBoundCLPushService::GetLocalAddress(HBufC8*& aLocalHost)
+/**
+Get the local address of this endpoint.
+@internalComponent
+@released
+@since v8.0
+@param aLocalHost (inout) the address of the local host. A reference to a HBufC8 pointer should
+be passed in. This pointer MUST be null! A HBufC8 will be allocated to hold the address, ownership
+of this buffer will be passed over to the client.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalAddress(aLocalHost);
+	}
+
+TInt CSWSWapBoundCLPushService::GetBearer(Wap::TBearer& aBearer)
+/**
+Get the bearer on which the push message arrived.
+Useful when EAll was specified in Connect()
+@internalComponent
+@released
+@since v8.0
+@param aBearer (out) the bearer
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetBearer(aBearer);
+	}
+
+TInt CSWSWapBoundCLPushService::GetServerAddress(HBufC8*& aRemoteHost)
+/**
+Get the address of the remote server
+@internalComponent
+@released
+@since v8.0
+Cannot be called when there is an outstanding AwaitPush().
+@param aRemoteHost the address of the remote server.
+A reference to a HBufC8 pointer should be passed in. An HBufC8 will be allocated
+to hold the address ,ownership of this buffer will be passed over to the client.
+@returns KErrNone on successful completion, KErrNotSupported if not implemented or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetServerAddress(aRemoteHost);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapBoundCLPush.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,70 @@
+// Copyright (c) 2003-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 __CSWSWAPBOUNDCLPUSHSERVICE_H__
+#define __CSWSWAPBOUNDCLPUSHSERVICE_H__
+
+// Include definitions of ECOM interfaces for the WAP Messaging API
+#include <wapmessage.h>
+#include "WapMessageApiAgent.h"
+
+
+
+class CSWSWapBoundCLPushService : public CWapBoundCLPushService
+/** 
+The WAP Messaging API, SWS WAP Stack binding.  Implementation of the bound CLPush API.
+@internalComponent
+@released
+@since v8.0
+*/ 
+{
+public:
+	static CSWSWapBoundCLPushService* NewL();
+	virtual ~CSWSWapBoundCLPushService();
+
+public:
+	virtual TInt Connect(Wap::TBearer aBearer,
+					  Wap::TPort aPort,
+					  TBool aSecure,
+					  TInetAddr aInetAddr);
+	virtual TInt Connect(Wap::TBearer aBearer,
+					  Wap::TPort aPort,
+					  TBool aSecure);
+	virtual TInt AwaitPush(TDes8& aPushHeaders,
+						  TDes8& aPushBody,
+						  TPckgBuf<TUint8>& aPushIdPckg,
+						  TRequestStatus& aReqStatus);
+	virtual void CancelAwaitPush();
+	virtual TInt GetLocalPort(Wap::TPort& aPort);
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost);
+	virtual TInt GetBearer(Wap::TBearer& aBearer);
+	virtual TInt GetServerAddress(HBufC8*& aRemoteHost);
+
+private:
+	CSWSWapBoundCLPushService();
+	void ConstructL();
+
+private:
+	/**
+	the agent instance which actually handles wsp PDU.
+	*/
+	CWspMessageApiAgent* iAgent;
+	/**
+	the wsp status in received wsp PDU. Not used in push.
+	*/
+	TWSPStatus iWspStatus;
+};
+
+#endif // __CSWSWAPBOUNDCLPUSHSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapBoundCLWSP.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,201 @@
+// Copyright (c) 2003-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 "WapBoundCLWSP.h"
+#include "WapMsgUtils.h"
+#include "CLWSPPduHandler.h"
+
+
+
+CSWSWapBoundCLWSPService* CSWSWapBoundCLWSPService::NewL()
+/**
+Static new function
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CSWSWapBoundCLWSPService* me = new(ELeave)CSWSWapBoundCLWSPService();
+	CleanupStack::PushL(me);
+	me->ConstructL();
+	CleanupStack::Pop(me);
+	return me;
+	}
+
+CSWSWapBoundCLWSPService::CSWSWapBoundCLWSPService()
+	: CWapBoundCLWSPService()
+/**
+Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+CSWSWapBoundCLWSPService::~CSWSWapBoundCLWSPService()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	delete iAgent;
+	}
+
+void CSWSWapBoundCLWSPService::ConstructL()
+/**
+Second phase constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	// Parent class construction
+	CWapBoundCLWSPService::ConstructL();
+	iAgent=CWspMessageApiAgent::NewL();
+	}
+
+TInt CSWSWapBoundCLWSPService::Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure)
+/**
+Opens a End-point which is to be used to listen for the incoming method result messages from any sender;
+@internalComponent
+@released
+@since v8.0
+@param aBearer (in) the bearer to listen on (use EAll for all bearers)
+@param aPort (in) the port to listen on. If set to 0, a local port will be chosen for the client's first SendTo
+@param aSecure (in) security flag indicates whether WTLS will be used or not
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if(aSecure) 
+		{
+		return KErrNotSupported;
+		}
+	return iAgent->Connect(aBearer, aPort, aSecure);
+	}
+
+TInt CSWSWapBoundCLWSPService::MethodInvoke(Wap::TBearer aBearer, const TDesC8& aRemoteHost, Wap::TPort aRemotePort, TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, const TUint8 aTransactionId)
+/**
+A synchronous call to send a method invoke method to the remote host.
+@internalComponent
+@released
+@since v8.0
+@param aBearer (in) the bearer that will be used
+@param aRemoteHost (in) the remotehost to be sent message to
+@param aRemotePort (in) the remoteport to be sent message to
+@param aMethod (in) the method that will be invoked on server
+@param aURI (in) the uri to build wsp message
+@param aReqHeaders (in) the wsp header to be used to build method invoke message
+@param aReqBody (in) the wsp body to be used to build method invoke message
+@param aTransactionId (in) the transaction Id of the method invoke message
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->SendWspMessage(aBearer, aRemoteHost, aRemotePort, TWSPPduType(aMethod), aURI, aReqHeaders, aReqBody, aTransactionId);
+	}
+
+TInt CSWSWapBoundCLWSPService::MethodResult(TDes8& aReqHeaders, TDes8& aReqBody, TPckgBuf<TUint8>& aTransactionIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout)
+/**
+Request an asynchronous notification upon arrival of the method result messages on the listening connection.
+The request completes upon receipt of the message, filling the buffers with as much received data as possible.
+A return code will indicate whether further data remains.  The call must be re-issued for subsequent messages
+or to receive remaining data from a previous method result message.
+@internalComponent
+@released
+@since v8.0
+@param aReqHeaders (out) (client-allocated) - when a method result message arrives the header data is written here
+@param aReqBody (out) (client-allocated) - when a method result message arrives the body data is written here
+@param aTransactionIdPckg (out) when a method result message arrives an integer ID that uniquely specifies the message is written here
+@param aWspStatus (out) when a method result message arrives, the wsp status is written here.
+@param aReqStatus (inout) used by the service provider to notify the client when a method result has arrived
+@param aTimeout (in) an optional millisecond time-out which allows a timed read to be made.  If no data is received 
+within the timeout period the request completes with KErrTimedOut. If a value of 0 is supplied the timeout is infinite.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->ReceiveWspMessage(aReqHeaders, aReqBody, aTransactionIdPckg, aWspStatus, aReqStatus, aTimeout);
+	}
+
+void CSWSWapBoundCLWSPService::CancelReq()
+/**
+Cancel a previously-requested method result notification. If a method result message arrives the client will not be notified.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	iAgent->CancelRequest();
+	}
+
+TInt CSWSWapBoundCLWSPService::GetLocalPort(Wap::TPort& aPort)
+/**
+Get the local address of this endpoint.
+@internalComponent
+@released
+@since v8.0
+@param aPort (out) the port of the local host
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalPort(aPort);
+	}
+
+TInt CSWSWapBoundCLWSPService::GetLocalAddress(HBufC8*& aLocalHost)
+/**
+Get the local address of this endpoint.
+@internalComponent
+@released
+@since v8.0
+@param aLocalHost (inout) the address of the local host. A reference to a HBufC8 pointer should
+be passed in. This pointer MUST be null! A HBufC8 will be allocated to hold the address, ownership
+of this buffer will be passed over to the client.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalAddress(aLocalHost);
+	}
+
+TInt CSWSWapBoundCLWSPService::GetBearer(Wap::TBearer& aBearer)
+/**
+Get the bearer on which the method result message arrived.
+Useful when EAll was specified in Connect()
+@internalComponent
+@released
+@since v8.0
+@param aBearer (out) the bearer
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetBearer(aBearer);
+	}
+
+TInt CSWSWapBoundCLWSPService::GetServerAddress(HBufC8*& aServerAddress)
+/**
+Get the remote address of the last wsp method result message
+@internalComponent
+@released
+@since v8.0
+Cannot be called when there is an outstanding MethodResult().
+@param aServerAddress the address of the remote server.
+A reference to a HBufC8 pointer should be passed in. An HBufC8 will be allocated
+to hold the address ,ownership of this buffer will be passed over to the client.
+@returns KErrNone on successful completion, KErrNotSupported if not implemented or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetServerAddress(aServerAddress);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapBoundCLWSP.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,59 @@
+// Copyright (c) 2003-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 __CSWSWAPBOUNDCLWSPSERVICE_H__
+#define __CSWSWAPBOUNDCLWSPSERVICE_H__
+
+// Include definitions of ECOM interfaces for the WAP Messaging API
+#include <wapmessage.h>
+#include "ActiveSocket.h"
+#include "WapMessageApiAgent.h"
+
+class CSWSWapBoundCLWSPService : public CWapBoundCLWSPService
+/** 
+The WAP Messaging API, SWS WAP Stack binding. Implementation of the bound Connectionless WSP API.
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	static CSWSWapBoundCLWSPService* NewL();
+	virtual ~CSWSWapBoundCLWSPService();
+
+public:
+
+	virtual TInt Connect(Wap::TBearer aBearer,Wap::TPort aPort, TBool aSecure);
+	virtual TInt MethodInvoke(Wap::TBearer aBearer, const TDesC8& aRemoteHost, Wap::TPort aRemotePort, TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, const TUint8 aTransactionId);
+	virtual TInt MethodResult(TDes8& aReqHeaders, TDes8& aReqBody, TPckgBuf<TUint8>& aTransactionIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout);
+	virtual void CancelReq();
+	virtual TInt GetLocalPort(Wap::TPort& aPort);
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost);
+	virtual TInt GetBearer(Wap::TBearer& aBearer);
+	virtual TInt GetServerAddress(HBufC8*& aServerAddress);
+private:
+	CSWSWapBoundCLWSPService();
+	void ConstructL();
+
+
+private:
+	/**
+	the agent instance which actually handles wsp PDU.
+	*/
+	CWspMessageApiAgent* iAgent;
+
+};
+
+#endif // __CSWSWAPBOUNDCLWSPSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapBoundWDP.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,227 @@
+// Copyright (c) 2003-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 "WapBoundWDP.h"
+#include "WapMsgUtils.h"
+
+
+CSWSWapBoundWDPService* CSWSWapBoundWDPService::NewL()
+/**
+Static new function
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CSWSWapBoundWDPService* me = new(ELeave)CSWSWapBoundWDPService();
+	CleanupStack::PushL(me);
+	me->ConstructL();
+	CleanupStack::Pop(me);
+	return me;
+	}
+
+CSWSWapBoundWDPService::CSWSWapBoundWDPService()
+	: CWapBoundDatagramService()
+/**
+Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+CSWSWapBoundWDPService::~CSWSWapBoundWDPService()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	delete iAgent;	
+	}
+
+void CSWSWapBoundWDPService::ConstructL()
+/**
+Second Phase Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	// Parent class construction
+	CWapBoundDatagramService::ConstructL();
+	iAgent=CWdpMessageApiAgent::NewL();	
+	}
+
+TInt CSWSWapBoundWDPService::Connect(Wap::TBearer aBearer, Wap::TPort aPort, TInetAddr /*aInetAddr*/)
+/** 
+Connect to the SWS, opening an endpoint that can be used to listen for subsequent incoming datagrams.
+@internalComponent
+@released
+@since v8.0
+@param aBearer the bearer to listen on (use EAll for all bearers)
+@param aPort the port to listen on. If set to 0, a local port will be chosen for the client's first SendTo
+@param aInetAddr the ip address of the network interface that should be used in a multihomed system.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->Connect(aBearer, aPort, EFalse);
+	}
+
+TInt CSWSWapBoundWDPService::Connect(Wap::TBearer aBearer, Wap::TPort aPort)
+/**
+Connect to the SWS, opening an endpoint that can be used to listen for subsequent incoming datagrams.
+@internalComponent
+@released
+@since v8.0
+@param aBearer the bearer to listen on (use EAll for all bearers)
+@param aPort the port to listen on. If set to 0, a local port will be chosen for the client's first SendTo
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInetAddr inetAddr( KInetAddrAny, 0);
+	return (Connect(aBearer, aPort, inetAddr));
+	}
+
+TInt CSWSWapBoundWDPService::SendTo(const TDesC8& aRemoteHost, Wap::TPort aRemotePort,
+									 const TDesC8& aBuffer, Wap::TBearer aBearer)
+/**
+Send data to a remote endpoint.
+@internalComponent
+@released
+@since v8.0
+@param aRemoteHost the bearer-dependent address of the remote host to which the data will be sent
+@param aRemotePort the port on the remote host to which the data will be sent
+@param aBuffer the data buffer to be written over the connection
+@param aBearer the bearer to be used, if the bound connection was opened with 'all'
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->SendWdpMessage(aBuffer, aRemoteHost, aRemotePort, aBearer);
+	}
+
+TInt CSWSWapBoundWDPService::AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus)
+/**
+Wait for a datagram to be received, and discover how large a buffer is required to retrieve it.
+This asyncronous method waits for a datagram to be received and will then complete allowing the client to discover how large a buffer
+is needed to retrieve the entire datagram that has been received.
+A subsiquent call to RecvFrom with a buffer of sufficent size will then allow the client to retrieve the datagram fully.
+@internalComponent
+@released
+@since v8.0
+@param aDataSizePckg the size of data subsequently received, in bytes
+@param aReqStatus used to signal when a data size is known
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->AwaitRecvDataSize(aDataSizePckg, aReqStatus);
+	}
+
+TInt CSWSWapBoundWDPService::RecvFrom(TDes8& aRemoteHost, Wap::TPort& aRemotePort, TDes8& aBuffer,
+									  TBool& aTruncated, TRequestStatus& aReqStatus, TUint32 aTimeout)
+/**
+receive data on a bound port.
+An asynchronous notification is sent to the client when data arrives.
+@internalComponent
+@released
+@since v8.0
+@param aRemoteHost the bearer-dependent address of the remote host from which the data was received
+@param aRemotePort the port on the remote host from which the data was received
+@param aBuffer a client-allocated data buffer to be filled with data received. Data that overflows the buffer is discarded.
+@param aTruncated indicates whether the received datagram was truncated to fit in the client's supplied buffer
+@param aReqStatus used to notify the client that a datagram was received
+@param aTimeout an optional millisecond time-out which allows a timed read to be made.  If no data is received 
+within the timeout period the request completes with KErrTimedOut. If a value of 0 is supplied the timeout is infinite.
+@retval TInt KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->ReceiveWdpMessage(aRemoteHost, aRemotePort, aBuffer, aTruncated, aReqStatus, aTimeout);
+	}
+
+void CSWSWapBoundWDPService::CancelRecv()
+/**
+Cancel a previously requested asynchronous RecvFrom or AwaitRecvDataSize notification. 
+If a datagram arrives at the local host, it will be discarded.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	iAgent->CancelRequest();
+	}
+
+TInt CSWSWapBoundWDPService::GetLocalPort(Wap::TPort& aPort)
+/** 
+Get the local port of this endpoint.Useful if one was chosen automatically.
+@internalComponent
+@released
+@since v8.0
+@param aPort the port number
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalPort(aPort);
+	}
+
+TInt CSWSWapBoundWDPService::GetLocalAddress(HBufC8*& aLocalHost)
+/**
+Get the local address of this endpoint.
+@internalComponent
+@released
+@since v8.0
+@param aLocalHost the address of the local host. A reference to a HBufC8 pointer should 
+be passed in. This pointer MUST be null! A HBufC8 will be allocated to hold the address, ownership 
+of this buffer will be passed over to the client.
+@returns TInt KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalAddress(aLocalHost);
+	}
+
+TInt CSWSWapBoundWDPService::GetBearer(Wap::TBearer& aBearer)
+/**
+Get the bearer on which a received datagram arrived.
+Useful when EAll was specified in Connect()
+@internalComponent
+@released
+@since v8.0
+@param aBearer the bearer
+@returns TInt KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetBearer(aBearer);
+	}
+
+TInt CSWSWapBoundWDPService::GetDatagramSizes(TUint16& aMaxSize, TUint16& aNominalSize)
+/**
+Query the WDP bearer for its maximum datagram size and its nominal datagram size.
+@internalComponent
+@released
+@since v8.0
+@param aMaxSize the maximum datagram size
+@param aNominalSize the nominal datagram size (nominal = size within which a datagram won't
+have to be split into smaller individual messages and then re-assembled at the other end).
+This will fail for a stream connection
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	// Can only retrieve this info from the capcodec when its a connection, not datagram!
+	aMaxSize = KWapStackMaxDatagramSize;
+	aNominalSize = KWapStackNorminalDatagramSize;
+	return KErrNone;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapBoundWDP.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,59 @@
+// Copyright (c) 2003-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 __CSWSWAPBOUNDWDPSERVICE_H__
+#define __CSWSWAPBOUNDWDPSERVICE_H__
+
+// Include definitions of ECOM interfaces for the WAP Messaging API
+#include <wapmessage.h>
+#include "WapMessageApiAgent.h"
+
+class CSWSWapBoundWDPService : public CWapBoundDatagramService
+/** 
+The WAP Messaging API, SWS WAP Stack binding. Implementation of the bound WDP API.
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	static CSWSWapBoundWDPService* NewL();	
+	virtual ~CSWSWapBoundWDPService();
+
+public:
+	virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TInetAddr aInetAddr);
+	virtual TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort);
+	virtual TInt SendTo(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, const TDesC8& aBuffer,Wap::TBearer aBearer);
+	virtual TInt AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus);
+	virtual TInt RecvFrom(TDes8& aRemoteHost, Wap::TPort& aRemotePort, TDes8& aBuffer, TBool& aTruncated, TRequestStatus& aReqStatus, TUint32 aTimeout);
+	virtual void CancelRecv();
+	virtual TInt GetLocalPort(Wap::TPort& aPort);
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost);
+	virtual TInt GetBearer(Wap::TBearer& aBearer);
+	virtual TInt GetDatagramSizes(TUint16& aMaxSize, TUint16& aNominalSize);
+
+private:
+	CSWSWapBoundWDPService();
+	void ConstructL();
+
+private:
+	/**
+	the agent instance which actually handles wdp PDU.
+	*/
+	CWdpMessageApiAgent* iAgent;
+};
+
+
+#endif // __CSWSWAPBOUNDWDPSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapFullySpecCLPush.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,169 @@
+// Copyright (c) 2003-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 "WapFullySpecCLPush.h"
+#include "WapMsgUtils.h"
+#include <wapmsgerr.h>
+
+CSWSWapFullySpecCLPushService* CSWSWapFullySpecCLPushService::NewL()
+/**
+Static new function
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CSWSWapFullySpecCLPushService* me = new(ELeave)CSWSWapFullySpecCLPushService();
+	CleanupStack::PushL(me);
+	me->ConstructL();
+	CleanupStack::Pop(me);
+	return me;
+	}
+
+CSWSWapFullySpecCLPushService::~CSWSWapFullySpecCLPushService()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	delete iAgent;
+	}
+
+CSWSWapFullySpecCLPushService::CSWSWapFullySpecCLPushService()
+/**
+Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+void CSWSWapFullySpecCLPushService::ConstructL()
+/**
+Second Phase Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	// Parent class construction
+	CWapFullySpecCLPushService::ConstructL();
+	iAgent=CWspMessageApiAgent::NewL();
+	}
+
+TInt CSWSWapFullySpecCLPushService::Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure, TInetAddr /*aInetAddr*/)
+/**
+Opens a socket which is to be used only with a single, named remote host.
+@internalComponent
+@released
+@since v8.0
+@param aRemoteHost the bearer-dependent address of the remote host with which the data will be exchanged
+@param aRemotePort the port on the remote host to which data will be sent
+@param aBearer the bearer to use (not EAll)
+@param aSecure security flag indicates whether WTLS will be used or not
+@param aInetAddr the address of the adapter to use
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if(aSecure) 
+		{
+		return KErrNotSupported;
+		}
+	return iAgent->Connect(aRemoteHost, aRemotePort, aBearer, aSecure);
+	}
+
+TInt CSWSWapFullySpecCLPushService::Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure)
+/**
+Opens a socket which is to be used only with a single, named remote host.
+@internalComponent
+@released
+@since v8.0
+@param aRemoteHost (in) the bearer-dependent address of the remote host with which the data will be exchanged
+@param aRemotePort (in) the port on the remote host to which data will be sent
+@param aBearer (in) the bearer to use (not EAll)
+@param aSecure (in) security flag indicates whether WTLS will be used or not
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInetAddr inetAddr( KInetAddrAny, 0);
+	return( Connect(aRemoteHost, aRemotePort, aBearer, aSecure, inetAddr) );
+	}
+
+TInt CSWSWapFullySpecCLPushService::AwaitPush(TDes8& aPushHeaders, TDes8& aPushBody, TPckgBuf<TUint8>& aPushIdPckg, TRequestStatus& aReqStatus)
+/**
+Request an asynchronous notification upon arrival of the next push messages on the listening connection.
+The request completes upon receipt of the message, filling the buffers with as much received data as possible.
+A return code will indicate whether further data remains.  The call must be re-issued for subsequent messages
+or to receive remaining data from a previous push message.
+@internalComponent
+@released
+@since v8.0
+@param aPushHeaders (out) (client-allocated) - when a push message arrives the header data is written here
+@param aPushBody (out) (client-allocated) - when a push message arrives the body data is written here
+@param aPushIdPckg (out) when a push message arrives an integer ID that uniquely specifies the message is written here
+@param aReqStatus (inout) used by the service provider to notify the client when a push has arrived
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInt err = iAgent->ReceiveWspMessage(aPushHeaders, aPushBody, aPushIdPckg, iWspStatus, aReqStatus, 0);
+	if(err == Wap::EMoreData)
+	{
+		return KErrNone;
+	}
+	return err;
+	}
+
+void CSWSWapFullySpecCLPushService::CancelAwaitPush()
+/**
+Cancel a previously-requested push message notification.  If a push message arrives the client will not be notified.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	iAgent->CancelRequest();
+	}
+
+TInt CSWSWapFullySpecCLPushService::GetLocalPort(Wap::TPort& aPort)
+/**
+Get the local port of this endpoint.Useful if one was chosen automatically.
+@internalComponent
+@released
+@since v8.0
+@param aPort (out) the port number
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalPort(aPort);
+	}
+
+TInt CSWSWapFullySpecCLPushService::GetLocalAddress(HBufC8*& aLocalHost)
+/**
+Get the local address of this endpoint.
+@internalComponent
+@released
+@since v8.0
+@param aLocalHost (inout) the address of the local host. A reference to a HBufC8 pointer should 
+be passed in. This pointer MUST be null! A HBufC8 will be allocated to hold the address, ownership 
+of this buffer will be passed over to the client.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalAddress(aLocalHost);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapFullySpecCLPush.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,69 @@
+// Copyright (c) 2003-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 __CSWSWAPFULLYSPECCLPUSHSERVICE_H__
+#define __CSWSWAPFULLYSPECCLPUSHSERVICE_H__
+
+// Include definitions of ECOM interfaces for the WAP Messaging API
+#include <wapmessage.h>
+#include "WapMessageApiAgent.h"
+
+class CSWSWapFullySpecCLPushService : public CWapFullySpecCLPushService
+/** 
+The WAP Messaging API, SWS WAP Stack binding. Implementation of the fully-specified connectionless push API.
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	static CSWSWapFullySpecCLPushService* NewL();
+	virtual ~CSWSWapFullySpecCLPushService();
+
+public:
+	virtual TInt Connect(const TDesC8& aRemoteHost,
+					  Wap::TPort aRemotePort,
+					  Wap::TBearer aBearer,
+					  TBool aSecure,
+					  TInetAddr aInetAddr);
+	virtual TInt Connect(const TDesC8& aRemoteHost,
+					  Wap::TPort aRemotePort,
+					  Wap::TBearer aBearer,
+					  TBool aSecure);
+	virtual TInt AwaitPush(TDes8& aPushHeaders,
+						  TDes8& aPushBody,
+						  TPckgBuf<TUint8>& aPushIdPckg,
+						  TRequestStatus& aReqStatus);
+	virtual void CancelAwaitPush();
+	virtual TInt GetLocalPort(Wap::TPort& aPort);
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost);
+
+private:
+	CSWSWapFullySpecCLPushService();
+	void ConstructL();
+
+private:
+	/**
+	the agent instance which actually handles wsp PDU.
+	*/
+	CWspMessageApiAgent* iAgent;
+	/**
+	the wsp status in received wsp PDU.
+	*/
+	TWSPStatus iWspStatus;
+};
+
+
+#endif // __CSWSWAPFULLYSPECCLPUSHSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapFullySpecCLWSP.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,166 @@
+// Copyright (c) 2003-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 "WapFullySpecCLWSP.h"
+#include "WapMsgUtils.h"
+#include "CLWSPPduHandler.h"
+
+CSWSWapFullySpecCLWSPService* CSWSWapFullySpecCLWSPService::NewL()
+/**
+Static new function
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CSWSWapFullySpecCLWSPService* me = new(ELeave)CSWSWapFullySpecCLWSPService();
+	CleanupStack::PushL(me);
+	me->ConstructL();
+	CleanupStack::Pop(me);
+	return me;
+	}
+
+CSWSWapFullySpecCLWSPService::CSWSWapFullySpecCLWSPService()
+	: CWapFullySpecCLWSPService()
+/**
+Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+CSWSWapFullySpecCLWSPService::~CSWSWapFullySpecCLWSPService()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	delete iAgent;
+	}
+
+void CSWSWapFullySpecCLWSPService::ConstructL()
+/**
+Second phase constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	// Parent class construction
+	CWapFullySpecCLWSPService::ConstructL();
+	iAgent=CWspMessageApiAgent::NewL();
+	}
+
+TInt CSWSWapFullySpecCLWSPService::Connect(const TDesC8& aRemoteHost, Wap::TPort aPort, Wap::TBearer aBearer, TBool aSecure)
+/**
+Opens a end-point which is to be used only with a single, named remote host.
+@internalComponent
+@released
+@since v8.0
+@param aRemoteHost the bearer-dependent address of the remote host with which the data will be exchanged
+@param aPort the port on the remote host to which data will be sent
+@param aBearer the bearer to use (not EAll)
+@param aSecure security flag indicates whether WTLS will be used or not
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if(aSecure) 
+		{
+		return KErrNotSupported;
+		}
+	return iAgent->Connect(aRemoteHost, aPort, aBearer, aSecure);
+	}
+
+TInt CSWSWapFullySpecCLWSPService::MethodInvoke(TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, const TUint8 aTransactionId)
+/**
+A synchronous call to send a method invoke method to the remote host.
+@internalComponent
+@released
+@since v8.0
+@param aMethod (in) the method that will be invoked on server
+@param aURI (in) the uri to build wsp message
+@param aReqHeaders (in) the wsp header to be used to build method invoke message
+@param aReqBody (in) the wsp body to be used to build method invoke message
+@param aTransactionId (in) the transaction Id of the method invoke message
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->SendWspMessage(TWSPPduType(aMethod), aURI, aReqHeaders, aReqBody, aTransactionId);
+	}
+
+TInt CSWSWapFullySpecCLWSPService::MethodResult(TDes8& aReqHeaders, TDes8& aReqBody, TPckgBuf<TUint8>& aTransactionIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout)
+/**
+Request an asynchronous notification upon arrival of the method result messages on the listening connection.
+The request completes upon receipt of the message, filling the buffers with as much received data as possible.
+A return code will indicate whether further data remains.  The call must be re-issued for subsequent messages
+or to receive remaining data from a previous method result message.
+@internalComponent
+@released
+@since v8.0
+@param aReqHeaders (out) (client-allocated) - when a method result message arrives the header data is written here
+@param aReqBody (out) (client-allocated) - when a method result message arrives the body data is written here
+@param aTransactionIdPckg (out) when a method result message arrives an integer ID that uniquely specifies the message is written here
+@param aWspStatus (out) when a method result message arrives, the wsp status is written here.
+@param aReqStatus (inout) used by the service provider to notify the client when a method result has arrived
+@param aTimeout (in) an optional millisecond time-out which allows a timed read to be made.  If no data is received 
+within the timeout period the request completes with KErrTimedOut. If a value of 0 is supplied the timeout is infinite.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->ReceiveWspMessage(aReqHeaders, aReqBody, aTransactionIdPckg, aWspStatus, aReqStatus, aTimeout);
+	}
+
+void CSWSWapFullySpecCLWSPService::CancelReq()
+/**
+Cancel a previously-requested method result notification.  If a method result message arrives the client will not be notified.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	iAgent->CancelRequest();
+	}
+
+TInt CSWSWapFullySpecCLWSPService::GetLocalPort(Wap::TPort& aPort)
+/**
+Get the local port of this endpoint.Useful if one was chosen automatically.
+@internalComponent
+@released
+@since v8.0
+@param aPort (out) the port number
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalPort(aPort);
+	}
+
+TInt CSWSWapFullySpecCLWSPService::GetLocalAddress(HBufC8*& aLocalHost)
+/**
+Get the local address of this endpoint.
+@internalComponent
+@released
+@since v8.0
+@param aLocalHost (inout) the address of the local host. A reference to a HBufC8 pointer should 
+be passed in. This pointer MUST be null! A HBufC8 will be allocated to hold the address, ownership 
+of this buffer will be passed over to the client.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalAddress(aLocalHost);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapFullySpecCLWSP.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,51 @@
+// Copyright (c) 2003-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 __CSWSWAPFULLYSPECCLWSPSERVICE_H__
+#define __CSWSWAPFULLYSPECCLWSPSERVICE_H__
+
+// Include definitions of ECOM interfaces for the WAP Messaging API
+#include <wapmessage.h>
+#include "WapMessageApiAgent.h"
+
+class CSWSWapFullySpecCLWSPService : public CWapFullySpecCLWSPService
+/** 
+The WAP Messaging API, SWS WAP Stack binding. Implementation of Fully-Specified Connectionless WSP API
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	static CSWSWapFullySpecCLWSPService* NewL();
+	virtual ~CSWSWapFullySpecCLWSPService();
+public:
+	virtual TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure);
+	virtual TInt MethodInvoke(TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, TUint8 aTransactionId);
+	virtual TInt MethodResult(TDes8& aReqHeaders, TDes8& aReqBody, TPckgBuf<TUint8>& aTransactionIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout);
+	virtual void CancelReq();
+	virtual TInt GetLocalPort(Wap::TPort& aPort);
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost);
+protected:
+	CSWSWapFullySpecCLWSPService();
+	void ConstructL();
+private:
+	/**
+	the agent instance which actually handles wsp PDU.
+	*/
+	CWspMessageApiAgent* iAgent;
+};
+
+#endif //__CSWSWAPFULLYSPECCLWSPSERVICE_H__ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapFullySpecWDP.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,206 @@
+// Copyright (c) 2003-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 "WapFullySpecWDP.h"
+#include "WapMsgUtils.h"
+
+CSWSWapFullySpecWDPService* CSWSWapFullySpecWDPService::NewL()
+/**
+Static new function
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	CSWSWapFullySpecWDPService* me = new(ELeave)CSWSWapFullySpecWDPService();
+	CleanupStack::PushL(me);
+	me->ConstructL();
+	CleanupStack::Pop(me);
+	return me;
+	}
+
+CSWSWapFullySpecWDPService::CSWSWapFullySpecWDPService()
+	: CWapFullySpecDatagramService()
+/**
+Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	}
+
+CSWSWapFullySpecWDPService::~CSWSWapFullySpecWDPService()
+/**
+Destructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	delete iAgent;
+	}
+
+void CSWSWapFullySpecWDPService::ConstructL()
+/**
+Second Phase Constructor
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	// Parent class construction
+	CWapFullySpecDatagramService::ConstructL();
+	iAgent=CWdpMessageApiAgent::NewL();
+	}
+
+TInt CSWSWapFullySpecWDPService::Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TInetAddr /*aInetAddr*/)
+/**
+Connect to the SWS, opening an endpoint which is to be used only with a single, named remote host.All CWapFullySpecDatagramService implementaions must automatically close this endpoint upon destruction.
+@internalComponent
+@released
+@since v8.0
+@param aRemoteHost (in) the bearer-dependent address of the remote host with which the data will be exchanged
+@param aRemotePort (in) the port on the remote host to which data will be sent
+@param aBearer (in) the bearer to use (not EAll)
+@param aInetAddr (in) the ip address of the network interface that should be used in a multihomed system.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->Connect(aRemoteHost, aRemotePort, aBearer, EFalse);
+	}
+
+TInt CSWSWapFullySpecWDPService::Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer)
+/**
+Connect to the wapstack, opening an endpoint which is to be used only with a single, named remote host.
+@internalComponent
+@released
+@since v8.0
+@param aRemoteHost (in) the bearer-dependent address of the remote host with which the data will be exchange
+@param aRemotePort (in) the port on the remote host to which data will be sent
+@param aBearer (in) the bearer to use (not EAll)
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInetAddr inetAddr( KInetAddrAny, 0);
+	return(Connect(aRemoteHost, aRemotePort, aBearer, inetAddr));
+	}
+
+TInt CSWSWapFullySpecWDPService::Send(const TDesC8& aBuffer)
+/**
+Send data on a fully-specified connection.
+@internalComponent
+@released
+@since v8.0
+@param aBuffer (in) the data buffer to be written over the connection
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->SendWdpMessage(aBuffer);
+	}
+
+TInt CSWSWapFullySpecWDPService::AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus)
+/**
+receive data on a bound port.
+@internalComponent
+@released
+@since v8.0
+An asynchronous notification is sent to the client when data arrives.
+@param aDataSizePckg size of data received
+@param aReqStatus (inout) used to notify the client that a datagram was received
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->AwaitRecvDataSize(aDataSizePckg, aReqStatus);
+	}
+
+TInt CSWSWapFullySpecWDPService::Recv(TDes8& aBuffer, TBool& aTruncated, TRequestStatus& aReqStatus, TUint32 aTimeout)
+/**
+receive data on a bound port.
+An asynchronous notification is sent to the client when data arrives.
+@internalComponent
+@released
+@since v8.0
+@param aBuffer (out) a client-allocated data buffer to be filled with data received. Data that overflows the buffer is discarded.
+@param aTruncated (out) indicates whether the received datagram was truncated to fit in the client's supplied buffer
+@param aReqStatus (inout) used to notify the client that a datagram was received
+@param aTimeout (in) an optional millisecond time-out which allows a timed read to be made.  If no data is received
+within the timeout period the request completes with KErrTimedOut. If a value of 0 is supplied the timeout is infinite.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->ReceiveWdpMessage(iHostName, iPort, aBuffer, aTruncated, aReqStatus, aTimeout);
+	}
+
+void CSWSWapFullySpecWDPService::CancelRecv()
+/**
+Cancel a previously requested asynchronous Recv or AwaitRecvDataSize notification.
+If a datagram arrives at the local host, it will be discarded.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	iAgent->CancelRequest();
+	}
+
+TInt CSWSWapFullySpecWDPService::GetLocalPort(Wap::TPort& aPort)
+/**
+Get the local port of this endpoint.Useful if one was chosen automatically.
+@internalComponent
+@released
+@since v8.0
+@param aPort (out) the port number
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+
+	{
+	return iAgent->GetLocalPort(aPort);
+	}
+
+TInt CSWSWapFullySpecWDPService::GetLocalAddress(HBufC8*& aLocalHost)
+/**
+Get the local address of this endpoint.
+@internalComponent
+@released
+@since v8.0
+@param aLocalHost (inout) the address of the local host. A reference to a HBufC8 pointer should
+be passed in. This pointer MUST be null! A HBufC8 will be allocated to hold the address, ownership
+of this buffer will be passed over to the client.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	return iAgent->GetLocalAddress(aLocalHost);
+	}
+
+TInt CSWSWapFullySpecWDPService::GetDatagramSizes(TUint16& aMaxSize, TUint16& aNominalSize)
+/**
+Query the WDP bearer for its maximum datagram size and its nominal datagram size.
+@internalComponent
+@released
+@since v8.0
+@param aMaxSize (out) the maximum datagram size
+@param aNominalSize (out) the nominal datagram size (nominal = size within which a datagram won't
+have to be split into smaller individual messages and then re-assembled at the other end).
+This will fail for a stream connection
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	// Can only retrieve this info from the capcodec when its a connection, not datagram!
+	aMaxSize = KWapStackMaxDatagramSize;
+	aNominalSize = KWapStackNorminalDatagramSize;
+	return KErrNone;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapFullySpecWDP.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,73 @@
+// Copyright (c) 2003-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 __CSWSWAPFULLYSPECWDPSERVICE_H__
+#define __CSWSWAPFULLYSPECWDPSERVICE_H__
+
+// Include definitions of ECOM interfaces for the WAP Messaging API
+#include <wapmessage.h>
+#include "WapMessageApiAgent.h"
+
+class CSWSWapFullySpecWDPService : public CWapFullySpecDatagramService
+/** 
+The WAP Messaging API, SWS WAP Stack binding.  Implementation of the Fully-Specified WDP API.
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	static CSWSWapFullySpecWDPService* NewL();
+	virtual ~CSWSWapFullySpecWDPService();
+
+public:
+	virtual TInt Connect(const TDesC8& aRemoteHost,
+						 Wap::TPort aRemotePort,
+						 Wap::TBearer aBearer,
+						 TInetAddr aInetAddr);
+	virtual TInt Connect(const TDesC8& aRemoteHost,
+						 Wap::TPort aRemotePort,
+						 Wap::TBearer aBearer);
+	virtual TInt Send(const TDesC8& aBuffer);
+	virtual TInt AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus);
+	virtual TInt Recv(TDes8& aBuffer,
+					  TBool& aTruncated,
+					  TRequestStatus& aReqStatus,
+					  TUint32 aTimeout);
+	virtual void CancelRecv();
+	virtual TInt GetLocalPort(Wap::TPort& aPort);
+	virtual TInt GetLocalAddress(HBufC8*& aLocalHost);
+	virtual TInt GetDatagramSizes(TUint16& aMaxSize, TUint16& aNominalSize);
+
+private:
+	CSWSWapFullySpecWDPService();
+	void ConstructL();
+
+private:
+	/**
+	the agent instance which actually handles wdp PDU.
+	*/
+	CWdpMessageApiAgent* iAgent;
+	/**
+	the remote host name.
+	*/
+	TBuf8<KMaxSockAddrSize> iHostName;
+	/**
+	the remote port
+	*/
+	Wap::TPort iPort;
+};
+
+#endif // __CSWSWAPFULLYSPECWDPSERVICE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapMessageApiAgent.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,1184 @@
+// Copyright (c) 2008-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 "WapMessageApiAgent.h"
+#include "WapMsgUtils.h"
+#include "CLWSPPduHandler.h"
+#include <es_wsms.h>
+#include <wapmsgerr.h>
+#include "WapSwsLog.h"
+
+CWapAsyncCallBack::CWapAsyncCallBack( const TCallBack& aCallBack, TInt aPriority )
+:   CActive( aPriority ), iCallBack( aCallBack )
+	{
+	CActiveScheduler::Add( this );
+	}
+
+CWapAsyncCallBack::~CWapAsyncCallBack()
+	{
+	Cancel();
+	}
+
+void CWapAsyncCallBack::CallBack()
+	{
+	if  ( !IsActive() )
+		{
+		TRequestStatus* status = &iStatus;
+		User::RequestComplete( status, KErrNone );
+		SetActive();
+		}
+	}
+
+void CWapAsyncCallBack::RunL()
+	{
+	iCallBack.CallBack();
+	}
+
+void CWapAsyncCallBack::DoCancel()
+	{
+	// Empty - request already completed in CallBack()
+	}
+
+//
+//CWapMessageApiAgent class Method
+//
+CWapMessageApiAgent::CWapMessageApiAgent(TWapMessageType aMessageType):iMessageType(aMessageType)
+/**
+Constuctor.
+@internalComponent
+@released since v8.0
+@param aMessageType the message type that handled by this agent
+*/
+	{
+	}
+
+CWapMessageApiAgent::~CWapMessageApiAgent()
+/**
+Destrutor
+@internalComponent.
+@released since v8.0
+*/
+	{
+	TInt count=iBearers.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		iBearers[i]->Cancel();
+		iBearers[i]->CleanUpData();
+		}
+	iBearers.ResetAndDestroy();
+	iSocketServ.Close();
+	if (iTimeoutTimer)
+		{
+		iTimeoutTimer->Cancel();		
+		delete iTimeoutTimer;
+		}
+	if (iAsyncReadCompletion)
+		{
+		delete iAsyncReadCompletion;
+		}
+	}
+
+TInt CWapMessageApiAgent::CompleteReading(TAny* aAgent)
+	{
+	CWapMessageApiAgent* agent = reinterpret_cast<CWapMessageApiAgent*>(aAgent);
+	return agent->DoCompleteReading();
+	}
+
+TInt CWapMessageApiAgent::DoCompleteReading()
+	{
+	iRequestActive=EFalse;
+	User::RequestComplete(iRequestStatus, iLastReadingError);
+	return KErrNone;
+	}
+void CWapMessageApiAgent::ConstructL()
+/**
+Second Phase Constructor
+@internalComponent.
+@released since v8.0
+*/
+	{
+	iTimeoutTimer = CTimeOutTimer::NewL(*this);
+	TCallBack callback = TCallBack(CompleteReading, this);
+	iAsyncReadCompletion = new (ELeave) CWapAsyncCallBack(callback, CActive::EPriorityHigh);
+	User::LeaveIfError(iSocketServ.Connect());
+ 	}
+
+CActiveSocket* CWapMessageApiAgent::GetActiveSocketByBearer(Wap::TBearer aBearer)
+/**
+To Get the CActiveSocket from the Array by Bearer type. 
+@internalComponent.
+@released since v8.0
+@param aBearer (in)the bearer type of the CActiveSocket
+@returns the pointer of CAtiveSocket
+*/
+	{
+	TInt count=iBearers.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		Wap::TBearer bearer=iBearers[i]->GetBearerType();
+		if (bearer==aBearer)
+			{
+			return iBearers[i];
+			}
+		else
+			{
+			if ((aBearer>=Wap::ESMS7 && aBearer<=Wap::EWAPSMS) && (bearer>=Wap::ESMS7 && bearer<=Wap::EWAPSMS))
+				{
+				return iBearers[i];
+				}
+			}
+		}
+	return NULL;
+	}
+
+CActiveSocket* CWapMessageApiAgent::GetActiveSocketByStatus(TWapMessageState aState)
+/**
+To Get the CActiveSocket from the Array by Data State. 
+@internalComponent.
+@released since v8.0
+@param aState (in)the Data state of the CActiveSocket
+@returns the pointer of CAtiveSocket
+*/
+	{
+	TInt count=iBearers.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		if (iBearers[i]->GetDataState()==aState)
+			{
+			return iBearers[i];
+			}
+		}
+	return NULL;
+	}
+
+void CWapMessageApiAgent::TimerExpired()
+/**
+To handle the receive time out.
+@internalComponent.
+@released since v8.0
+*/
+	{
+	TInt count=iBearers.Count();
+	for (TInt i=0; i<count; i++)
+		{
+		iBearers[i]->Cancel();
+		iBearers[i]->CleanUpData();
+		}
+	iRequestActive=EFalse;
+	User::RequestComplete(iRequestStatus, KErrTimedOut);
+	}
+
+TInt CWapMessageApiAgent::GetLocalPort(Wap::TPort& aLocalPort)
+/**
+To Get local port of the last received packet
+@internalComponent.
+@released since v8.0
+@param aLocalPort (out)the reference of the localPort.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iIsOpen)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::GetLocalPort: Trying to GetLocalPort on unconnected API."));)
+		return KErrNotReady;
+		}
+	CActiveSocket* sock=GetActiveSocketByBearer(iLastPduBearer);
+	if (!sock)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::GetLocalPort: Can not find Last Bearer."));)
+		return Wap::EBearerError;
+		}
+	sock->GetLocalPort(aLocalPort);
+	return KErrNone;
+	}
+
+TInt CWapMessageApiAgent::GetLocalAddress(HBufC8*& aLocalHost)
+/**
+To Get local Address of the last received Packet
+@internalComponent.
+@released since v8.0
+@param aLocalHost (out)the reference of the localHost.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iIsOpen)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::GetLocalAddress: Trying to GetLocalAddress on unconnected API."));)
+		return KErrNotReady;
+		}
+	CActiveSocket* sock=GetActiveSocketByBearer(iLastPduBearer);
+	if (!sock)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::GetLocalAddress: Can not find Last Bearer"));)
+		return Wap::EBearerError;
+		}
+	TSockAddr& localHost=sock->GetLocalAddress();
+	TInt err=KErrNone;
+	TRAP(err, aLocalHost=localHost.AllocL())
+	if (err)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::GetLocalAddress: Alloc Memory Err=%d"), err);)
+		}
+	return err;
+	}
+
+TInt CWapMessageApiAgent::GetBearer(Wap::TBearer& aBearer)
+/**
+To Get Bearer of the last received packet
+@internalComponent.
+@released since v8.0
+@param aBearer (out)the reference of the Bearer.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iIsOpen)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::GetBearer: Trying to GetBearer on unconnected API."));)
+		return KErrNotReady;
+		}
+	aBearer=iLastPduBearer;
+	return KErrNone;
+	}
+
+TInt CWapMessageApiAgent::GetServerAddress(HBufC8*& aServerHost)
+/**
+To Get Server Host of the last received packet
+@internalComponent.
+@released since v8.0
+@param aServerHost (out)the reference of the Server Host.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iIsOpen)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::GetServerAddress: Trying to GetServerAddress on unconnected API."));)
+		return KErrNotReady;
+		}
+	CActiveSocket* sock=GetActiveSocketByBearer(iLastPduBearer);
+	if (!sock)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::GetServerAddress: Can not find last error."));)
+		return Wap::EBearerError;
+		}
+	return sock->GetRemoteAddress(aServerHost);
+	}
+
+void CWapMessageApiAgent::CancelRequest()
+/**
+To Cancel the client's request
+@internalComponent.
+@released since v8.0
+*/
+	{
+	if (iIsOpen)
+		{
+		TInt count=iBearers.Count();
+		for (TInt i=0; i<count; i++)
+			{
+			iBearers[i]->Cancel();
+			iBearers[i]->CleanUpData();
+			}
+		iTimeoutTimer->Cancel();
+		if (iRequestActive)
+			{
+			iRequestActive=EFalse;
+			iAsyncReadCompletion->Cancel();
+			User::RequestComplete(iRequestStatus, KErrCancel);
+			}
+		}
+	}
+
+TInt CWapMessageApiAgent::Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure)
+/**
+Opening an endpoint that can be used to listen for subsequent incoming datagrams.
+@internalComponent.
+@released since v8.0
+@param aBearer (In) the bearer to listen on
+@param aPort (In) the port to listen on.
+@param aSecure (In) security flag indicates whether WTLS will be used or not (Not Supported)
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInetAddr inetAddr( KInetAddrAny, 0);
+	return (Connect(aBearer, aPort, aSecure, inetAddr));
+	}
+
+TInt CWapMessageApiAgent::Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool /*aSecure*/, TInetAddr /*aInetAddr*/)
+/**
+Opening an endpoint that can be used to listen for subsequent incoming datagrams.
+@internalComponent.
+@released since v8.0
+@param aBearer (In) the bearer to listen on
+@param aPort (In) the port to listen on.
+@param aSecure (In) security flag indicates whether WTLS will be used or not (Not Supported)
+@param aInetAddr (In) Not In Use.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInt ret=KErrNone;
+	if (!iIsOpen)
+		{
+		TRAP(ret, CActiveSocket::NewL(iSocketServ, iBearers, aBearer, iMessageType, this, aPort))
+		if (ret!=KErrNone)
+			{
+			LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect: CActiveSocket Instantiate err=%d."),ret);)
+			return ret;
+			}
+		iIsOpen=ETrue;
+		}
+	else
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect:Trying Connect twice to the API."));)
+		ret=KErrInUse;
+		}
+	return ret;
+	}
+
+TInt CWapMessageApiAgent::Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool /*aSecure*/, TInt aSocketServHandle, RConnection* aConnection)
+/**
+Opening an endpoint that can be used to listen for subsequent incoming datagrams.
+@internalComponent.
+@released since v8.0
+@param aBearer (In) the bearer to listen on
+@param aPort (In) the port to listen on.
+@param aSecure (In) security flag indicates whether WTLS will be used or not (Not Supported)
+@param aSocketServHandle (In) The Socket Server ID.
+@param aConnection (In) The RConnection that shared with the client.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (aSocketServHandle==0 || !aConnection)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect:Parameter Error"));)
+		return KErrArgument;
+		}
+	TInt ret=KErrNone;
+	if (!iIsOpen)
+		{
+		iSocketServ.SetHandle(aSocketServHandle);
+		TRAP(ret, CActiveSocket::NewL(iSocketServ, iBearers, aBearer, iMessageType, this, aPort, aConnection))
+		if (ret!=KErrNone)
+			{
+			LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect: CActiveSocket Instantiate err=%d."), ret);)
+			return ret;
+			}
+		iIsOpen=ETrue;
+		}
+	else
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect:Trying to Connect twice to the API."));)
+		ret=KErrInUse;
+		}
+	return ret;
+	}
+
+TInt CWapMessageApiAgent::Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool /*aSecure*/, TInetAddr /*aInetAddr*/)
+/**
+Opens a socket which is to be used only with a single, named remote host.
+@internalComponent.
+@released since v8.0
+@param aRemoteHost (In) the name of the remote host to connect.
+@param aRemotePort (In) the port of the remote host to connect.
+@param aBearer (In) the bearer to be used
+@param aSecure (In) security flag indicates whether WTLS will be used or not (Not Supported)
+@param aInetAddr (In) Not In Use
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (aBearer==Wap::EAll)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage:Connect to EAll Error"));)
+		return Wap::EBearerError;
+		}
+	TInt ret=KErrNone;
+	if (!iIsOpen)
+		{
+		TSockAddr remoteAddr;
+		TRAP(ret, CSWSWapMsgUtils::BuildAddrL(remoteAddr, aBearer, aRemoteHost, aRemotePort))
+		if (ret!=KErrNone)
+			{
+			LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect: BuildAddress err=%d."), ret);)
+			return ret;
+			}
+		TRAP(ret, CActiveSocket::NewL(iSocketServ, iBearers, aBearer, iMessageType, this, remoteAddr))
+		if (ret!=KErrNone)
+			{
+			LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect: CActiveSocket Instantiate err=%d."), ret);)
+			return ret;
+			}
+		iIsOpen=ETrue;
+		}
+	else
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect:Trying to Connect twice to the API."));)
+		ret=KErrInUse;
+		}
+	return ret;
+	}
+
+TInt CWapMessageApiAgent::Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure)
+/**
+Opens a socket which is to be used only with a single, named remote host.
+@internalComponent.
+@released since v8.0
+@param aRemoteHost (In) the name of the remote host to connect.
+@param aRemotePort (In) the port of the remote host to connect.
+@param aBearer (In) the bearer to be used
+@param aSecure (In) security flag indicates whether WTLS will be used or not (Not Supported)
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TInetAddr inetAddr( KInetAddrAny, 0);
+	return (Connect(aRemoteHost, aRemotePort, aBearer, aSecure, inetAddr));
+	}
+
+TInt CWapMessageApiAgent::Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool /*aSecure*/, TInt aSocketServHandle, RConnection* aConnection)
+/**
+Opens a socket which is to be used only with a single, named remote host.
+@internalComponent.
+@released since v8.0
+@param aRemoteHost (In) the name of the remote host to connect.
+@param aRemotePort (In) the port of the remote host to connect.
+@param aBearer (In) the bearer to be used
+@param aSecure (In) security flag indicates whether WTLS will be used or not (Not Supported)
+@param aSocketServHandle (In) The Socket Server ID.
+@param aConnection (In) The RConnection that shared with the client.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (aBearer==Wap::EAll)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage:Connect to EAll Error"));)
+		return Wap::EBearerError;
+		}
+	if (aSocketServHandle==0 || !aConnection)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect:Parameter Error"));)
+		return KErrArgument;
+		}
+	TInt ret=KErrNone;
+	if (!iIsOpen)
+		{
+		iSocketServ.SetHandle(aSocketServHandle);
+		TSockAddr remoteAddr;
+		TRAP(ret, CSWSWapMsgUtils::BuildAddrL(remoteAddr, aBearer, aRemoteHost, aRemotePort))
+		if (ret!=KErrNone)
+			{
+			LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect: BuildAddress err=%d."),ret);)
+			return ret;
+			}
+		TRAP(ret, CActiveSocket::NewL(iSocketServ, iBearers, aBearer, iMessageType, this, remoteAddr, aConnection))
+		if (ret!=KErrNone)
+			{
+			LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect: CActiveSocket Instantiate err=%d."),ret);)
+			return ret;
+			}
+		iIsOpen=ETrue;
+		}
+	else
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::Connect:Connect to a connected API."));)
+		ret=KErrInUse;
+		}
+	return ret;
+	}
+//
+//CWspMessageApiAgent class Methods
+//
+CWspMessageApiAgent* CWspMessageApiAgent::NewL()
+/**
+Static NEWL()
+@internalComponent
+@released since v8.0
+@returns CWspMessageApiAgent instance.
+*/
+	{
+	CWspMessageApiAgent* me = new(ELeave) CWspMessageApiAgent();
+	CleanupStack::PushL(me);
+	me->ConstructL();
+	CleanupStack::Pop(me);
+	return me;
+	}
+
+CWspMessageApiAgent::CWspMessageApiAgent():CWapMessageApiAgent(EWapWsp)
+/**
+Constructor
+@internalComponent
+@released since v8.0
+*/
+	{
+	}
+
+CWspMessageApiAgent::~CWspMessageApiAgent()
+/**
+Destructor
+@internalComponent
+@released since v8.0
+*/
+	{
+	}
+
+void CWspMessageApiAgent::ConstructL()
+/**
+Second Phase Constructor
+@internalComponent
+@released since v8.0
+*/
+	{
+	CWapMessageApiAgent::ConstructL();
+	}
+
+TInt CWspMessageApiAgent::SendWspMessage(Wap::TBearer aBearer, const TDesC8& aRemoteHost, Wap::TPort aRemotePort, TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, TUint8 aTransactionId)
+/**
+Send Wsp Message to a remote host
+@internalComponent
+@released since v8.0
+@param aBearer (in) the bearer to be used
+@param aRemoteHost (in) The remote host to be sent.
+@param aRemotePort (in) The remote port to be sent.
+@param aMethod (in) The method to be invoked.
+@param aURI (in) The destination URI.
+@param aReqHeaders (in) The Wsp header of WSP message.
+@param aReqBody (in) The Wsp body of WSP message.
+@param aTransactionId (in) The transaction ID of WSP message.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iIsOpen)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage:Tryig to send to unconnected API"));)
+		return KErrNotReady;
+		}
+	if (aBearer==Wap::EAll)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage:Send to EAll Error"));)
+		return Wap::EBearerError;
+		}
+	HBufC8* sendBuf=NULL;
+	TInt err=KErrNone;
+	TSockAddr remoteAddr;
+	TRAP(err, CSWSWapMsgUtils::BuildAddrL(remoteAddr, aBearer, aRemoteHost, aRemotePort))
+	if (err!=KErrNone)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage: BuildAddress err=%d."),err);)
+		return err;
+		}
+	TRAP(err, CCLWSPPduHandler::PackWSPPduL(sendBuf, TWSPPduType(aMethod), aURI, aReqHeaders, aReqBody, aTransactionId))
+	if (err!=KErrNone)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage:Pack Wsp Packet Error=%d"),err);)
+		return err;
+		}
+	CActiveSocket* sendSock=GetActiveSocketByBearer(aBearer);
+	if (sendSock)
+		{
+		if (aBearer==Wap::ESMS||aBearer==Wap::EWAPSMS)
+			{
+			TWapSmsDataCodingScheme codingScheme = EWapSms8BitDCS;
+			sendSock->Socket().SetOpt(KWapSmsOptionNameDCS,KWapSmsOptionLevel,codingScheme);
+			}
+		TRequestStatus status;
+		sendSock->Socket().SendTo(*sendBuf, remoteAddr, 0, status);
+		User::WaitForRequest(status);
+		err=status.Int();
+		}
+	else
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage: Can not find Bearer"));)
+		err=Wap::EBearerError;
+		}
+	delete sendBuf;
+	return err;
+	}
+
+TInt CWspMessageApiAgent::SendWspMessage(TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, TUint8 aTransactionId)
+/**
+Send Wsp Message to a remote host for fulluSpecified Interface
+@internalComponent
+@released since v8.0
+@param aMethod (in) The method to be invoked.
+@param aURI (in) The destination URI.
+@param aReqHeaders (in) The Wsp header of WSP message.
+@param aReqBody (in) The Wsp body of WSP message.
+@param aTransactionId (in) The transaction ID of WSP message.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iIsOpen)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage:Trying to send to unconnected API"));)
+		return KErrNotReady;
+		}
+	if (!iBearers[0])
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage:No Bearer"));)
+		return Wap::EBearerError;
+		}
+	HBufC8* sendBuf=NULL;
+	TInt err=KErrNone;
+	TRAP(err, CCLWSPPduHandler::PackWSPPduL(sendBuf, TWSPPduType(aMethod), aURI, aReqHeaders, aReqBody, aTransactionId))
+	if (err!=KErrNone)
+		{
+		LOG(SwsLog::Printf(_L("CWapMessageApiAgent::SendWspMessage:Pack Wsp Packet Error=%d"),err);)
+		return err;
+		}
+	Wap::TBearer bearer=iBearers[0]->GetBearerType();
+	if (bearer==Wap::ESMS||bearer==Wap::EWAPSMS)
+		{
+		TWapSmsDataCodingScheme codingScheme = EWapSms8BitDCS;
+		iBearers[0]->Socket().SetOpt(KWapSmsOptionNameDCS,KWapSmsOptionLevel,codingScheme);
+		}
+	TSockAddr& remoteAddr=iBearers[0]->GetRemoteAddress();
+	TRequestStatus status;
+	iBearers[0]->Socket().SendTo(*sendBuf, remoteAddr, 0, status);
+	User::WaitForRequest(status);
+	delete sendBuf;
+	return status.Int();
+	}
+
+TInt CWspMessageApiAgent::ReceiveWspMessage(TDes8& aWspHeaders, TDes8& aWspBody, TPckgBuf<TUint8>& aTransactionIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout)
+/**
+Receive the Wsp Message to a remote host for fulluSpecified Interface
+@internalComponent
+@released since v8.0
+@param aWspHeaders (out) The Wsp header to be received
+@param aWspBody (out) The Wsp body to be received.
+@param aTransactionIdPckg (out) The received transaction ID buffer
+@param aWspStatus (out) The Wsp status for Method Result.
+@param aReqStatus (out) The request status of the WAP message API
+@param aTimeout (in) The timer out value.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TRequestStatus* reqStatus=NULL;
+	if (!iIsOpen)
+		{
+		reqStatus=&aReqStatus;
+		User::RequestComplete(reqStatus, KErrNotReady);
+		LOG(SwsLog::Printf(_L("CWspMessageApiAgent::ReceiveWspMessage: Trying to recvive from unconnected API"));)
+		return KErrNotReady;
+		}
+	if (iRequestActive)
+		{
+		reqStatus=&aReqStatus;
+		User::RequestComplete(reqStatus, KErrInUse);
+		LOG(SwsLog::Printf(_L("CWspMessageApiAgent::ReceiveWspMessage:Outstanding Receive exist"));)
+		return KErrInUse;
+		}
+	//Record the client buffer
+	iClientReqHeaders=&aWspHeaders;
+	iClientReqBody=&aWspBody;
+	iClientTransactionId=(TUint8*)aTransactionIdPckg.Ptr();
+	iClientWspStatus=&aWspStatus;
+	//if there are data are being reading
+	CActiveSocket* readingSock=GetActiveSocketByStatus(EReading);
+	if (readingSock)
+		{
+		iRequestStatus=&aReqStatus;
+		*iRequestStatus = KRequestPending;
+		iRequestActive=ETrue;
+		iLastReadingError=readingSock->GetWspData(*iClientReqHeaders, *iClientReqBody, *iClientTransactionId, *iClientWspStatus);
+		if (iLastReadingError==KErrNone)
+			{
+			iLastPduBearer=readingSock->GetBearerType();
+			}
+		iAsyncReadCompletion->CallBack();
+		return iLastReadingError;
+		}
+	//if there are pending data.
+	CActiveSocket* pendingSock=GetActiveSocketByStatus(EPendingData);
+	if (pendingSock)
+		{
+		iRequestStatus=&aReqStatus;
+		*iRequestStatus = KRequestPending;
+		iRequestActive=ETrue;
+		iLastReadingError=pendingSock->GetWspData(*iClientReqHeaders, *iClientReqBody, *iClientTransactionId, *iClientWspStatus);
+		if (iLastReadingError==KErrNone)
+			{
+			iLastPduBearer=pendingSock->GetBearerType();
+			}
+		iAsyncReadCompletion->CallBack();
+		return iLastReadingError;
+		}
+	// Issue request in Idle socket
+	CActiveSocket* sock=GetActiveSocketByStatus(EIdle);
+	if (sock)
+		{
+		iRequestStatus=&aReqStatus;
+		*iRequestStatus = KRequestPending;
+		iRequestActive=ETrue;
+		for (TInt i=0; i<iBearers.Count(); i++)
+			{
+			if (iBearers[i]->GetDataState()==EIdle)
+				{
+				iBearers[i]->AwaitRecvDataSize();
+				}
+			}
+		if (aTimeout>0)
+			{
+			iTimeoutTimer->After(aTimeout);
+			}
+		}
+	return KErrNone;
+	}
+
+void CWspMessageApiAgent::Notification(TInt aMessage, const TDesC8& aData)
+/**
+Notification of PDU size or PDU data
+@internalComponent
+@released since v8.0
+@param aMessage (in) The Event Type received by the ActiveSocket
+@param aData (in)The Event received by the ActiveSocket.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	LOG(SwsLog::Printf(_L("CWspMessageApiAgent::Notification is called"));)
+	TWapNotificationInfo& info=*(reinterpret_cast<TWapNotificationInfo*>(const_cast<TUint8*>(aData.Ptr())));
+	Wap::TBearer bearer=info.iBearer;
+	CActiveSocket* currentSocket=GetActiveSocketByBearer(bearer);
+	ASSERT(currentSocket!=NULL);
+	if (!currentSocket)
+		{
+		return;
+		}
+	TInt err=info.iError;		
+	switch (TWapNotificationEvent(aMessage))
+		{
+	case EPduLengthReceived:
+			{
+			if (err!=KErrNone)
+				{
+				LOG(SwsLog::Printf(_L("CWspMessageApiAgent::Notification PDU length err status:%d"), err);)
+				currentSocket->CleanUpData();
+				if (iRequestActive)
+					{
+					iTimeoutTimer->Cancel();
+					User::RequestComplete(iRequestStatus, err);
+					iRequestActive=EFalse;
+					}
+				}
+			else
+				{
+				LOG(SwsLog::Printf(_L("CWspMessageApiAgent::Notification PDU length is received"));)
+				if ((err=currentSocket->Receive())!=KErrNone)
+					{
+					currentSocket->CleanUpData();
+					if (iRequestActive)
+						{
+						iTimeoutTimer->Cancel();
+						User::RequestComplete(iRequestStatus, err);
+						iRequestActive=EFalse;
+						}
+					}
+				}
+			break;
+			}
+	case EPduReceived:
+			{
+			CActiveSocket* sock=GetActiveSocketByStatus(EReading);
+			if (err!=KErrNone)
+				{
+				LOG(SwsLog::Printf(_L("CWspMessageApiAgent::Notification PDU data is received with Err status:%d"), err);)
+				currentSocket->CleanUpData();
+				if (iRequestActive && !sock)
+					{
+					iTimeoutTimer->Cancel();
+					User::RequestComplete(iRequestStatus, err);
+					iRequestActive=EFalse;
+					}
+				}
+			else
+				{
+				LOG(SwsLog::Printf(_L("CWspMessageApiAgent::Notification PDU data is received"));)
+				if (!sock && iRequestActive)
+					{
+					iTimeoutTimer->Cancel();
+					iRequestActive=EFalse;
+					TRAP(err, currentSocket->UnpackPduToWspDataL())
+					if (err)
+						{
+						currentSocket->CleanUpData();
+						User::RequestComplete(iRequestStatus, err);
+						return;
+						}
+					err=currentSocket->GetWspData(*iClientReqHeaders, *iClientReqBody, *iClientTransactionId, *iClientWspStatus);
+					if (err==KErrNone)
+						iLastPduBearer=bearer;
+					User::RequestComplete(iRequestStatus, err);
+					}
+				}
+			break;
+			}
+	default:
+		LOG(SwsLog::Printf(_L("CWspMessageApiAgent::Notification() Unknown Event From Bearer"));)
+		;	
+		}
+	}
+
+//
+//CWdpMessageApiAgent class Method
+//
+CWdpMessageApiAgent* CWdpMessageApiAgent::NewL()
+/**
+The static funtion to new a wdp message API agent
+@internalComponent
+@released since v8.0
+@returns the CWdpMessageApiAgent instance
+*/
+	{
+	CWdpMessageApiAgent* me = new(ELeave) CWdpMessageApiAgent();
+	CleanupStack::PushL(me);
+	me->ConstructL();
+	CleanupStack::Pop(me);
+	return me;
+	}
+
+CWdpMessageApiAgent::CWdpMessageApiAgent():CWapMessageApiAgent(EWapWdp)
+/**
+Constructor
+@internalComponent
+@released since v8.0
+*/
+	{
+	}
+
+CWdpMessageApiAgent::~CWdpMessageApiAgent()
+/**
+Destructor
+@internalComponent
+@released since v8.0
+*/
+	{
+	}
+
+void CWdpMessageApiAgent::ConstructL()
+/**
+Second Phase Constructor
+@internalComponent
+@released since v8.0
+*/
+	{
+	CWapMessageApiAgent::ConstructL();
+	}
+
+TInt CWdpMessageApiAgent::ReceiveWdpMessage(TDes8& aRemoteHost, Wap::TPort& aRemotePort, TDes8& aBuffer, TBool& aTruncated, TRequestStatus& aReqStatus, TUint32 aTimeout)
+/**
+Receive WDP message from a remote host
+@internalComponent
+@released since v8.0
+@param aRemoteHost (out) the remote host from which the WDP is sent
+@param aRemotePort (out) the remote port from which the WDP is sent
+@param aBuffer (out) the buffer to contain the received the WDP pdu
+@param aTruncated (out) the flag to show if the WDP PDU is trucated ot not
+@param aReqStatus (out) the client request status.
+@param aTimeOut (in) the time out value
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TRequestStatus* reqStatus=NULL;
+	TInt err=KErrNone;
+	if (!iIsOpen)
+		{
+		reqStatus=&aReqStatus;
+		User::RequestComplete(reqStatus, KErrNotReady);
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::ReceiveWdpMessage:Recv From unconnected API"));)
+		return KErrNotReady;
+		}
+	//if the length has been read
+	CActiveSocket* sock=GetActiveSocketByStatus(EGotLength);
+	CActiveSocket* sock1=GetActiveSocketByStatus(EReading);
+	if (iRequestActive || (!sock && !sock1))
+		{
+		reqStatus=&aReqStatus;
+		User::RequestComplete(reqStatus, KErrInUse);
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::ReceiveWdpMessage:in wrong state"));)
+		return KErrInUse;
+		}
+	if (sock1)
+		{
+		Wap::TBearer bearer=sock1->GetBearerType();
+		TSockAddr& remoteAddr=sock1->GetRemoteAddress();
+		TRAP(err, CSWSWapMsgUtils::AnalyseAddrL(remoteAddr, bearer, *iClientRemoteHost, *iClientRemotePort))
+		if (err)
+			{
+			reqStatus=&aReqStatus;
+			User::RequestComplete(reqStatus, err);
+			return err;
+			}
+		iRequestStatus=&aReqStatus;
+		*iRequestStatus = KRequestPending;
+		iRequestActive=ETrue;
+		iLastReadingError=sock1->GetPduData(*iClientPduBuffer, *iClientTruncated);
+		if (!iLastReadingError)
+			{
+			iLastPduBearer=bearer;
+			}
+		iAsyncReadCompletion->CallBack();
+		return iLastReadingError;
+		}
+	if (sock)
+		{
+		if ((err=sock->Receive())==KErrNone)
+			{
+			iClientPduBuffer=&aBuffer;
+			iClientRemoteHost=&aRemoteHost;
+			iClientRemotePort=&aRemotePort;
+			iClientTruncated=&aTruncated;
+			iRequestStatus=&aReqStatus;
+			*iRequestStatus = KRequestPending;
+			iRequestActive=ETrue;		
+			if (aTimeout)
+				{
+				iTimeoutTimer->After(aTimeout);
+				}
+			}
+		else
+			{
+			reqStatus=&aReqStatus;
+			User::RequestComplete(reqStatus, err);
+			LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::ReceiveWdpMessage:err=%d"), err);)
+			return err;
+			}
+		}
+	return KErrNone;
+	}
+
+TInt CWdpMessageApiAgent::AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus)
+/**
+Receive WDP message PDU length from a remote host
+@internalComponent
+@released since v8.0
+@param aDataSizePckg (out) the length of the PDU
+@param aReqStatus (out) the client request status.
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TRequestStatus* reqStatus=NULL;
+	if (!iIsOpen)
+		{
+		reqStatus=&aReqStatus;
+		User::RequestComplete(reqStatus, KErrNotReady);
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::AwaitRecvDataSize:Wait For Data length From unconnected API"));)
+		return KErrNotReady;
+		}
+	//if the length has been read or there is some data pending, then error completion
+	CActiveSocket* sock=GetActiveSocketByStatus(EGotLength);
+	CActiveSocket* sock1=GetActiveSocketByStatus(ERequestingData);
+	CActiveSocket* sock2=GetActiveSocketByStatus(EReading);
+	if (iRequestActive||sock||sock1||sock2)
+		{
+		reqStatus=&aReqStatus;
+		User::RequestComplete(reqStatus, KErrInUse);
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::AwaitRecvDataSize:in wrong state"));)
+		return KErrInUse;
+		}
+	//if there is a pending length, then get it
+	sock=GetActiveSocketByStatus(EPendingLength);
+	if (sock)
+		{
+		iClientDataSize=&aDataSizePckg;
+		iRequestStatus=&aReqStatus;
+		*iRequestStatus = KRequestPending;
+		iRequestActive=ETrue;
+		TUint16 length=(TUint16)sock->GetPduSize();
+		TPckg<TUint16> des(length);
+		iClientDataSize->Copy(des);
+		iLastReadingError=KErrNone;
+		iAsyncReadCompletion->CallBack();
+		return KErrNone;
+		}
+	//if there is some idle socket, then wait for length
+	sock=GetActiveSocketByStatus(EIdle);
+	if (sock)
+		{
+		iRequestActive=ETrue;
+		iClientDataSize=&aDataSizePckg;
+		iRequestStatus=&aReqStatus;
+		*iRequestStatus = KRequestPending;
+		//Wait for length on the idle socket
+		for (TInt i=0; i<iBearers.Count(); i++)
+			{
+			if (iBearers[i]->GetDataState()==EIdle)
+				{
+				iBearers[i]->AwaitRecvDataSize();
+				}
+			}
+		}
+	return KErrNone;
+	}
+
+TInt CWdpMessageApiAgent::SendWdpMessage(const TDesC8& aBuffer, const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer)
+/**
+Send WDP message to a remote host
+@internalComponent
+@released since v8.0
+@param aBuffer (in) the data to be sent
+@param aRemoteHost (in) the remote host to be sent
+@param aRemotePort (in) the remote port to be sent
+@param aBearer (in) the Bearer to be used
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iIsOpen)
+		{
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::SendWdpMessage:Send WDP to unconnected API"));)
+		return KErrNotReady;
+		}
+	if (aBearer==Wap::EAll)
+		{
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::SendWdpMessage:Wrong Bearer"));)
+		return Wap::EBearerError;
+		}
+	TSockAddr remoteAddr;
+	TInt err=KErrNone;
+	TRAP(err, CSWSWapMsgUtils::BuildAddrL(remoteAddr, aBearer, aRemoteHost, aRemotePort))
+	if (err)
+		{
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::SendWdpMessage:BuildAddrL Err=%d"), err);)
+		return err;
+		}
+	CActiveSocket* sendSock=GetActiveSocketByBearer(aBearer);
+	if (sendSock)
+		{
+		if (aBearer==Wap::ESMS||aBearer==Wap::EWAPSMS)
+			{
+			TWapSmsDataCodingScheme codingScheme = EWapSms8BitDCS;
+			sendSock->Socket().SetOpt(KWapSmsOptionNameDCS,KWapSmsOptionLevel,codingScheme);
+			}
+		TRequestStatus status;
+		sendSock->Socket().SendTo(aBuffer, remoteAddr, 0, status);
+		User::WaitForRequest(status);
+		err=status.Int();
+		}
+	else
+		{
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::SendWdpMessage:No Bearer"));)
+		err=Wap::EBearerError;
+		}
+	return err;
+	}
+
+TInt CWdpMessageApiAgent::SendWdpMessage(const TDesC8& aBuffer)
+/**
+Send WDP message to a remote host
+@internalComponent
+@released since v8.0
+@param aBuffer (in) the data to be sent
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	if (!iIsOpen)
+		{
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::SendWdpMessage:Send WDP to unconnected API"));)
+		return KErrNotReady;
+		}
+	if (!iBearers[0])
+		{
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::SendWdpMessage:No Bearer"));)
+		return Wap::EBearerError;
+		}
+	Wap::TBearer bearer=iBearers[0]->GetBearerType();
+	if (bearer==Wap::ESMS||bearer==Wap::EWAPSMS)
+		{
+		TWapSmsDataCodingScheme codingScheme = EWapSms8BitDCS;
+		iBearers[0]->Socket().SetOpt(KWapSmsOptionNameDCS,KWapSmsOptionLevel,codingScheme);
+		}
+	TSockAddr& remoteAddr=iBearers[0]->GetRemoteAddress();
+	TRequestStatus status;
+	iBearers[0]->Socket().SendTo(aBuffer, remoteAddr, 0, status);
+	User::WaitForRequest(status);
+	return status.Int();
+	}
+
+void CWdpMessageApiAgent::Notification(TInt aMessage, const TDesC8& aData)
+/**
+Notification from the ActiveSocket
+@internalComponent
+@released since v8.0
+@param aMessage (in) the Event Type
+@param aData (in) the Event
+@returns KErrNone on successful completion, or one of the system error codes on failure.
+*/
+	{
+	TWapNotificationInfo& info=*(reinterpret_cast<TWapNotificationInfo*>(const_cast<TUint8*>(aData.Ptr())));
+	Wap::TBearer bearer=info.iBearer;
+	CActiveSocket* currentSocket=GetActiveSocketByBearer(bearer);
+	ASSERT(currentSocket!=NULL);
+	if (!currentSocket)
+		{
+		return;
+		}
+	TInt err=info.iError;		
+	switch (TWapNotificationEvent(aMessage))
+		{
+	case EPduLengthReceived:
+			{
+			CActiveSocket* sock1=GetActiveSocketByStatus(ERequestingData);
+			CActiveSocket* sock2=GetActiveSocketByStatus(EGotLength);
+			CActiveSocket* sock3=GetActiveSocketByStatus(EReading);
+			if (!sock1 && !sock2 && !sock3 && iRequestActive)
+				// Read pdu length from this socket
+				{
+				iRequestActive=EFalse;
+				if (err==KErrNone)
+					{
+					TUint16 length=(TUint16)currentSocket->GetPduSize();
+					TPckg<TUint16> des(length);
+					iClientDataSize->Copy(des);	
+					}
+				else
+					{
+					currentSocket->CleanUpData();
+					}
+				User::RequestComplete(iRequestStatus, err);
+				}
+			break;
+			}
+	case EPduReceived:
+			{
+			ASSERT(iRequestActive);
+			if (iRequestActive)
+				{
+				// Read pdu from this socket
+				iRequestActive=EFalse;
+				iTimeoutTimer->Cancel();
+				if (err==KErrNone)
+					{
+					TSockAddr& remoteAddr=currentSocket->GetRemoteAddress();
+					TRAP(err, CSWSWapMsgUtils::AnalyseAddrL(remoteAddr, bearer, *iClientRemoteHost, *iClientRemotePort))
+					if (!err)
+						{
+						err=currentSocket->GetPduData(*iClientPduBuffer, *iClientTruncated);
+						if (!err)
+							iLastPduBearer=bearer;
+						}
+					else
+						{
+						currentSocket->SetDataState(EReading);
+						}
+					}
+				else
+					{
+					currentSocket->CleanUpData();
+					}
+				User::RequestComplete(iRequestStatus, err);
+				}
+			}
+		break;
+	default:
+		LOG(SwsLog::Printf(_L("CWdpMessageApiAgent::Notification() Unknown Event From Bearer"));)
+		;
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapMessageApiAgent.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,205 @@
+// Copyright (c) 2003-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 __MSGAPIAGENT_H__
+#define __MSGAPIAGENT_H__
+#include "ActiveSocket.h"
+#include "WapSwsTimeOut.h"
+
+class MProgressNotify
+/** 
+Interface from the ActiveSocket to MessageApiAgent
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	public:
+	/**
+	The interface that will be called when WDP pdu length and data are received by CActiveSocket.
+	@internalComponent
+	@param aMessage the message type received from CActiveSocket
+	@param aData the data received from CActiveSocket
+	*/
+	virtual void Notification(TInt aMessage, const TDesC8& aData) = 0;	
+	};
+
+class CWapAsyncCallBack : public CActive
+	{
+public:
+	CWapAsyncCallBack( const TCallBack& aCallBack, TInt aPriority );
+	~CWapAsyncCallBack();
+
+public: // API
+	void CallBack();
+
+private:
+	void RunL();
+	void DoCancel();
+
+private:
+	TCallBack iCallBack;
+	};
+
+class CWapMessageApiAgent : public CBase, public MTimeOutNotify, public MProgressNotify
+/** 
+The base class of CWspMessageApiAgent and CWdpMessageApiAgent, which handle Wsp and Wdp
+for SWS message APIs
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	virtual ~CWapMessageApiAgent();
+	void ConstructL();
+	CActiveSocket* GetActiveSocketByBearer(Wap::TBearer aBearer);
+	CActiveSocket* GetActiveSocketByStatus(TWapMessageState aState);
+	TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure);
+	TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure, TInetAddr aInetAddr);
+	TInt Connect(Wap::TBearer aBearer, Wap::TPort aPort, TBool aSecure, TInt aSocketServHandle, RConnection* aConnection);
+	TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure, TInetAddr aInetAddr);
+	TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure);
+	TInt Connect(const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer, TBool aSecure, TInt aSocketServHandle, RConnection* aConnection);
+	TInt GetLocalPort(Wap::TPort& aPort);
+	TInt GetLocalAddress(HBufC8*& aLocalHost);
+	TInt GetBearer(Wap::TBearer& aBearer);
+	TInt GetServerAddress(HBufC8*& aRemoteHost);
+	virtual void TimerExpired();
+	void CancelRequest();
+	static TInt CompleteReading(TAny* aAgent);
+protected:
+	CWapMessageApiAgent(TWapMessageType aMessageType);
+	/**
+	RSocketServ instance used by all the bearers.
+	*/
+	RSocketServ iSocketServ;
+	/**
+	The array to contain all the bearers
+	*/
+	RPointerArray<CActiveSocket> iBearers;
+	/**
+	The Wdp and Wsp receiving timer.
+	*/
+	CTimeOutTimer* iTimeoutTimer;
+	/**
+	Flag the show if there is outstanding request.
+	*/
+	TBool iRequestActive;
+	/**
+	The pointer to Wap message client's request status
+	*/
+	TRequestStatus* iRequestStatus;
+	/**
+	The last error code of active socket in reading state
+	*/
+	TInt iLastReadingError;
+	/**
+	The asynchronous completion of reading
+	*/
+	CWapAsyncCallBack* iAsyncReadCompletion;
+	/**
+	The bearer that receives that last PDU
+	*/
+	Wap::TBearer iLastPduBearer;
+	/**
+	Flag to show if the API has been connected or not
+	*/
+	TBool iIsOpen;
+	/**
+	The type of the Wap message handled by this API agent.
+	*/
+	TWapMessageType iMessageType;
+private:
+	TInt DoCompleteReading();
+};
+
+class CWspMessageApiAgent : public CWapMessageApiAgent
+/** 
+The class to handle Wsp PDU for SWS message APIs
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	static CWspMessageApiAgent* NewL();
+	CWspMessageApiAgent();
+	virtual ~CWspMessageApiAgent();
+	void ConstructL();
+	TInt SendWspMessage(Wap::TBearer aBearer, const TDesC8& aRemoteHost, Wap::TPort aRemotePort, TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, TUint8 aTransactionId);
+	TInt SendWspMessage(TUint aMethod, const TDesC& aURI, const TDesC8& aReqHeaders, const TDesC8& aReqBody, TUint8 aTransactionId);
+	TInt ReceiveWspMessage(TDes8& aWspHeaders, TDes8& aWspBody, TPckgBuf<TUint8>& aPushIdPckg, TWSPStatus& aWspStatus, TRequestStatus& aReqStatus, TUint32 aTimeout);
+	virtual void Notification(TInt aMessage, const TDesC8& aData);
+private:
+	/**
+	The pointer to the WSP message client's requested header buffer
+	*/
+	TDes8* iClientReqHeaders;
+	/**
+	The pointer to the WSP message client's requested body buffer
+	*/
+	TDes8* iClientReqBody;
+	/**
+	The pointer to the WSP message client's requested transaction ID.
+	*/
+	TUint8*	iClientTransactionId;
+	/**
+	The pointer to the WSP message client's requested WSP status.
+	*/
+	TWSPStatus* iClientWspStatus;
+};
+
+class CWdpMessageApiAgent : public CWapMessageApiAgent
+/** 
+The class to handle Wdp PDU for SWS message APIs
+@internalComponent
+@released
+@since v8.0
+*/
+{
+public:
+	static CWdpMessageApiAgent* NewL();
+	CWdpMessageApiAgent();
+	virtual ~CWdpMessageApiAgent();
+	void ConstructL();
+	TInt ReceiveWdpMessage(TDes8& aRemoteHost, Wap::TPort& aRemotePort, TDes8& aBuffer, TBool& aTruncated, TRequestStatus& aReqStatus, TUint32 aTimeout);
+	TInt AwaitRecvDataSize(TPckg<TUint16>& aDataSizePckg, TRequestStatus& aReqStatus);
+	TInt SendWdpMessage(const TDesC8& aBuffer, const TDesC8& aRemoteHost, Wap::TPort aRemotePort, Wap::TBearer aBearer);
+	TInt SendWdpMessage(const TDesC8& aBuffer);
+	virtual void Notification(TInt aMessage, const TDesC8& aData);
+private:
+	/**
+	The pointer to Wdp message client's requested data buffer
+	*/
+	TDes8*	iClientPduBuffer;
+	/**
+	The pointer to Wdp message client's request data size
+	*/
+	TPckg<TUint16>* iClientDataSize;
+	/**
+	The pointer to client's requested remote host buffer
+	*/
+	TDes8* iClientRemoteHost;
+	/**
+	The pointer to client's requested remote port buffer
+	*/
+	Wap::TPort* iClientRemotePort;
+	/**
+	The pointer to client's requested flag.
+	*/
+	TBool* iClientTruncated;
+};
+#endif //__MSGAPIAGENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapMsgUtils.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,129 @@
+// Copyright (c) 2003-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 "WapMsgUtils.h"
+#include <wapmessage.h>
+#include <wapmsgerr.h>
+#include <es_wsms.h>
+#include <f32file.h>
+
+TInt CSWSWapMsgUtils::GetLocalAddress(HBufC8*& aLocalHost)
+/**
+Not supported
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+	// Panic client if the buffer isn't null
+	__ASSERT_ALWAYS(aLocalHost==NULL, User::Panic(Wap::KWapMsgPanicDescriptor, KErrArgument));
+
+	RArray<Wap::TAddressInfo> myArray;
+
+	TInt ret(0);
+	TRAPD(err, ret=CWapMessageUtils::GetLocalAddressesL(myArray))
+	if (err)
+		{
+		return err;
+		}
+	// GetLocalAddressesL can return KErrNotFound if there is no network interface up
+	if (ret)
+		{
+		return ret;
+		}
+
+	TBuf16<256>tempBuf16;
+	TBuf8<256>tempBuf8;				  
+	TInetAddr* info = &myArray[0].iAddress;
+	// Output the address to a descriptor
+	info->Output(tempBuf16);
+	// Need to convert the buffer to 8 bit;
+	tempBuf8.Copy(tempBuf16);
+	// Note: Ownership of the allocated buffer is passed to the client
+	aLocalHost = HBufC8::New( tempBuf16.Length() );
+	if (!aLocalHost)
+		{
+		return KErrNoMemory;
+		}
+	// Now copy the 8 bit version of the address
+	*aLocalHost = tempBuf8;
+
+	return KErrNone;
+	}
+			 
+void CSWSWapMsgUtils::BuildAddrL(TSockAddr& aAddr, Wap::TBearer aBearer, const TDesC8& aHost, Wap::TPort aPort)
+/**
+Build a socket address according to the given parameters.
+@internalComponent
+@released
+@since v8.0
+@param aAddr the socket address which is built from given parameters
+@param aBearer the underlie bearer type
+@param aHost the host name
+@param aHost the port number
+*/
+	{
+    if (aBearer==Wap::EIP)
+        {
+        TInetAddr addr(aPort);
+        HBufC16* addr16=HBufC16::NewL(aHost.Length());
+        TPtr16 addr16Des=addr16->Des();
+        addr16Des.Copy(aHost);
+        // coverity[check_return]
+        addr.Input(addr16Des);
+        aAddr=addr;
+        delete addr16;
+        }
+	else
+		{
+		TWapAddr addr;
+		addr.SetWapPort(TWapPortNumber(aPort));
+		addr.SetWapAddress(aHost);
+		aAddr=addr;
+		}
+	}
+void CSWSWapMsgUtils::AnalyseAddrL(TSockAddr& aAddr, Wap::TBearer aBearer, TDes8& aHost, Wap::TPort& aPort)
+/**
+Analyse a socket address, and generate host name and port
+@internalComponent
+@released
+@since v8.0
+@param aAddr the socket address to be analysed
+@param aBearer the underlie bearer type
+@param aHost the host name
+@param aHost the port number
+*/
+	{
+	aPort=static_cast<Wap::TPort>(aAddr.Port());
+	if (aBearer==Wap::EIP)
+		{
+		TInetAddr addr(aAddr);
+		// If the family is KAfInet6, the output buffer must be at least 
+		// 39 characters. 
+		// If less, the buffer is filled with '*' characters.
+		HBufC16* addr16=HBufC16::NewL(40);
+		TPtr16 addr16Des=addr16->Des();
+		addr.Output(addr16Des);
+		aHost.Copy(addr16Des);
+		delete addr16;
+		}
+	else
+		{
+		TWapAddr& wapAddr = *(reinterpret_cast<TWapAddr*>(&aAddr));
+		TPtrC8 addr=wapAddr.WapAddress();
+		aHost.Copy(addr);
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapMsgUtils.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,50 @@
+// Copyright (c) 2003-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:
+// Utilities 
+// 
+//
+
+#ifndef __CSWSWAPMSGUTILS_H__ 
+#define __CSWSWAPMSGUTILS_H__
+
+#include <e32base.h>
+#include <e32std.h>
+#include <es_sock.h>
+#include <wapmessage.h>
+
+const TInt KWapStackMaxDatagramSize = 4000;
+const TInt KWapStackNorminalDatagramSize = 4000;
+
+
+
+class CSWSWapMsgUtils : public CBase
+/** 
+Provide a set of static function which to be used by SWS. Contains the functions to build a
+specific socket address from given parameters, analyse a specific socket address, and to
+determine the SMS bearer type, GSM.
+@internalComponent
+@released
+@since v8.0
+*/
+	{
+public:
+	// Returns the current local address, a null pointer must be passed in, buffer ownership is given to the client
+	static TInt GetLocalAddress(HBufC8*& aLocalHost);
+	static void BuildAddrL(TSockAddr& aAddr, Wap::TBearer aBearer, const TDesC8& aRemoteHost, Wap::TPort aRemotePort);
+	static void AnalyseAddrL(TSockAddr& aAddr, Wap::TBearer aBearer, TDes8& aRemoteHost, Wap::TPort& aRemotePort);
+
+	};
+
+#endif //__CSWSWAPMSGUTILS_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapSwsLog.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,42 @@
+// Copyright (c) 2003-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:
+// WAPLOG.CPP
+// 
+//
+
+
+#ifdef _DEBUG
+
+#include "WapSwsLog.h"
+
+void SwsLog::Write(const TDesC& aDes)
+/*
+ * Write aText to the log
+ */
+	{
+	RFileLogger::Write(KSWSLogFolder(),KSWSLogFile(),EFileLoggingModeAppend,aDes);
+	}
+
+void SwsLog::Printf(TRefByValue<const TDesC> aFmt,...)
+/*
+ * Write a mulitple argument list to the log, trapping and ignoring any leave
+ */
+	{
+	VA_LIST list;
+	VA_START(list,aFmt);
+	RFileLogger::WriteFormat(KSWSLogFolder(),KSWSLogFile(),EFileLoggingModeAppend,aFmt,list);
+	}
+	
+#endif // _DEBUG
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapSwsLog.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,47 @@
+// Copyright (c) 2003-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 __WAPLOG_H__
+#define __WAPLOG_H__
+
+#ifdef _DEBUG
+
+	#include <comms-infras/commsdebugutility.h>
+	#define LOG(MSG) MSG
+
+	#if defined (DETAILED_LOG)
+		#define LOG_DETAILED(MSG) MSG
+	#else
+		#define LOG_DETAILED(MSG)
+	#endif
+
+	_LIT(KSWSLogFolder,"sws");
+	_LIT(KSWSLogFile,"sws.txt");
+	_LIT(KEndOfLine,"\r\n");
+
+	class SwsLog
+		{
+	public:
+		static void Write(const TDesC& aDes);
+	    static void Printf(TRefByValue<const TDesC> aFmt, ...);
+		};
+#else
+
+	#define LOG(MSG)
+	#define LOG_DETAILED(MSG)
+
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapSwsTimeOut.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,46 @@
+// Copyright (c) 2001-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 __TIMEOUT_H__
+#define __TIMEOUT_H__
+
+// Class definitions to support the recive with timeout methods
+
+#include <e32base.h>
+
+// MTimeOutNotify: used in conjunction with CTimeOutTimer class
+class MTimeOutNotify
+	{
+public:
+	virtual void TimerExpired() = 0;
+	};
+
+// CTimeOutTimer: timer for comms time-outs
+class CTimeOutTimer: public CTimer
+	{
+public:
+	static CTimeOutTimer* NewL(MTimeOutNotify& aTimeOutNotify);
+	~CTimeOutTimer();
+
+protected:
+    CTimeOutTimer(MTimeOutNotify& aTimeOutNotify);
+	void ConstructL();
+    virtual void RunL();
+
+private:
+	MTimeOutNotify& iNotify;
+	};
+
+#endif // __TIMEOUT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/WapSwsTimeout.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,52 @@
+// Copyright (c) 2001-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:
+// Timeout.cpp
+// 
+//
+
+#include "WapSwsTimeOut.h"
+
+//
+// CTimeOutTimer: timer for comms time-outs
+//
+CTimeOutTimer::CTimeOutTimer(MTimeOutNotify& aTimeOutNotify)
+: CTimer(EPriorityStandard), iNotify(aTimeOutNotify)
+    {
+    }
+
+CTimeOutTimer::~CTimeOutTimer()
+    {
+	Cancel();
+    }
+
+CTimeOutTimer* CTimeOutTimer::NewL(MTimeOutNotify& aTimeOutNotify)
+    {
+    CTimeOutTimer *p = new (ELeave) CTimeOutTimer(aTimeOutNotify);
+    CleanupStack::PushL(p);
+	p->ConstructL();
+	CleanupStack::Pop(p);
+    return p;
+    }
+
+void CTimeOutTimer::ConstructL()
+    {
+	CTimer::ConstructL();
+	CActiveScheduler::Add(this);
+    }
+
+void CTimeOutTimer::RunL()
+    {
+	// Timer request has completed, so notify the timer's owner
+	iNotify.TimerExpired();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/sws/swswapmsg.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,42 @@
+// Copyright (c) 1997-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 <ecom/implementationproxy.h>
+#include "WapBoundWDP.h"
+#include "WapFullySpecWDP.h"
+#include "WapBoundCLPush.h"
+#include "WapFullySpecCLPush.h"
+#include "WapBoundCLWSP.h"
+#include "WapFullySpecCLWSP.h"
+
+// Exported proxy for instantiation method resolution
+// Define the interface UIDs
+const TImplementationProxy ImplementationTable[] = 
+	{
+		IMPLEMENTATION_PROXY_ENTRY(0x101FBB37,	CSWSWapBoundWDPService::NewL),
+		IMPLEMENTATION_PROXY_ENTRY(0x101FBB38,	CSWSWapFullySpecWDPService::NewL),
+		IMPLEMENTATION_PROXY_ENTRY(0x101FBB39,	CSWSWapBoundCLPushService::NewL),
+		IMPLEMENTATION_PROXY_ENTRY(0x101FBB3A,	CSWSWapFullySpecCLPushService::NewL),
+		IMPLEMENTATION_PROXY_ENTRY(0x101FBB3C,	CSWSWapBoundCLWSPService::NewL),
+		IMPLEMENTATION_PROXY_ENTRY(0x101FBB3E,	CSWSWapFullySpecCLWSPService::NewL)
+	};
+
+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/wapstack/wapmessageapi/sws/swswapmsgsource.mmpi	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,24 @@
+/*
+* 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: 
+*
+*/
+// Contains just source of swswapmsg, not including file that defines the dll entry point
+
+SOURCE			WapBoundWDP.cpp WapFullySpecWDP.cpp
+SOURCE			WapBoundCLPush.cpp WapFullySpecCLPush.cpp
+SOURCE			WapBoundCLWSP.cpp WapFullySpecCLWSP.cpp
+SOURCE			WapMsgUtils.cpp WapSwsTimeout.cpp ActiveSocket.cpp
+SOURCE			CLWSPPduHandler.cpp WapMessageApiAgent.cpp
+SOURCE			WapSwsLog.cpp
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/bmarm/wapstacksuiteu.def	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	NewServer__Fv @ 1 NONAME R3UNUSED ; NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/bwins/wapstacksuiteu.def	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewServer@@YAHXZ @ 1 NONAME ; int __cdecl NewServer(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/group/CdmaWapStackSuite.iby	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,47 @@
+/*
+* 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 __CDMAWAPSTACKTEST_SUITE_IBY__
+#define __CDMAWAPSTACKTEST_SUITE_IBY__
+
+#include <testexecute.iby>
+#include <wapmessage.iby>
+#include <cdmasmsstack.iby>
+#include <simtsy.iby>
+#include <telephony.iby>
+#include <esock.iby>
+
+file=ABI_DIR\DEBUG_DIR\WapStackSuite.exe		System\libs\WapStackSuite.exe
+
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\WapStackSuite.ini		testdata\configs\WapStackSuite.ini
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\UDPPush.ini		testdata\configs\UDPPush.ini
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\wapstacksuite_config.ini	testdata\configs\wapstacksuite_config.ini
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\WapStackSuite.xml		testdata\configs\WapStackSuite.xml
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\CdmaWapSIMTSY.txt		testdata\configs\CdmaWapSIMTSY.txt
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\PushPDU.bin		testdata\configs\PushPDU.bin
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\Te_CdmaWapStackSuite.script testdata\scripts\Te_CdmaWapStackSuite.Script
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapBoundWDP.script 	testdata\scripts\WapBoundWDP.script
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapFullySpecWDP.script 	testdata\scripts\WapFullySpecWDP.script 
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapBoundPush.script 	testdata\scripts\WapBoundPush.script    
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapFullySpecPush.script 	testdata\scripts\WapFullySpecPush.script
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapBoundWSP.script 	testdata\scripts\WapBoundWSP.script     
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapFullySpecWSP.script	testdata\scripts\WapFullySpecWSP.script 
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\UDPPush.script		testdata\scripts\UDPPush.script 
+
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\Te_WapStackSuite.script 	testdata\scripts\Te_WapStackSuite.Script
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\WapSIMTSY.txt		testdata\configs\WapSIMTSY.txt
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/group/WapStackSuite.iby	Tue May 18 17:12:08 2010 +0100
@@ -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: 
+*
+*/
+
+#ifndef __WAPSTACKTEST_SUITE_IBY__
+#define __WAPSTACKTEST_SUITE_IBY__
+
+#include <testexecute.iby>
+
+file=ABI_DIR\DEBUG_DIR\WapStackSuite.exe		System\libs\WapStackSuite.exe
+
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\WapStackSuite.ini		testdata\configs\WapStackSuite.ini
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\UDPPush.ini		testdata\configs\UDPPush.ini
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\WapStackSuite.xml		testdata\configs\WapStackSuite.xml
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\WapSIMTSY.txt		testdata\configs\WapSIMTSY.txt
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\configs\PushPDU.bin		testdata\configs\PushPDU.bin
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\Te_WapStackSuite.script 	testdata\scripts\Te_WapStackSuite.Script
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapBoundWDP.script 	testdata\scripts\WapBoundWDP.script
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapFullySpecWDP.script 	testdata\scripts\WapFullySpecWDP.script 
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapBoundPush.script 	testdata\scripts\WapBoundPush.script    
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapFullySpecPush.script 	testdata\scripts\WapFullySpecPush.script
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapBoundWSP.script 	testdata\scripts\WapBoundWSP.script     
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\WapFullySpecWSP.script	testdata\scripts\WapFullySpecWSP.script 
+data=EPOCROOT##Epoc32\release\winscw\udeb\z\testdata\scripts\UDPPush.script	testdata\scripts\UDPPush.script 
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/group/WapStackSuite.mmp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,52 @@
+// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+TARGET		wapstacksuite.exe
+TARGETTYPE 	exe
+	UID             0x1000008d 0x10282B37
+
+
+SOURCEPATH  ../src
+SOURCE		WapStackSuiteServer.cpp
+SOURCE		WapStackSuiteStepBase.cpp
+SOURCE		WapBoundWDPSteps.cpp	
+SOURCE		WapBoundCLPushSteps.cpp
+SOURCE		WapBoundWSPSteps.cpp	
+SOURCE		WapFullySpecWDPSteps.cpp
+SOURCE		WapFullySpecCLPushSteps.cpp	
+SOURCE		WapFullySpecWSPSteps.cpp	
+
+USERINCLUDE   ../src
+
+OS_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+LIBRARY		euser.lib
+LIBRARY		etel.lib
+LIBRARY		testexecuteutils.lib 
+LIBRARY		insock.lib
+LIBRARY		wapmsgcli.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		c32root.lib
+LIBRARY 	esock.lib 
+LIBRARY 	efsrv.lib 
+LIBRARY 	ecom.lib 
+
+//CAPABILITY ALL -Tcb
+//  set capabilities the same as wapmsgcli.dll, which this test loads, to avoid capabilities conflict
+CAPABILITY ReadDeviceData WriteDeviceData LocalServices NetworkServices ReadUserData WriteUserData NetworkControl
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/scripts/Te_WapStackSuite.script	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,64 @@
+// Copyright (c) 2001-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:
+// WAP stack test main script file
+// 
+//
+
+PRINT GT167-WAP stack tests
+run_script z:\TestData\scripts\te_esock_test_unloadesockForced.script
+ced -i z:\testdata\configs\WapStackSuite.xml WapStackSuite.log
+run_script z:\TestData\scripts\te_esock_test_loadesock.script
+
+//delete any existing config.txt
+RUN_UTILS  MakeReadWrite c:\config.txt
+RUN_UTILS copyfile c:\config.txt c:\config.old
+RUN_UTILS  DeleteFile c:\config.txt
+
+//copy our config file
+run_utils copyfile z:\testdata\configs\WapSIMTSY.txt c:\Config.txt
+RUN_UTILS  MakeReadWrite c:\config.txt
+
+//Delete any previous wapstackconfig file
+RUN_UTILS MakeReadWrite c:\system\data\wapstackconfig.old
+RUN_UTILS copyfile c:\system\data\wapstackconfig.ini c:\system\data\wapstackconfig.old
+RUN_UTILS MakeReadWrite c:\system\data\wapstackconfig.ini
+RUN_UTILS DeleteFile c:\system\data\wapstackconfig.ini
+
+RUN_SCRIPT z:\testdata\scripts\WapBoundWDP.script
+RUN_SCRIPT z:\testdata\scripts\WapFullySpecWDP.script
+RUN_SCRIPT z:\testdata\scripts\WapBoundPush.script
+RUN_SCRIPT z:\testdata\scripts\WapFullySpecPush.script
+RUN_SCRIPT z:\testdata\scripts\WapBoundWSP.script
+RUN_SCRIPT z:\testdata\scripts\WapFullySpecWSP.script
+RUN_SCRIPT z:\testdata\scripts\UDPPush.script
+
+START_TESTCASE			WAP-WAPMESSAGE-0110
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0110
+LOAD_SUITE WapStackSuite
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_OutOfMemory
+END_TESTCASE			WAP-WAPMESSAGE-0110
+
+//Delete our config file
+run_utils delete c:\Config.txt
+//put back the old config.txt 
+RUN_UTILS copyfile c:\config.old c:\config.txt
+run_script z:\TestData\scripts\te_esock_test_unloadesockForced.script
+
+//put back any previous wapstackconfig.ini file
+RUN_UTILS MakeReadWrite c:\system\data\wapstackconfig.ini
+RUN_UTILS copyfile c:\system\data\wapstackconfig.old c:\system\data\wapstackconfig.ini
+
+PRINT GT167-WAP stack tests finished
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/scripts/UDPPush.script	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,35 @@
+// Copyright (c) 2001-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:
+// WAP stack BoundPush test script file
+// 
+//
+
+PRINT GT167-WAP stack BOUND-PUSH-UDP test
+
+//ced -i z:\testdata\configs\WapStackSuiteRAS.cfg
+
+LOAD_SUITE WapStackSuite
+
+START_TESTCASE			WAP-WAPMESSAGE-0101
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0101
+
+CONCURRENT
+
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_4 z:\testdata\configs\UDPPush.ini Test_1
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_9 z:\testdata\configs\UDPPush.ini Test_2
+END_TESTCASE			WAP-WAPMESSAGE-0101
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/scripts/WSP.script	Tue May 18 17:12:08 2010 +0100
@@ -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: 
+//
+//
+PRINT Run all WAP stack Suite Tests
+
+ced -i z:\WapStackSuite\WapStackSuiteRAS.xml
+
+LOAD_SUITE WapStackSuite
+
+// --------------------------------------------------
+// TEST(4)
+// 
+START_TESTCASE			WAP-WAPMESSAGE-0801
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0801
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.1
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.2
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.3
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.4
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.5
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.6
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.7
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.8
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.9
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.10
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.11
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.12
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.13
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.14
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.14.2
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.14.1
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.15
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.16
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\WapStackSuite\WSP.ini Test_9.17
+END_TESTCASE			WAP-WAPMESSAGE-0801
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/scripts/WapBoundPush.script	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,119 @@
+// Copyright (c) 2001-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:
+// WAP stack BoundPush test script file
+// 
+//
+
+PRINT GT167-WAP stack BOUND-PUSH test
+
+LOAD_SUITE WapStackSuite
+
+// ---------------------------------------------------------------------------------
+// TEST(1) Load implementation
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0201
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0201
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_1 z:\testdata\configs\WapStackSuite.ini COMMON
+END_TESTCASE			WAP-WAPMESSAGE-0201
+
+// ---------------------------------------------------------------------------------
+// TEST(2) Connect using different bearers (tests 1.7, 1.8, 1.1.10 must fail)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0202
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0202
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.1
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.2
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.3
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.4
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.5
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.6
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.7
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.8
+// Reconnect
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.10
+
+CONCURRENT
+// Connect to the same port (second test should fail)
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.1
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.1.1
+
+// Connect to the different ports at the same time
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.1.2
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.1.3
+
+CONSECUTIVE
+END_TESTCASE			WAP-WAPMESSAGE-0202
+
+// ---------------------------------------------------------------------------------
+// TEST(3) Unconnected
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0203
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0203
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_3 z:\testdata\configs\WapStackSuite.ini Test_3
+END_TESTCASE			WAP-WAPMESSAGE-0203
+
+// ---------------------------------------------------------------------------------
+// TEST(4) Normal condition/Multiple receive
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0204
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0204
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_4 z:\testdata\configs\WapStackSuite.ini Test_4.3.1
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_4 z:\testdata\configs\WapStackSuite.ini Test_4.3.2
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_4 z:\testdata\configs\WapStackSuite.ini Test_4.3.3
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_4 z:\testdata\configs\WapStackSuite.ini Test_4.3.4
+END_TESTCASE			WAP-WAPMESSAGE-0204
+
+// ---------------------------------------------------------------------------------
+// TEST(5) Cancel
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0205
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0205
+//RUN_TEST_STEP 100 WapStackSuite BoundCLPush_5 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0205
+
+// ---------------------------------------------------------------------------------
+// TEST(6) Timeout
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0206
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0206
+//RUN_TEST_STEP 100 WapStackSuite BoundCLPush_6 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0206
+
+// ---------------------------------------------------------------------------------
+// TEST(7) Wrong sequence
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0207
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0207
+RUN_TEST_STEP 100 WapStackSuite BoundCLPush_7 z:\testdata\configs\WapStackSuite.ini Test_7.1
+END_TESTCASE			WAP-WAPMESSAGE-0207
+
+// ---------------------------------------------------------------------------------
+// TEST(8) API low/high in parameter
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0208
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0208
+//RUN_TEST_STEP 100 WapStackSuite BoundCLPush_8 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0208
+
+// ---------------------------------------------------------------------------------
+// TEST(9)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0209
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0209
+//RUN_TEST_STEP 100 WapStackSuite BoundCLPush_9 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0209
+
+PRINT GT167-WAP stack BOUND-PUSH test finished
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/scripts/WapBoundWDP.script	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,129 @@
+// Copyright (c) 2001-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:
+// WAP stack WapBoundWDP test script file
+// 
+//
+
+PRINT GT167-WAP stack BOUND-WDP tests
+
+LOAD_SUITE WapStackSuite
+
+// ---------------------------------------------------------------------------------
+// TEST(1) Load implementation
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0301
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0301
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_1 z:\testdata\configs\WapStackSuite.ini COMMON
+END_TESTCASE			WAP-WAPMESSAGE-0301
+
+// ---------------------------------------------------------------------------------
+// TEST(2) Connect using different bearers (tests 1.7, 1.10 must fail)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0302
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0302
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.2
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.3
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.4
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.5
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.6
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.7
+// Reconnect
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.10
+
+CONCURRENT
+
+// Connect to the same port (second test should fail)
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1.1
+// Connect to the different ports at the same time
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1.2
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1.3
+
+CONSECUTIVE
+END_TESTCASE			WAP-WAPMESSAGE-0302
+
+// ---------------------------------------------------------------------------------
+// TEST(3) Unconnected
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0303
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0303
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_3 z:\testdata\configs\WapStackSuite.ini Test_3
+END_TESTCASE			WAP-WAPMESSAGE-0303
+
+// ---------------------------------------------------------------------------------
+// TEST(4) Normal condition/Multiple receive
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0304
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0304
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.1
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.2
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.3
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.4
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.5
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.5.1
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.5.2
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.5.3
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.5.4
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.6
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.7
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.8
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.1.9
+END_TESTCASE			WAP-WAPMESSAGE-0304
+
+// ---------------------------------------------------------------------------------
+// TEST(5) Cancel
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0305
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0305
+//RUN_TEST_STEP 100 WapStackSuite BoundWDP_5 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0305
+
+// ---------------------------------------------------------------------------------
+// TEST(6) Timeout
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0306
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0306
+//RUN_TEST_STEP 100 WapStackSuite BoundWDP_6 z:\testdata\configs\WapStackSuite.ini
+
+// ---------------------------------------------------------------------------------
+// TEST(7) Wrong sequence
+// ---------------------------------------------------------------------------------
+RUN_TEST_STEP 100 WapStackSuite BoundWDP_7 z:\testdata\configs\WapStackSuite.ini Test_7.1
+END_TESTCASE			WAP-WAPMESSAGE-0306
+
+
+// ---------------------------------------------------------------------------------
+// TEST(8) API low/high in parameter
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0307
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0307
+//RUN_TEST_STEP 100 WapStackSuite BoundWDP_8 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0307
+
+
+// ---------------------------------------------------------------------------------
+// TEST(9) Reserved
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0308
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0308
+//RUN_TEST_STEP 100 WapStackSuite BoundWDP_9 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0308
+
+
+PRINT GT167-WAP stack BOUND-WDP test finished
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/scripts/WapBoundWSP.script	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,118 @@
+// Copyright (c) 2001-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:
+// WAP stack WapBoundWSP test script file
+// 
+//
+
+PRINT GT167-WAP stack BOUND-WSP test
+
+LOAD_SUITE WapStackSuite
+
+// ---------------------------------------------------------------------------------
+// TEST(1) Load implementation
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0401
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0401
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_1 z:\testdata\configs\WapStackSuite.ini COMMON
+END_TESTCASE			WAP-WAPMESSAGE-0401
+
+// ---------------------------------------------------------------------------------
+// TEST(2) Connect using different bearers (tests 1.7, 1.8, 1.10 must fail)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0402
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0402
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.2
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.3
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.4
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.5
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.6
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.7
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.8
+// Reconnect
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.10
+
+CONCURRENT
+// Connect to the same port (second test should fail)
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1.1
+
+// Connect to the different ports at the same time
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1.2
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1.3
+
+CONSECUTIVE
+END_TESTCASE			WAP-WAPMESSAGE-0402
+
+// ---------------------------------------------------------------------------------
+// TEST(3) Unconnected
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0403
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0403
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_3 z:\testdata\configs\WapStackSuite.ini Test_3
+END_TESTCASE			WAP-WAPMESSAGE-0403
+
+// ---------------------------------------------------------------------------------
+// TEST(4) Normal condition/Multiple receive
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0404
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0404
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_4 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0404
+
+// ---------------------------------------------------------------------------------
+// TEST(5) Cancel
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0405
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0405
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_5 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0405
+
+// ---------------------------------------------------------------------------------
+// TEST(6) Timeout
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0406
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0406
+RUN_TEST_STEP 100 WapStackSuite BoundWSP_6 z:\testdata\configs\WapStackSuite.ini Test_6.1
+END_TESTCASE			WAP-WAPMESSAGE-0406
+
+// ---------------------------------------------------------------------------------
+// TEST(7) Wrong sequence
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0407
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0407
+RUN_TEST_STEP 100 WapStackSuite  BoundWSP_7 z:\testdata\configs\WapStackSuite.ini Test_7.1
+END_TESTCASE			WAP-WAPMESSAGE-0407
+
+// ---------------------------------------------------------------------------------
+// TEST(8) API low/high in parameter
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0408
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0408
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_8 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0408
+
+// ---------------------------------------------------------------------------------
+// TEST(9)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0409
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0409
+//RUN_TEST_STEP 100 WapStackSuite BoundWSP_9 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0409
+
+PRINT GT167-WAP stack BOUN-WSP test finished
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/scripts/WapFullySpecPush.script	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,108 @@
+// Copyright (c) 2001-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:
+// WAP stack WapFullySpecPush test script file
+// 
+//
+
+PRINT GT167-WAP stack FULLY_SPECIFIED-PUSH test
+
+LOAD_SUITE WapStackSuite
+
+// ---------------------------------------------------------------------------------
+// TEST(1) Load implementation
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0501
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0501
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_1 z:\testdata\configs\WapStackSuite.ini COMMON
+END_TESTCASE			WAP-WAPMESSAGE-0501
+
+// ---------------------------------------------------------------------------------
+// TEST(2) Connect using different bearers (tests 1.7, 1.8, 1.9, 1.10 must fail)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0502
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0502
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.1
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.2
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.3
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.4
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.5
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.7
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.8
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.9
+// Reconnect
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_2 z:\testdata\configs\WapStackSuite.ini Test_2.10
+END_TESTCASE			WAP-WAPMESSAGE-0502
+
+// ---------------------------------------------------------------------------------
+// TEST(3) Unconnected
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0503
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0503
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_3 z:\testdata\configs\WapStackSuite.ini Test_3
+END_TESTCASE			WAP-WAPMESSAGE-0503
+
+// ---------------------------------------------------------------------------------
+// TEST(4) Normal condition/Multiple receive
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0504
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0504
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_4 z:\testdata\configs\WapStackSuite.ini Test_4.4.1
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_4 z:\testdata\configs\WapStackSuite.ini Test_4.4.2
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_4 z:\testdata\configs\WapStackSuite.ini Test_4.4.3
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_4 z:\testdata\configs\WapStackSuite.ini Test_4.4.4
+END_TESTCASE			WAP-WAPMESSAGE-0504
+
+// ---------------------------------------------------------------------------------
+// TEST(5) Cancel
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0505
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0505
+//RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_5 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0505
+
+// ---------------------------------------------------------------------------------
+// TEST(6) Timeout
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0506
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0506
+//RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_6 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0506
+
+// ---------------------------------------------------------------------------------
+// TEST(7) Wrong sequence
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0507
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0507
+RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_7 z:\testdata\configs\WapStackSuite.ini Test_7.1
+END_TESTCASE			WAP-WAPMESSAGE-0507
+
+// ---------------------------------------------------------------------------------
+// TEST(8) API low/high in parameter
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0508
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0508
+//RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_8 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0508
+
+// ---------------------------------------------------------------------------------
+// TEST(9)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0509
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0509
+//RUN_TEST_STEP 100 WapStackSuite FullySpecCLPush_9 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0509
+
+PRINT GT167-WAP stack FULLY_SPECIFIED-PUSH test finished
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/scripts/WapFullySpecWDP.script	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,110 @@
+// Copyright (c) 2001-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:
+// WAP stack WapFullySpecWDP test script file
+// 
+//
+
+PRINT GT167-WAP stack FULLY_SPECIFIED-WDP test
+
+LOAD_SUITE WapStackSuite
+
+// ---------------------------------------------------------------------------------
+// TEST(1) Load implementation
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0601
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0601
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_1 z:\testdata\configs\WapStackSuite.ini COMMON
+END_TESTCASE			WAP-WAPMESSAGE-0601
+
+// ---------------------------------------------------------------------------------
+// TEST(2) Connect using different bearers (tests 1.7, 1.9, 1.10 must fail)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0602
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0602
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.2
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.3
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.4
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.5
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.7
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.9
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_2 z:\testdata\configs\WapStackSuite.ini Test_2.10
+END_TESTCASE			WAP-WAPMESSAGE-0602
+
+// ---------------------------------------------------------------------------------
+// TEST(3) Unconnected
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0603
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0603
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_3 z:\testdata\configs\WapStackSuite.ini Test_3
+END_TESTCASE			WAP-WAPMESSAGE-0603
+
+// ---------------------------------------------------------------------------------
+// TEST(4) Normal condition/Multiple receive
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0604
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0604
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.2.1
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.2.2
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.2.3
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.2.4
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.2.5
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.2.6
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.2.7
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_4 z:\testdata\configs\WapStackSuite.ini Test_4.2.8
+END_TESTCASE			WAP-WAPMESSAGE-0604
+
+// ---------------------------------------------------------------------------------
+// TEST(5) Cancel
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0605
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0605
+//RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_5 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0605
+
+// ---------------------------------------------------------------------------------
+// TEST(6) Timeout
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0606
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0606
+//RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_6 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0606
+
+// ---------------------------------------------------------------------------------
+// TEST(7) Wrong sequence
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0607
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0607
+RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_7 z:\testdata\configs\WapStackSuite.ini Test_7.1
+END_TESTCASE			WAP-WAPMESSAGE-0607
+
+// ---------------------------------------------------------------------------------
+// TEST(8) API low/high in parameter
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0608
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0608
+//RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_8 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0608
+
+// ---------------------------------------------------------------------------------
+// TEST(9)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0609
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0609
+//RUN_TEST_STEP 100 WapStackSuite FullySpecWDP_9 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0609
+
+PRINT GT167-WAP stack FULLY_SPECIFIED-WDP test finished
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/scripts/WapFullySpecWSP.script	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,105 @@
+// Copyright (c) 2001-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:
+// WAP stack FullySpecWSP test script file
+// 
+//
+
+PRINT GT167-WAP stack FULLY-SPECIFIED-WSP test
+
+LOAD_SUITE WapStackSuite
+
+// ---------------------------------------------------------------------------------
+// TEST(1) Load implementation
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0701
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0701
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_1 z:\testdata\configs\WapStackSuite.ini COMMON
+END_TESTCASE			WAP-WAPMESSAGE-0701
+
+// ---------------------------------------------------------------------------------
+// TEST(2) Connect using different bearers (tests 1.7, 1.8, 1.9, 1.10 must fail)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0702
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0702
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.1
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.2
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.3
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.4
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.5
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.7
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.8
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.9
+// Reconnect
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_2 z:\testdata\configs\WapStackSuite.ini Test_2.10
+END_TESTCASE			WAP-WAPMESSAGE-0702
+
+// ---------------------------------------------------------------------------------
+// TEST(3) Unconnected
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0703
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0703
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_3 z:\testdata\configs\WapStackSuite.ini Test_3
+END_TESTCASE			WAP-WAPMESSAGE-0703
+
+// ---------------------------------------------------------------------------------
+// TEST(4) Normal condition/Multiple receive
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0704
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0704
+//RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_4 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0704
+
+// ---------------------------------------------------------------------------------
+// TEST(5) Cancel
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0705
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0705
+//RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_5 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0705
+
+// ---------------------------------------------------------------------------------
+// TEST(6) Timeout
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0706
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0706
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_6 z:\testdata\configs\WapStackSuite.ini Test_6.1
+END_TESTCASE			WAP-WAPMESSAGE-0706
+
+// ---------------------------------------------------------------------------------
+// TEST(7) Wrong sequence
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0707
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0707
+RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_7 z:\testdata\configs\WapStackSuite.ini Test_7.1
+END_TESTCASE			WAP-WAPMESSAGE-0707
+
+// ---------------------------------------------------------------------------------
+// TEST(8) API low/high in parameter
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0708
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0708
+//RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_8 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0708
+
+// ---------------------------------------------------------------------------------
+// TEST(9)
+// ---------------------------------------------------------------------------------
+START_TESTCASE			WAP-WAPMESSAGE-0709
+//! @SYMTestCaseID		WAP-WAPMESSAGE-0709
+//RUN_TEST_STEP 100 WapStackSuite FullySpecWSP_9 z:\testdata\configs\WapStackSuite.ini
+END_TESTCASE			WAP-WAPMESSAGE-0709
+
+PRINT GT167-WAP stack FULLY-SPECIFIED-WSP test finished
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapBoundCLPushSteps.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,896 @@
+// 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:
+// CBoundCLPushStep_xyz derived implementations
+// 
+//
+
+/**
+ @file
+ @internalComponent
+*/
+
+#include "WapBoundCLPushSteps.h"
+#include "WapStackSuiteDefs.h"
+#include <simtsy.h>
+#include <wapmsgerr.h>
+#include <ecom/ecom.h>
+
+
+CBoundCLPushStepBase::CBoundCLPushStepBase()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundCLPushStepBase::~CBoundCLPushStepBase()
+/**
+* Destructor
+*/
+	{
+	if(iImp) 
+		{
+		UnloadInterface();
+		}
+	}
+
+// Load CWapBoundCLPushService Interface 
+CWapBoundCLPushService* CBoundCLPushStepBase::LoadInterface()
+	{
+	TInt trapValue;
+	CWapBoundCLPushService* implementation = NULL;
+	// UID {0x101FBB39} - SWS implementation
+	TUid KInterfaceUid = {0x101FBB39}; 	
+	INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), KInterfaceUid);
+	TRAP(trapValue, implementation = CWapBoundCLPushService::NewL(KInterfaceUid));
+	if(!trapValue)
+		{
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), implementation);
+		return implementation;
+		}
+	else return NULL;
+	}
+
+void CBoundCLPushStepBase::UnloadInterface()
+	{
+	INFO_PRINTF2(_L("Interface at implementation.addr = 0x%08x is deleted"), iImp);
+	delete iImp;
+	iImp = NULL;
+	REComSession::FinalClose();
+	}
+
+CBoundCLPushStep_1::~CBoundCLPushStep_1()
+/**
+* Destructor
+*/
+	{
+	}
+
+CBoundCLPushStep_1::CBoundCLPushStep_1()
+/**
+* Constructor
+*/
+	{
+	}
+
+TVerdict CBoundCLPushStep_1::doTestStepL()
+/**
+* @return - TVerdict code
+* Override of base class pure virtual
+* Our implementation only gets called if the base class doTestStepPreambleL() did
+* not leave. That being the case, the current test result value will be EPass.
+*/
+	{
+	//
+	// CWapBoundCLPushService
+	// 
+	INFO_PRINTF1(_L("CreateImplementation - CWapBoundCLPushService"));
+	INFO_PRINTF1(_L("Calling old NewL() method"));
+	
+	TInt trapValue; 
+	
+	SetTestStepResult(EFail);
+	TRAP(trapValue, iImp = CWapBoundCLPushService::NewL());
+	if(!trapValue)
+		{
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), iImp);
+		UnloadInterface();
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			INFO_PRINTF1(_L("CreateImplementation - OK"));
+			SetTestStepResult(EPass);
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+CBoundCLPushStep_2::CBoundCLPushStep_2()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundCLPushStep_2::~CBoundCLPushStep_2() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundCLPushStep_2::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("BOUNDCL-PUSH: Testing Connect"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer, port;
+			TInt error	= KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect= EFalse;
+			SetLastError(KErrNone);
+			TBool delay = EFalse;
+			
+			if(GetIntFromConfig(ConfigSection(), KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(), KWapLocalPort, port)) iLocalPort = (Wap::TPort)port;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+			if(GetBoolFromConfig(ConfigSection(),KWapDelayPortClosure, delay)) iDelayPortClosure = delay;
+
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(), KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				}
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+
+			StartScheduler();
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundCLPushStep_2::CallStateMachine()
+	{
+	TInt err = KErrNone;
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iBearer, (Wap::TPort)iLocalPort, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				if(iReconnect)
+					{ 
+					INFO_PRINTF1(_L("Second connect"));
+					iControl->ReStart();
+					break;
+					}
+				}
+			SetState(EFinish);
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+			
+		case EFinish:
+			// it's necessary to delay port closure, let the other concurrent test step
+			// can fail opening the same port with expected error EPortAlreadyBound (-5498)
+			if (iDelayPortClosure)
+				User::After(5000000);
+
+			INFO_PRINTF1(_L("EFinish"));
+			if(GetLastError() == GetExpectedError()) 
+				SetTestStepResult(EPass);
+			else 
+				SetTestStepResult(EFail);
+			SetState(EIdle); 
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+CBoundCLPushStep_3::CBoundCLPushStep_3()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundCLPushStep_3::~CBoundCLPushStep_3() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundCLPushStep_3::doTestStepL()
+/*
+* Test the BoundCLPush APIs in unconnected state.
+*/
+	{
+	INFO_PRINTF1(_L("BoundCLPush. Requests without connection"));
+	// check preamble result
+	TVerdict verdict = TestStepResult();
+	if (verdict==EPass)
+		{
+		TInt err, ret;
+		iImp = LoadInterface();
+		if (!iImp)
+			{
+			ERR_PRINTF1(_L("Unable to load BoundCLPush Interface"));
+			verdict = EFail;
+			}
+		else
+			{
+			GetIntFromConfig(ConfigSection(),KWapExError,(TInt&)iExError);
+			ShowConnectionInfo();
+			TRequestStatus reqStatus;
+			iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, reqStatus);
+			TRAP(ret, TEST_CHECKL(reqStatus.Int(), iExError, _L("AwaitPush Fails not as expected")))
+				if (ret) 
+					verdict = EFail;
+				else
+					{
+					Wap::TPort port;
+					err=iImp->GetLocalPort(port);
+					TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalPort Fails not as expected")))
+						if (ret)
+							verdict = EFail;
+						else
+							{
+							HBufC8* localHost;					
+							err=iImp->GetLocalAddress(localHost);
+							TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalAddress Fails not as expected")))
+								if (ret) 
+									verdict = EFail;
+								else
+									{
+									err=iImp->GetBearer(iBearer);
+									TRAP(ret, TEST_CHECKL(err, iExError, _L("GetBearer Fails not as expected")))
+										if (ret) 
+											verdict = EFail;
+										else
+											{
+											HBufC8* host;
+											err=iImp->GetServerAddress(host);
+											TRAP(ret, TEST_CHECKL(err, iExError, _L("GetServerAddress Fails not as expected")))
+												if (ret) 
+													verdict = EFail;
+											}
+									}
+							}
+					}
+				UnloadInterface();
+			}
+		}
+	if (verdict==EPass)
+		{
+		INFO_PRINTF1(_L("BoundCLPush. Requests Fail as expected"));
+		}
+	SetTestStepResult(verdict);
+	return TestStepResult();
+	}
+
+TInt CBoundCLPushStep_3::CallStateMachine()
+	{
+	return (0);
+	}
+
+
+CBoundCLPushStep_4::CBoundCLPushStep_4()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundCLPushStep_4::~CBoundCLPushStep_4() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundCLPushStep_4::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-CLPUSH: Connect-AwaitPush"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			
+			TInt bearer, port;
+			TInt error = KErrNone;
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) 
+				{
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			GetBoolFromConfig(ConfigSection(), KMiddleCancel, iMiddleCancel);
+			GetBoolFromConfig(ConfigSection(), KMultiReadCancel, iMultiReadCancel);
+			TInt headerLength, bufLength; 
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvHeaderLength, headerLength))
+				{
+				iHeaderRecvBufLength=static_cast<TUint16>(headerLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvBodyLength, bufLength))
+				{
+				iBodyRecvBufLength=static_cast<TUint16>(bufLength);
+				}
+			iRecvHeaders = HBufC8::NewL(iHeaderRecvBufLength);
+			iRecvBody = HBufC8::NewL(iBodyRecvBufLength);
+
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+			
+
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(),KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				}
+
+						
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+
+			StartScheduler();
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundCLPushStep_4::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	
+	INFO_PRINTF2(_L("CallStateMachine:  state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iBearer, iLocalPort, EFalse);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				if(iBearer != Wap::EIP)
+					{
+					TRAP(err, WaitForInitializeL());
+					}
+				iRecvHeadersBuf.Set(iRecvHeaders->Des());
+				iRecvBodyBuf.Set(iRecvBody->Des());
+				iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, *iStatus);
+				INFO_PRINTF1(_L("Start AwaitingPush....."));
+				activate = 1;
+				if (!iMiddleCancel)
+					{
+					SetState(EAwaitPush);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Cancel AwaitPush"));
+					iImp->CancelAwaitPush();
+					SetState(EFinish);
+					}
+				}
+			else 
+				{
+				SetState(EFinish);
+				iControl->ReStart();
+				}
+			SetLastError(err);
+			break;
+			
+		case EAwaitPush:
+			
+			INFO_PRINTF1(_L("EAwaitPush"));
+			if(iStatus->Int() != KErrNone && iStatus->Int()!=Wap::EMoreData) 
+				// AwaitPush failed
+				{
+				INFO_PRINTF1(_L("AwaitPush failed"));
+				SetLastError(iStatus->Int());
+				SetState(EFinish);
+				iControl->ReStart();
+				}
+			else
+				{
+				iMaxWspHeaderRecvBuffer.Append(iRecvHeadersBuf);
+				iMaxWspDataRecvBuffer.Append(iRecvBodyBuf);
+				if (iStatus->Int()==Wap::EMoreData)
+					{
+					iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, *iStatus);
+					activate = 1;
+					if (!iMultiReadCancel)
+						{
+						SetState(EAwaitPush);
+						}
+					else
+						{
+						INFO_PRINTF1(_L("Cancel Receive in EMutipleReceive state"));
+						iImp->CancelAwaitPush();
+						SetState(EFinish);
+						}					
+					}
+				else
+					{
+					SetLastError(iStatus->Int());
+					iControl->ReStart();
+					SetState(EFinish);
+					}
+				}
+			break;
+			
+		case EFinish:
+			
+			INFO_PRINTF1(_L("EFinish"));
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			if (verdict==EPass && !iMiddleCancel && !iMultiReadCancel)
+				{
+				iImp->CancelAwaitPush();
+				INFO_PRINTF1(_L("Headers:"));
+				DumpBuf(iMaxWspHeaderRecvBuffer);
+				INFO_PRINTF1(_L("Body"));
+				DumpBuf(iMaxWspDataRecvBuffer);
+				if (verdict==EPass)
+					{
+					HBufC8* buf;
+					iImp->GetServerAddress(buf);
+					verdict = (buf->Match(iRemoteHost)!=KErrNotFound)?EPass:EFail;
+					delete buf;
+					}
+				if (verdict==EPass)
+					{
+					Wap::TPort port;
+					iImp->GetLocalPort(port);
+					verdict = (port == iLocalPort)?EPass:EFail;
+					}
+				if (verdict==EPass)
+					{
+					Wap::TBearer bearer;
+					iImp->GetBearer(bearer);
+					verdict = (bearer == iBearer)?EPass:EFail;
+					}
+				if (verdict==EPass)
+					{
+					//This test can not perform.
+					HBufC8* buf;
+					iImp->GetLocalAddress(buf);
+					delete buf;
+					}
+				}
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			
+			break;
+		}
+		return (activate);
+}
+
+CBoundCLPushStep_5::CBoundCLPushStep_5()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundCLPushStep_5::~CBoundCLPushStep_5() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundCLPushStep_5::doTestStepL()
+/** 
+* Test Cancel 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("BOUNDCL-PUSH: Testing Cancel"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer, port;
+			TInt error	= KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect= EFalse;
+			SetLastError(KErrNone);
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) iLocalPort = (Wap::TPort)port;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+			
+			ShowConnectionInfo();
+			error = iImp->Connect(iBearer, iLocalPort, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), error);
+			if( error == KErrNone)
+				{
+				TBuf8<100> header, body;
+				TPckgBuf<TUint8> pushIdPckg;
+				TRequestStatus reqStatus;
+				iImp->AwaitPush(header, body, pushIdPckg, reqStatus);
+				SetState(EAwaitPush);
+				StartScheduler();
+				iControl->ReStart();
+				if(reqStatus==KErrCancel)
+					{
+					SetTestStepResult(EPass);
+					}
+				}
+			
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundCLPushStep_5::CallStateMachine()
+	{
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EAwaitPush:
+			INFO_PRINTF1(_L("EAwaitPush"));
+			iImp->CancelAwaitPush();
+			SetState(EFinish);
+			iControl->ReStart();
+			break;
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			SetState(EIdle);
+			StopScheduler();
+			break;
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+
+CBoundCLPushStep_6::CBoundCLPushStep_6() 
+	{
+	}
+CBoundCLPushStep_6::~CBoundCLPushStep_6() 
+	{
+	}
+TVerdict CBoundCLPushStep_6::doTestStepL()
+	{
+	return TestStepResult();
+	}
+TInt CBoundCLPushStep_6::CallStateMachine()
+	{
+	return (0);
+	}
+
+CBoundCLPushStep_7::CBoundCLPushStep_7() 
+	{
+	}
+CBoundCLPushStep_7::~CBoundCLPushStep_7() 
+	{
+	}
+TVerdict CBoundCLPushStep_7::doTestStepL()
+	{
+	INFO_PRINTF1(_L("BOUND-CLPUSH: Connect-AwaitPush-AwaitPush"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			
+			TInt bearer, port;
+			TInt error = KErrNone;
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) 
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) 
+				{
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error)) 
+				{
+				SetExpectedError(error);
+				}
+			TInt headerLength, bufLength; 
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvHeaderLength, headerLength))
+				{
+				iHeaderRecvBufLength=static_cast<TUint16>(headerLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvBodyLength, bufLength))
+				{
+				iBodyRecvBufLength=static_cast<TUint16>(bufLength);
+				}
+			iRecvHeaders = HBufC8::NewL(iHeaderRecvBufLength);
+			iRecvBody = HBufC8::NewL(iBodyRecvBufLength);
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+
+			StartScheduler();
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+TInt CBoundCLPushStep_7::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iBearer, iLocalPort, EFalse);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				iRecvHeadersBuf.Set(iRecvHeaders->Des());
+				iRecvBodyBuf.Set(iRecvBody->Des());
+				TRequestStatus reqStatus;
+				iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, reqStatus);
+				iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, *iStatus);
+				INFO_PRINTF1(_L("AwaitPush"));
+				activate = 1;
+				}
+			else
+				{
+				iControl->ReStart();
+				}
+			SetLastError(err);
+			SetState(EFinish);
+			break;
+			
+		case EFinish:
+			
+			INFO_PRINTF1(_L("EFinish"));
+			iImp->CancelAwaitPush();
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state [%d]"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			break;
+		}
+	return (activate);
+	}
+
+CBoundCLPushStep_8::CBoundCLPushStep_8() 
+	{
+	}
+CBoundCLPushStep_8::~CBoundCLPushStep_8() 
+	{
+	}
+TVerdict CBoundCLPushStep_8::doTestStepL()
+/**
+*	@return - TVerdict code
+*	Wrong parameter values for Bound CL Push API:
+*	- Wrong TUid on construction
+*	- Connect to wrong bearer (already implemented in test 2)
+*/
+	{
+	INFO_PRINTF1(_L("CreateImplementation with wrong Uid- CWapBoundCLPushService"));
+	if(TestStepResult() == EPass )
+		{
+		TInt error;
+		if(GetIntFromConfig(ConfigSection(),KWapExError2, error))
+			{
+			iExError2=error;
+			}
+		TInt trapValue;
+		
+		TUid invalidInterfaceUid = {0x00000000}; 
+		
+		INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), invalidInterfaceUid);
+		TRAP(trapValue, iImp = CWapBoundCLPushService::NewL(invalidInterfaceUid));
+		TVerdict verdict = (trapValue == iExError2)?EPass:EFail;
+		if (verdict==EPass)
+			{
+			INFO_PRINTF2(_L("CreateImplementation with wrong Uid- Failed as expected with error %d"),trapValue);
+			}
+		SetTestStepResult(verdict);
+		}
+	return TestStepResult();
+	}
+TInt CBoundCLPushStep_8::CallStateMachine()
+	{
+	return (0);
+	}
+
+CBoundCLPushStep_9::CBoundCLPushStep_9() 
+	{
+	}
+CBoundCLPushStep_9::~CBoundCLPushStep_9() 
+	{
+	}
+TVerdict CBoundCLPushStep_9::doTestStepL()
+	{
+	INFO_PRINTF1(_L("BOUND-CLPUSH: Sending Push Message"));
+	if(TestStepResult() == EPass )
+		{
+		User::After(20000000);
+		SetTestStepResult(EFail);
+		SetLastError(KErrNone);
+		TInt error = KErrNone;
+		/**
+		Getting information from config file
+		Local port
+		Remote port
+		Local address
+		Remote address
+		*/
+		GetIntFromConfig(ConfigSection(),KLocalPort, iLclPort);
+		GetIntFromConfig(ConfigSection(),KRemotePort, iRmtPort);
+		TPtrC temp;
+		if(GetStringFromConfig(ConfigSection(),KWapLocalHost, temp))
+			{
+			error = iLocalAddr.Input(temp);
+			if(error)
+				{
+				User::Leave(error);
+				}
+			}
+		if(GetStringFromConfig(ConfigSection(),KWapRemoteHost, temp ))
+			{
+			error = iRemoteAddr.Input(temp);
+			if(error)
+				{
+				User::Leave(error);
+				}
+			}
+//		error = GetStringFromConfig(ConfigSection(),KWapData, temp);
+
+		RFs fS;
+		RFile file;
+		User::LeaveIfError(fS.Connect());
+		_LIT(KPduFilename,"z:\\testdata\\configs\\pushpdu.bin");
+		User::LeaveIfError(file.Open(fS, KPduFilename , EFileStream | EFileRead));
+		/* Read PDU from the file */
+
+		iSendBuffPtr = HBufC8::NewL(1024);
+		TPtr8 tmpbuf = iSendBuffPtr->Des();
+		User::LeaveIfError(file.Read(tmpbuf));
+
+		file.Close();
+		fS.Close();
+		/**
+		Settings
+		*/
+		iLocalAddr.SetPort(iLclPort);
+		iRemoteAddr.SetPort(iRmtPort);
+//		iSendBuffPtr = HBufC8::NewL(temp.Length());
+//		TPtr8 tmp = iSendBuffPtr->Des();
+//		tmp.Copy(temp);
+
+		/**
+		socket server 
+		*/
+		RSocketServ socketServer;
+	    User::LeaveIfError(socketServer.Connect());
+		CleanupClosePushL(socketServer);
+		RSocket sock;
+		User::LeaveIfError(sock.Open(socketServer, KAfInet, KSockDatagram, KProtocolInetUdp));
+		CleanupClosePushL(sock);
+		TRequestStatus status;
+		sock.SendTo(iSendBuffPtr->Des(),iRemoteAddr , 0, status);
+		User::WaitForRequest(status);
+		INFO_PRINTF2(_L("Send Push Message - status = %d"), status.Int());
+		User::LeaveIfError(status.Int());
+		sock.Close();
+		socketServer.Close();
+		CleanupStack::PopAndDestroy(&sock);
+		CleanupStack::Pop(&socketServer);
+		TVerdict verdict = (status.Int() == KErrNone)?EPass:EFail;
+		SetTestStepResult(verdict);
+		}
+	return TestStepResult();
+	}
+TInt CBoundCLPushStep_9::CallStateMachine()
+	{
+			return (0);
+	}
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapBoundCLPushSteps.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,143 @@
+/**
+* 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:
+*
+*/
+
+
+
+/**
+ @file WapBoundCLPushSteps.h
+*/
+#if (!defined __BOUNDCLPUSH_STEP_H__)
+#define __BOUNDCLPUSH_STEP_H__
+#include <test/testexecutestepbase.h>
+#include <in_sock.h>
+#include <es_sock.h>
+#include <wapmessage.h>
+#include "WapStackSuiteStepBase.h"
+
+_LIT(KBoundCLPushStep_1,"BoundCLPush_1");
+_LIT(KBoundCLPushStep_2,"BoundCLPush_2");
+_LIT(KBoundCLPushStep_3,"BoundCLPush_3");
+_LIT(KBoundCLPushStep_4,"BoundCLPush_4");
+_LIT(KBoundCLPushStep_5,"BoundCLPush_5");
+_LIT(KBoundCLPushStep_6,"BoundCLPush_6");
+_LIT(KBoundCLPushStep_7,"BoundCLPush_7");
+_LIT(KBoundCLPushStep_8,"BoundCLPush_8");
+_LIT(KBoundCLPushStep_9,"BoundCLPush_9");
+
+
+class CBoundCLPushStepBase : public CWapStackSuiteStepBase
+{
+public:
+	CBoundCLPushStepBase();
+	~CBoundCLPushStepBase();
+	CWapBoundCLPushService* LoadInterface();
+	void UnloadInterface();
+protected:
+	CWapBoundCLPushService* iImp;
+};
+
+class CBoundCLPushStep_1 : public CBoundCLPushStepBase
+	{
+public:
+	CBoundCLPushStep_1();
+	~CBoundCLPushStep_1();
+	virtual TVerdict doTestStepL();
+private:
+	};
+
+class CBoundCLPushStep_2 : public CBoundCLPushStepBase
+	{
+public:
+	CBoundCLPushStep_2();
+	~CBoundCLPushStep_2();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundCLPushStep_3 : public CBoundCLPushStepBase
+	{
+public:
+	CBoundCLPushStep_3();
+	~CBoundCLPushStep_3();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundCLPushStep_4 : public CBoundCLPushStepBase
+	{
+public:
+	CBoundCLPushStep_4();
+	~CBoundCLPushStep_4();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundCLPushStep_5 : public CBoundCLPushStepBase
+	{
+public:
+	CBoundCLPushStep_5();
+	~CBoundCLPushStep_5();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundCLPushStep_6 : public CBoundCLPushStepBase
+	{
+public:
+	CBoundCLPushStep_6();
+	~CBoundCLPushStep_6();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundCLPushStep_7 : public CBoundCLPushStepBase
+	{
+public:
+	CBoundCLPushStep_7();
+	~CBoundCLPushStep_7();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundCLPushStep_8 : public CBoundCLPushStepBase
+	{
+public:
+	CBoundCLPushStep_8();
+	~CBoundCLPushStep_8();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundCLPushStep_9 : public CBoundCLPushStepBase
+	{
+public:
+	CBoundCLPushStep_9();
+	~CBoundCLPushStep_9();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapBoundWDPSteps.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,1014 @@
+// 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:
+// CStepOne derived implementation
+// 
+//
+
+/**
+ @file
+ @internalComponent 
+*/
+
+#include <e32base.h>
+#include <sacls.h>
+
+#include "WapBoundWDPSteps.h"
+#include "WapStackSuiteDefs.h"
+#include <etel.h>
+#include <es_wsms.h>
+#include <simtsy.h>
+#include <wapmsgerr.h>
+#include <ecom/ecom.h>
+
+CBoundWDPStepBase::CBoundWDPStepBase()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWDPStepBase::~CBoundWDPStepBase()
+/**
+* Destructor
+*/
+	{
+	if(iImp) 
+		{
+		UnloadInterface();
+		}
+	}
+
+// Load CWapBoundDatagramService Interface 
+CWapBoundDatagramService* CBoundWDPStepBase::LoadInterface()
+	{
+	TInt trapValue;
+	CWapBoundDatagramService* implementation = NULL;
+	// UID {0x101FBB37} - SWS implementation
+	TUid KInterfaceUid = {0x101FBB37}; 	
+	INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), KInterfaceUid);
+	TRAP(trapValue, implementation = CWapBoundDatagramService::NewL(KInterfaceUid));
+	if(!trapValue)
+		{
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), implementation);
+		return implementation;
+		}
+	else return NULL;
+	}
+
+void CBoundWDPStepBase::UnloadInterface()
+	{
+	INFO_PRINTF2(_L("Interface at implementation.addr = 0x%08x is deleted"), iImp);
+	delete iImp;
+	iImp = NULL;
+	REComSession::FinalClose();	
+	}
+
+CBoundWDPStep_1::CBoundWDPStep_1()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWDPStep_1::~CBoundWDPStep_1() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundWDPStep_1::doTestStepL()
+/** 
+* Load and destroy BoundDatagtamService interface implementation
+* Two different methods are used NewL() and NewL(TUid InterfaceUid)
+* @return - TVerdict code
+*/
+	{
+	// CWapBoundDatagramService
+	INFO_PRINTF1(_L("CreateImplementation - CWapBoundDatagramService"));
+	INFO_PRINTF1(_L("Calling old NewL() method"));
+	
+	SetTestStepResult(EFail);
+
+	TInt trapValue(0); 
+	TRAP(trapValue, iImp = CWapBoundDatagramService::NewL());
+	if(!trapValue)
+		{
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), iImp);
+		UnloadInterface();
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			INFO_PRINTF1(_L("CreateImplementation - OK"));
+			SetTestStepResult(EPass);
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+CBoundWDPStep_2::CBoundWDPStep_2()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWDPStep_2::~CBoundWDPStep_2()
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundWDPStep_2::doTestStepL()
+/**
+* Test Connect methoths
+* @return - TVerdict code
+*
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-WDP: Connect"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer, port;
+			TInt error = KErrNone;
+			TBool reconnect = EFalse;
+			TBool delay = EFalse;
+
+			SetLastError(KErrNone);
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) iLocalPort = (Wap::TPort)port;
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(),KWapReconnect, reconnect)) iReconnect = reconnect;
+			if(GetBoolFromConfig(ConfigSection(),KWapDelayPortClosure, delay)) iDelayPortClosure = delay;
+			
+			TInt checkValue = 0;
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(), KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				// double check that base did set it since this is the first place we try setting it in the harness
+				RProperty::Get(KUidPSSimTsyCategory, KPSSimTsyTestNumber, checkValue);
+				__ASSERT_ALWAYS(checkValue == iSimTsyState,User::Panic(KWapStackSuitePanic, EDataCorrupt));
+				} 
+			
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+			// double check
+			RProperty::Get(KUidSystemCategory, KUidPhonePwr.iUid, checkValue);
+			__ASSERT_ALWAYS(checkValue == ESAPhoneOn,User::Panic(KWapStackSuitePanic, EDataCorrupt));
+
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			// Start state machine
+			StartScheduler();
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundWDPStep_2::CallStateMachine()
+	{
+	TInt err = KErrNone;
+	INFO_PRINTF2(_L("CallStateMachine: step [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iBearer, iLocalPort);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				if(iReconnect)
+					{
+					INFO_PRINTF1(_L("Second connect"));
+					iControl->ReStart();
+					break;
+					}
+				}
+			SetState(EFinish);
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+
+		case EFinish:
+			// it's necessary to delay port closure, let the other concurrent test step
+			// can fail opening the same port with expected error EPortAlreadyBound (-5498)
+			if (iDelayPortClosure)
+				User::After(5000000);
+
+			INFO_PRINTF1(_L("EFinish"));
+			if(GetLastError() == GetExpectedError()) SetTestStepResult(EPass);
+			else SetTestStepResult(EFail);
+			SetState(EIdle);
+			// End of state machine
+			StopScheduler();
+			break;
+
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: bad state EIdle or unknown [%d]"), State());
+			SetTestStepResult(EFail);
+			// End of state machine
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+
+CBoundWDPStep_3::CBoundWDPStep_3() 
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWDPStep_3::~CBoundWDPStep_3() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundWDPStep_3::doTestStepL()
+/*
+* Test the CBoundWDP APIs in unconnected state.
+*/
+	{
+	INFO_PRINTF1(_L("BoundWDP. Requests without connection"));
+	// check preamble result
+	TVerdict verdict = TestStepResult();
+	if (verdict==EPass)
+		{
+		TInt err, ret;
+		iImp = LoadInterface();
+		if (!iImp)
+			{
+			ERR_PRINTF1(_L("Unable to load BoundWDP Interface"));
+			verdict = EFail;
+			}
+		else
+			{
+			GetIntFromConfig(ConfigSection(),KWapExError,(TInt&)iExError);
+			ShowConnectionInfo();
+			TBuf8<100> buf;
+			err = iImp->SendTo(iRemoteHost, iRemotePort, buf, iBearer);
+			TRAP(ret, TEST_CHECKL(err, iExError, _L("SendTo Fails not as expected")))
+			if (ret) 
+				{
+				verdict = EFail;
+				}
+			else
+				{
+				TPckg<TUint16> aDataSizePckg(0);
+				TRequestStatus reqStatus;
+				iImp->AwaitRecvDataSize(aDataSizePckg, reqStatus);
+				User::WaitForRequest(reqStatus);
+				TRAP(ret, TEST_CHECKL(reqStatus.Int(), iExError, _L("AwaitRecvDataSize Fails not as expected")))
+				if (ret) 
+					{
+					verdict = EFail;
+					}
+				else
+					{
+					TBuf8<100> buf;
+					TBool truncated;
+					TUint32 timeout=0;
+					iImp->RecvFrom(iRecvRemoteHost, iRecvRemotePort, buf, truncated, reqStatus, timeout);
+					User::WaitForRequest(reqStatus);
+					TRAP(ret, TEST_CHECKL(reqStatus.Int(), iExError, _L("RecvFrom Fails not as expected")))
+					if (ret) 
+						{
+						verdict = EFail;
+						}
+					else
+						{
+						Wap::TPort aPort;
+						err=iImp->GetLocalPort(aPort);
+						TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalPort Fails not as expected")))
+						if (ret) 
+							{
+							verdict = EFail;
+							}
+						else
+							{
+							HBufC8* localHost;
+							err=iImp->GetLocalAddress(localHost);
+							TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalAddress Fails not as expected")))
+							if (ret) 
+								{
+								verdict = EFail;
+								}
+							else
+								{
+								TUint16 maxSize, nominalSize;
+								err=iImp->GetDatagramSizes(maxSize, nominalSize);
+								if (err)
+									{
+									verdict = EFail;
+									}
+								else
+									{
+									err=iImp->GetBearer(iBearer);
+									TRAP(ret, TEST_CHECKL(err, iExError, _L("GetBearer Fails not as expected")))
+									if (ret)
+										{
+										verdict = EFail;
+										}
+									}
+								}
+							}
+						}
+					}
+				}
+			UnloadInterface();
+			}
+		}
+	if (verdict==EPass)
+		{
+		INFO_PRINTF1(_L("BoundWDP. Requests Fail as expected"));
+		}
+	SetTestStepResult(verdict);
+	return TestStepResult();
+	}
+
+TInt CBoundWDPStep_3::CallStateMachine()
+	{
+	return (0);
+	}
+
+
+CBoundWDPStep_4::CBoundWDPStep_4() 
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWDPStep_4::~CBoundWDPStep_4() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundWDPStep_4::doTestStepL()
+/** 
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-WDP: Connect-Send-Await-Receive"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+
+			TInt bearer, port, bufLen;
+			TInt error = KErrNone;
+			TPtrC data, remote_host;
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port))
+				{
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetStringFromConfig(ConfigSection(), KWapRemoteHost, remote_host))
+				{
+				iRemoteHost.Copy(remote_host);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapRemotePort, port))
+				{
+				iRemotePort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			GetIntFromConfig(ConfigSection(), KWapExError2, iExError2);
+			GetBoolFromConfig(ConfigSection(), KAwaitLengthCancel, iAwaitLengthCancel);
+			GetBoolFromConfig(ConfigSection(), KMiddleCancel, iMiddleCancel);
+			GetBoolFromConfig(ConfigSection(), KMultiReadCancel, iMultiReadCancel);
+			GetBoolFromConfig(ConfigSection(), KAwaitLengthTwice, iAwaitLengthTwice);
+			if(GetIntFromConfig(ConfigSection(),KWapWdpBufLength, bufLen))
+				{
+				iWdpRecvBufLength=static_cast<TUint16>(bufLen);
+				iRecvBuffPtr = HBufC8::NewL(iWdpRecvBufLength);
+				}
+			error = GetStringFromConfig(ConfigSection(),KWapData, data);
+			if(!error)
+				{
+				User::Leave(error);
+				}
+			iSendBuffPtr = HBufC8::NewL(data.Length());
+			TPtr8 tmp = iSendBuffPtr->Des();
+			tmp.Copy(data);
+			
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(), KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				}
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+					
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			// Start state machine
+			StartScheduler(); 
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundWDPStep_4::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iBearer, iLocalPort);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+					if(iBearer != Wap::EIP)
+						{
+						TRAP(err, WaitForInitializeL());
+						}
+					if(iSendBuffPtr->Length())
+						{
+						INFO_PRINTF1(_L("Data to send"));
+						DumpBuf(iSendBuffPtr->Des());
+						}
+				err = iImp->SendTo(iRemoteHost, iRemotePort, iSendBuffPtr->Des(), iBearer);
+				INFO_PRINTF2(_L("SendTo completed with code = %d"), err);
+				if(err == KErrNone) 
+					{	
+					SetState(EAwaitSize);
+					}
+				else 
+					{	
+					SetState(EFinish);
+					}
+				}
+			else 
+				{
+				SetState(EFinish);
+				}
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+			
+		case EAwaitSize:
+			INFO_PRINTF1(_L("EAwaitSize"));
+			iImp->AwaitRecvDataSize(iLength, *iStatus);
+			activate = 1;
+			if (!iAwaitLengthCancel)
+				{
+				SetState(EReceive);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("Cancel Receive in AwaitSize state"));
+				iImp->CancelRecv();
+				SetState(EFinish);
+				}
+			break;
+			
+		case EReceive:
+			INFO_PRINTF1(_L("EReceive"));
+			if(iStatus->Int()!=KErrNone) 
+				// AwaitSize failed
+				{
+				INFO_PRINTF1(_L("AwaitSize failed"));
+				SetLastError(iStatus->Int());
+				iControl->ReStart();
+				SetState(EFinish);
+				}
+			else
+				{	
+				INFO_PRINTF2(_L("AwaitSize returned - %d"),iLength());
+				if (!iAwaitLengthTwice)
+					{
+					if (iRecvBuffPtr==NULL)
+						{
+						TInt len=iLength();
+						TRAP(err, iRecvBuffPtr = HBufC8::NewL(len))
+							if (err!=KErrNone)
+								{
+								SetLastError(err);
+								iControl->ReStart();
+								SetState(EFinish);
+								break;
+								}
+						}
+					iRecvBuf.Set(iRecvBuffPtr->Des());
+					iImp->RecvFrom(iRecvRemoteHost, iRecvRemotePort, iRecvBuf, iTruncated, *iStatus, 0);
+					activate = 1;
+					if (!iMiddleCancel)
+						{
+						SetState(EMutipleReceive);
+						}
+					else
+						{
+						INFO_PRINTF1(_L("Cancel Receive in Receive state"));
+						iImp->CancelRecv();
+						SetState(EFinish);
+						}
+					}
+				else
+					{
+					iImp->AwaitRecvDataSize(iLength, *iStatus);
+					activate = 1;
+					SetState(EFinish);
+					}
+				}
+			break;
+			
+		case EMutipleReceive:
+			INFO_PRINTF1(_L("EMultipleReceive"));
+			if (iStatus->Int()!=KErrNone && iStatus->Int()!=Wap::EMoreData)
+				{
+				INFO_PRINTF1(_L("Receive failed"));
+				SetLastError(iStatus->Int());
+				iControl->ReStart();
+				SetState(EFinish);
+				}
+			else
+				{
+				iMaxWdpRecvBuffer.Append(iRecvBuf);
+				if (iTruncated)
+					{
+					iImp->RecvFrom(iRecvRemoteHost, iRecvRemotePort, iRecvBuf, iTruncated, *iStatus, 0);
+					activate = 1;
+					if (!iMultiReadCancel)
+						{
+						SetState(EMutipleReceive);
+						}
+					else
+						{
+						INFO_PRINTF1(_L("Cancel Receive in EMutipleReceive state"));
+						iImp->CancelRecv();
+						SetState(EFinish);
+						}					
+					}
+				else
+					{
+					SetLastError(iStatus->Int());
+					iControl->ReStart();
+					SetState(EFinish);
+					}
+				}	
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			if(iMaxWdpRecvBuffer.Length())
+				{
+				INFO_PRINTF1(_L("Data received:"));
+				DumpBuf(iMaxWdpRecvBuffer);
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			if (verdict==EPass && !iMiddleCancel && !iMultiReadCancel && !iAwaitLengthCancel && !iAwaitLengthTwice)
+				{
+				iImp->CancelRecv();
+				if (verdict==EPass)
+					{
+					verdict = (iSendBuffPtr->Match(iMaxWdpRecvBuffer)!=KErrNotFound)?EPass:EFail;
+					}
+				if (verdict==EPass)
+					{
+					verdict = (iRemoteHost.Match(iRecvRemoteHost)!=KErrNotFound)?EPass:EFail;
+					}
+				if (verdict==EPass)
+					{
+					Wap::TPort port;
+					iImp->GetLocalPort(port);
+					verdict = (port == iLocalPort)?EPass:EFail;
+					}
+				if (verdict==EPass)
+					{
+					Wap::TBearer bearer;
+					iImp->GetBearer(bearer);
+					verdict = (bearer == iBearer)?EPass:EFail;
+					}
+				if (verdict==EPass)
+					{
+					//This test can not perform in SIMTSY.
+					HBufC8* buf;
+					iImp->GetLocalAddress(buf);
+					delete buf;
+					}
+				}
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF1(_L("EIdle or unknown"));
+			INFO_PRINTF2(_L("Error: bad state %d, State = %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			
+			break;
+		}
+		return (activate);
+	}
+	
+CBoundWDPStep_5::CBoundWDPStep_5() 
+/**
+* Constructor
+*/
+	{
+	}
+	
+CBoundWDPStep_5::~CBoundWDPStep_5() 
+/**
+* Destructor
+*/
+	{
+	}
+	
+TVerdict CBoundWDPStep_5::doTestStepL()
+/** 
+*	Test Cancel
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-WDP: Testing Cancel"));
+	
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{	
+			TInt bearer, port;
+			TInt error	= KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect= EFalse;
+			SetLastError(KErrNone);
+				
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) iLocalPort = (Wap::TPort)port;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+				
+			error = iImp->Connect(iBearer, (Wap::TPort)iLocalPort, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), error);
+			if( error == KErrNone)
+				{
+				TPckg<TUint16> aDataSizePckg(0);
+				TRequestStatus reqStatus;
+				iImp->AwaitRecvDataSize(aDataSizePckg, reqStatus);
+				SetState(EAwaitSize);
+				ShowConnectionInfo();
+
+				StartScheduler();
+				iControl->ReStart();
+				if(reqStatus==KErrCancel)
+					{
+					SetTestStepResult(EPass);
+					}
+				}
+			}
+		}
+	return TestStepResult();
+	}
+	
+TInt CBoundWDPStep_5::CallStateMachine()
+	{
+
+	INFO_PRINTF2(_L("CallStateMachine: step [%d]"), State());
+	switch(iState)
+		{
+		case EAwaitSize:
+			INFO_PRINTF1(_L("EAwaitSize"));
+			iImp->CancelRecv();
+			SetState(EFinish);
+			iControl->ReStart();
+			break;
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			SetState(EIdle);
+			StopScheduler();
+			break;
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return 0;
+	}
+	
+CBoundWDPStep_6::CBoundWDPStep_6()
+	{
+	}
+	
+CBoundWDPStep_6::~CBoundWDPStep_6() 
+	{
+	}
+
+TVerdict CBoundWDPStep_6::doTestStepL()
+//
+//Test the CBoundWDP APIs Time out.
+//
+	{
+	//Not in use
+	return TestStepResult();
+	}
+	
+TInt CBoundWDPStep_6::CallStateMachine()
+	{
+	return (0);
+	}
+	
+CBoundWDPStep_7::CBoundWDPStep_7()
+	{
+	}
+
+CBoundWDPStep_7::~CBoundWDPStep_7()
+	{
+	}
+
+TVerdict CBoundWDPStep_7::doTestStepL()
+//
+// Test wrong sequenece
+//
+	{
+	INFO_PRINTF1(_L("BOUND-WDP: Connect-Receive-Await-Await"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			TInt bearer, port, bufLen;
+			TInt error = KErrNone;
+				
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port))
+				{	
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWdpBufLength, bufLen))
+				{
+				iWdpRecvBufLength=static_cast<TUint16>(bufLen);
+				}
+			iRecvBuffPtr = HBufC8::NewL(iWdpRecvBufLength);
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			// Start state machine
+			StartScheduler();
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+	
+TInt CBoundWDPStep_7::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+		
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iBearer, iLocalPort);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+//				WaitForInitializeL();
+				if(iRecvBuffPtr == NULL)
+					{
+					err=KErrNoMemory;
+					}
+				else
+					{
+					iRecvBuf.Set(iRecvBuffPtr->Des());
+					iImp->RecvFrom(iRecvRemoteHost, iRecvRemotePort, iRecvBuf, iTruncated, *iStatus, iTimeout);
+					SetState(EReceive);
+					activate = 1;
+					}
+				}
+			SetLastError(err);
+			if (err!=KErrNone)
+				{
+				SetState(EFinish);
+				iControl->ReStart();
+				}
+			break;
+				
+		case EReceive:
+			INFO_PRINTF1(_L("EReceive"));
+			SetLastError(iStatus->Int());
+			if(iStatus->Int() != KErrNone) 
+			// Receiving fails as expect
+				{
+				verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+				if (verdict==EPass)
+					{
+					INFO_PRINTF1(_L("Receiving failed as expect"));
+					TRequestStatus reqStatus;
+					iImp->AwaitRecvDataSize(iLength, reqStatus);
+					iImp->AwaitRecvDataSize(iLength, *iStatus);
+					activate = 1;
+					SetState(EAwaitSize);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Receiving failed not as expect"));
+					iControl->ReStart();
+					SetState(EFinish);
+					}
+				}
+			else
+				{	
+				INFO_PRINTF1(_L("Receiving succeed not as expect"));
+				iControl->ReStart();
+				SetState(EFinish);
+				}
+			break;
+				
+		case EAwaitSize:
+			INFO_PRINTF1(_L("EAwaitSize"));
+			SetLastError(iStatus->Int());
+			iImp->CancelRecv();
+			SetState(EFinish);
+			iControl->ReStart();
+			break;
+				
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+				
+		case EIdle:
+		default:
+			INFO_PRINTF1(_L("EIdle or unknown"));
+			INFO_PRINTF2(_L("Error: bad state %d, State = %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			break;
+		}
+	return (activate);
+	}
+	
+CBoundWDPStep_8::CBoundWDPStep_8() 
+	{
+	}
+
+CBoundWDPStep_8::~CBoundWDPStep_8() 
+	{
+	}
+
+TVerdict CBoundWDPStep_8::doTestStepL()
+/*
+*	Using invalid values for API parameters:
+*	- Invalid TUid on construction
+*	- Setting invalid timeout for RecvFrom
+*	Note: wrong bearer value has already been implemented as part of test 2
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-WDP: Wrong parameter values"));
+	if(TestStepResult() == EPass )
+		{
+		TInt error;
+		if(GetIntFromConfig(ConfigSection(),KWapExError2, error))
+			{
+			iExError2=error;
+			}
+		TInt trapValue;
+		TUid invalidInterfaceUid = {0x00000000}; 	
+		INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), invalidInterfaceUid);
+		TRAP(trapValue, iImp = CWapBoundDatagramService::NewL(invalidInterfaceUid));
+		TVerdict verdict = (trapValue == iExError2)?EPass:EFail;	
+		if (verdict==EPass)
+			{
+			INFO_PRINTF2(_L("CreateImplementation with wrong Uid- Failed as expected with error %d"),trapValue);
+			}
+		SetTestStepResult(verdict);
+		}
+	return TestStepResult();
+	}
+	
+TInt CBoundWDPStep_8::CallStateMachine()
+	{
+	return 0;
+	}
+	
+CBoundWDPStep_9::CBoundWDPStep_9() 
+	{
+	}
+
+CBoundWDPStep_9::~CBoundWDPStep_9() 
+	{
+	}
+
+TVerdict CBoundWDPStep_9::doTestStepL()
+	{
+	return TestStepResult();
+	}
+	
+TInt CBoundWDPStep_9::CallStateMachine()
+	{
+	return 0;
+	}
+	
+CBoundWDPStep_OutOfMemory::CBoundWDPStep_OutOfMemory() 
+	{
+	}
+
+CBoundWDPStep_OutOfMemory::~CBoundWDPStep_OutOfMemory() 
+	{
+	}
+
+TVerdict CBoundWDPStep_OutOfMemory::doTestStepL()
+	{
+	// to test fix for DEF117706: Memory leak in CWapBoundDatagramService::Connect under OOM
+	__UHEAP_MARK;
+
+	for(TInt i=1;; i++)
+		{
+		__UHEAP_FAILNEXT(i);
+
+		CWapBoundDatagramService* datServ = NULL;
+		TRAP_IGNORE(datServ = CWapBoundDatagramService::NewL());
+		if(datServ)
+			{
+			datServ->Connect(Wap::EAll, 7576);
+			delete datServ;
+			}		 
+		REComSession::FinalClose();
+
+		TInt* marker = new TInt(0);
+		if (!marker)
+			{
+			break;		
+			}
+		delete marker;
+		}
+
+	__UHEAP_MARKEND;	
+	return TestStepResult();
+	}
+	
+TInt CBoundWDPStep_OutOfMemory::CallStateMachine()
+	{
+	return 0;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapBoundWDPSteps.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,150 @@
+/**
+* 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:
+*
+*/
+
+
+
+/**
+ @file WapBoundWDPSteps.h
+*/
+#if (!defined __BOUNDWDP_STEP_H__)
+#define __BOUNDWDP_STEP_H__
+#include <test/testexecutestepbase.h>
+#include <in_sock.h>
+#include <es_sock.h>
+#include <wapmessage.h>
+#include "WapStackSuiteStepBase.h"
+
+_LIT(KBoundWDPStep_1,"BoundWDP_1");
+_LIT(KBoundWDPStep_2,"BoundWDP_2");
+_LIT(KBoundWDPStep_3,"BoundWDP_3");
+_LIT(KBoundWDPStep_4,"BoundWDP_4");
+_LIT(KBoundWDPStep_5,"BoundWDP_5");
+_LIT(KBoundWDPStep_6,"BoundWDP_6");
+_LIT(KBoundWDPStep_7,"BoundWDP_7");
+_LIT(KBoundWDPStep_8,"BoundWDP_8");
+_LIT(KBoundWDPStep_9,"BoundWDP_9");
+_LIT(KBoundWDPStep_OutOfMemory,"BoundWDP_OutOfMemory");
+
+class CBoundWDPStepBase : public CWapStackSuiteStepBase
+{
+public:
+	CBoundWDPStepBase();
+	~CBoundWDPStepBase();
+	CWapBoundDatagramService* LoadInterface();
+	void UnloadInterface();
+protected:
+	CWapBoundDatagramService* iImp;
+};
+
+
+class CBoundWDPStep_1 : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_1();
+	~CBoundWDPStep_1();
+	virtual TVerdict doTestStepL();
+private:
+	};
+
+class CBoundWDPStep_2 : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_2();
+	~CBoundWDPStep_2();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+	};
+
+class CBoundWDPStep_3 : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_3();
+	~CBoundWDPStep_3();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+public:
+	};
+
+class CBoundWDPStep_4 : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_4();
+	~CBoundWDPStep_4();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+protected:
+private:
+	};
+
+class CBoundWDPStep_5 : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_5();
+	~CBoundWDPStep_5();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundWDPStep_6 : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_6();
+	~CBoundWDPStep_6();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CBoundWDPStep_7 : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_7();
+	~CBoundWDPStep_7();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CBoundWDPStep_8 : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_8();
+	~CBoundWDPStep_8();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CBoundWDPStep_9 : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_9();
+	~CBoundWDPStep_9();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CBoundWDPStep_OutOfMemory : public CBoundWDPStepBase
+	{
+public:
+	CBoundWDPStep_OutOfMemory();
+	~CBoundWDPStep_OutOfMemory();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};	
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapBoundWSPSteps.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,1005 @@
+// Copyright (c) 2003-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:
+// CStepOne derived implementation
+// 
+//
+
+/**
+ @file
+ @internalComponent
+*/
+
+#include "WapBoundWSPSteps.h"
+#include "WapStackSuiteDefs.h"
+#include <simtsy.h>
+#include <ecom/ecom.h>
+
+CBoundWSPStepBase::CBoundWSPStepBase()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWSPStepBase::~CBoundWSPStepBase()
+/**
+* Destructor
+*/
+	{
+	if(iImp) 
+		{
+		UnloadInterface();
+		}
+	}
+
+CWapBoundCLWSPService* CBoundWSPStepBase::LoadInterface()
+	{
+	TInt trapValue;
+	CWapBoundCLWSPService* implementation = NULL;
+	// UID {0x101FBB3C} - SWS implementation
+	TUid KInterfaceUid = {0x101FBB3C}; 	
+	INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), KInterfaceUid);
+	TRAP(trapValue, implementation = CWapBoundCLWSPService::NewL(KInterfaceUid));
+	if(!trapValue)
+		{
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), implementation);
+		return implementation;
+		}
+	else return NULL;
+	}
+
+void CBoundWSPStepBase::UnloadInterface()
+	{
+	INFO_PRINTF2(_L("Interface at implementation.addr = 0x%08x is deleted"), iImp);
+	delete iImp;
+	iImp = NULL;
+	REComSession::FinalClose();	
+	}
+
+CBoundWSPStep_1::~CBoundWSPStep_1()
+/**
+* Destructor
+*/
+	{
+	}
+
+CBoundWSPStep_1::CBoundWSPStep_1()
+/**
+* Constructor
+*/
+	{
+	}
+
+TVerdict CBoundWSPStep_1::doTestStepL()
+/**
+* @return - TVerdict code
+* Override of base class pure virtual
+* Our implementation only gets called if the base class doTestStepPreambleL() did
+* not leave. That being the case, the current test result value will be EPass.
+*/
+	{
+	//
+	// CWapBoundCLWSPService
+	// 
+	INFO_PRINTF1(_L("CreateImplementation - CWapBoundCLWSPService"));
+	INFO_PRINTF1(_L("Calling old NewL() method"));
+	
+	TInt trapValue; 
+	
+	SetTestStepResult(EFail);
+	TRAP(trapValue, iImp = CWapBoundCLWSPService::NewL());
+	if(!trapValue)
+		{
+		// interface is loaded
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), iImp);
+		UnloadInterface();
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			INFO_PRINTF1(_L("CreateImplementation - OK"));
+			SetTestStepResult(EPass);
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+CBoundWSPStep_2::CBoundWSPStep_2()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWSPStep_2::~CBoundWSPStep_2() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundWSPStep_2::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-WSP: Testing Connect"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer, port;
+			TInt error	= KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect= EFalse;
+			TBool delay = EFalse;
+			SetLastError(KErrNone);
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) iLocalPort = (Wap::TPort)port;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+			if(GetBoolFromConfig(ConfigSection(),KWapDelayPortClosure, delay)) iDelayPortClosure = delay;
+			
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(), KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				}
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			StartScheduler();
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundWSPStep_2::CallStateMachine()
+	{
+	TInt err = KErrNone;
+	INFO_PRINTF2(_L("CallStateMachine: state %d"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iBearer, iLocalPort, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				if(iReconnect)
+					{ 
+					INFO_PRINTF1(_L("Reconnection"));
+					iControl->ReStart();
+					break;
+					}
+				}
+			SetState(EFinish);
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+			
+		case EFinish:
+			// it's necessary to delay port closure, let the other concurrent test step
+			// can fail opening the same port with expected error EPortAlreadyBound (-5498)
+			if (iDelayPortClosure)
+				User::After(5000000);
+
+			INFO_PRINTF1(_L("EFinish"));
+			if(GetLastError() == GetExpectedError()) SetTestStepResult(EPass);
+			else SetTestStepResult(EFail);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+CBoundWSPStep_3::CBoundWSPStep_3()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWSPStep_3::~CBoundWSPStep_3() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundWSPStep_3::doTestStepL()
+/*
+* Test the BoundWSP APIs in unconnected state.
+*/
+	{
+	INFO_PRINTF1(_L("BoundCLPush. Requests without connection"));
+	// check preamble result
+	TVerdict verdict = TestStepResult();
+	if (verdict==EPass)
+		{
+		TInt err, ret;
+		iImp = LoadInterface();
+		if (!iImp)
+			{
+			ERR_PRINTF1(_L("Unable to load BoundWSP Interface"));
+			verdict = EFail;
+			}
+		else
+			{
+			GetIntFromConfig(ConfigSection(),KWapExError,(TInt&)iExError);
+			ShowConnectionInfo();
+			TBuf8<100> header, body;
+			TPckgBuf<TUint8> idPckg;
+			TWSPStatus wspStatus;
+			TRequestStatus reqStatus;
+			TUint32 timeout = 0;
+			iImp->MethodResult(header, body, idPckg, wspStatus, reqStatus, timeout);
+			TRAP(ret, TEST_CHECKL(reqStatus.Int(), iExError, _L("MethodResult Fails not as expected")))
+				if (ret) 
+					verdict = EFail;
+				else
+					{
+					Wap::TPort port;
+					err=iImp->GetLocalPort(port);
+					TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalPort Fails not as expected")))
+						if (ret)
+							verdict = EFail;
+						else
+							{
+							HBufC8* localHost;					
+							err=iImp->GetLocalAddress(localHost);
+							TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalAddress Fails not as expected")))
+								if (ret) 
+									verdict = EFail;
+								else
+									{
+									err=iImp->GetBearer(iBearer);
+									TRAP(ret, TEST_CHECKL(err, iExError, _L("GetBearer Fails not as expected")))
+										if (ret) 
+											verdict = EFail;
+										else
+											{
+											HBufC8* host;
+											err=iImp->GetServerAddress(host);
+											TRAP(ret, TEST_CHECKL(err, iExError, _L("GetServerAddress Fails not as expected")))
+												if (ret) 
+													verdict = EFail;
+												else
+													{
+													TBuf<100> uri;
+													TUint8 id = 0;
+													err=iImp->MethodInvoke(iBearer, iRemoteHost, iRemotePort, 0x40, uri, header, body, id);
+													TRAP(ret, TEST_CHECKL(err, iExError, _L("MethodInvoke Fails not as expected")))
+														if (ret) 
+															verdict = EFail;
+													}
+											}
+									}
+							}
+					}
+				UnloadInterface();
+			}
+		}
+	if (verdict==EPass)
+		{
+		INFO_PRINTF1(_L("BoundWSP. Requests Fail as expected"));
+		}
+	SetTestStepResult(verdict);
+	return TestStepResult();
+	}
+
+TInt CBoundWSPStep_3::CallStateMachine()
+	{
+	return (0);
+	}
+
+
+CBoundWSPStep_4::CBoundWSPStep_4()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWSPStep_4::~CBoundWSPStep_4() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundWSPStep_4::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-WSP: UnitInvoke-UnitResult"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			
+			TInt bearer, port, repeat, method;
+			TInt error = KErrNone;
+			TPtrC headers;
+			TPtrC body;
+			TPtrC uri;
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) iLocalPort = (Wap::TPort)port;
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error)) SetExpectedError(error);
+			if(GetIntFromConfig(ConfigSection(),KWapWSPMethod, method)) iMethod = method;
+			if(GetIntFromConfig(ConfigSection(), KWapRepeat, repeat)) iRepeat = repeat;
+
+			if(!GetStringFromConfig(ConfigSection(),KWapURI, uri)) 
+				{
+				User::Leave(KErrNoMemory);
+				}
+			
+			GetStringFromConfig(ConfigSection(),KWapWSPHeaders, headers);
+			GetStringFromConfig(ConfigSection(),KWapWSPBody, body);
+
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+			
+			if(UseSimTsy())
+				{
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, 41));
+				}
+			
+			
+			iURI = HBufC16::NewL(uri.Length());
+			
+			iSendHeaders = HBufC8::NewL(headers.Length());
+			
+			iSendBody = HBufC8::NewL(body.Length());
+			
+			iRecvHeaders = HBufC8::NewL(KMaxWapWspHeaderBufferLength);
+			iRecvBody = HBufC8::NewL(KMaxWapWspDataBufferLength);
+
+			TPtr16 tmp16 = iURI->Des();
+			tmp16.Copy(uri);
+			TPtr8 tmp1 = iSendHeaders->Des();
+			tmp1.Copy(headers);
+			TPtr8 tmp2 = iSendBody->Des();
+			tmp2.Copy(body);
+
+			iRecvHeadersBuf.Set(iRecvHeaders->Des());
+			iRecvHeadersBuf.Zero();
+			iRecvBodyBuf.Set(iRecvBody->Des());
+			iRecvBodyBuf.Zero();
+			
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+
+			StartScheduler();
+
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+
+			delete iSendBody;
+			iSendBody=NULL;
+			delete iSendHeaders;
+			iSendHeaders=NULL;
+			delete iURI;
+			iURI=NULL;
+
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundWSPStep_4::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	static TUint total_headers = 0;		
+	static TUint total_body = 0;		
+	static TUint repeat = 0;		
+	
+	INFO_PRINTF2(_L("CallStateMachine [state %d]"), State());
+
+	switch(iState)
+		{
+		case EConnect:
+			total_headers = 0;
+			total_body = 0;
+			err = iImp->Connect(iBearer, iLocalPort, EFalse);
+			if( err == KErrNone)
+				{
+				SetState(EUnitInvoke);
+				}
+			else
+				{
+				SetState(EFinish);
+				}
+			SetLastError(err);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			iControl->ReStart();
+			break;
+
+		case EUnitInvoke:
+			INFO_PRINTF2(_L("EUnitInvoke: Method - 0x%02x"), iMethod);
+			if(iBearer != Wap::EIP)
+			{
+				TRAP(err, WaitForInitializeL());
+			}
+			if(iSendHeaders->Length() !=0 )
+				{
+				INFO_PRINTF1(_L("Headers to send:"));
+				DumpBuf(iSendHeaders->Des());
+				}	
+			if(iSendBody->Length() !=0 )
+				{
+				INFO_PRINTF1(_L("Data to send:"));
+				DumpBuf(iSendBody->Des());
+				}
+			err = iImp->MethodInvoke(iBearer, iRemoteHost, iRemotePort, iMethod, iURI->Des(), iSendHeaders->Des(), iSendBody->Des(), iTransactionId);
+			INFO_PRINTF3(_L("MethodInvoke() retcode: - dec: %d hex: 0x%08x"), err, err);
+			if(err == KErrNone) 
+				{	
+				SetState(EUnitResult);
+				}
+			else 
+				{
+				SetState(EFinish);
+				}
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+
+		case EUnitResult:
+
+			iRecvHeadersBuf.Set(iRecvHeaders->Des());
+			iRecvHeadersBuf.Zero();
+			iRecvBodyBuf.Set(iRecvBody->Des());
+			iRecvBodyBuf.Zero();
+			iImp->MethodResult(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, iWspStatus, *iStatus, iTimeout);
+			INFO_PRINTF2(_L("EUnitResult: status 0x%08x"), iStatus->Int());
+			activate = 1;
+			SetLastError(err);
+			SetState(EFinish);
+			break;
+			
+		case EFinish:
+			
+			INFO_PRINTF4(_L("EFinish: Status: %d, WSP status: %d (0x%02x)"), iStatus->Int(), iWspStatus, iWspStatus);
+
+			if(iRecvHeadersBuf.Length() != 0)
+				{
+				INFO_PRINTF1(_L("Headers"));
+				total_headers += iRecvHeadersBuf.Length();
+				DumpBuf(iRecvHeadersBuf);
+				}
+
+			if(iRecvBodyBuf.Length() != 0)
+				{
+				INFO_PRINTF1(_L("Body"));
+				total_body += iRecvBodyBuf.Length();
+				DumpBuf(iRecvBodyBuf);
+				}
+
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				if(iStatus->Int() == Wap::EMoreData)
+					{
+					INFO_PRINTF1(_L("NOTE: More data... calling MethodResult()"));
+					SetState(EUnitResult);
+					iControl->ReStart();
+					break;
+					}
+				}
+
+			INFO_PRINTF3(_L("Data received: headers - %d bytes, body - %d bytes"), total_headers, total_body);
+			total_headers = 0;
+			total_body = 0;
+			if((--iRepeat != 0) && (iStatus->Int() == KErrNone))
+				{
+				++repeat;
+				INFO_PRINTF2(_L("REPEAT TEST - %d"), repeat);
+				if(err == KErrNone) 
+					{	
+					SetState(EUnitInvoke);
+					iControl->ReStart();
+					break;
+					}
+				}
+
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			break;
+		}
+	return (activate);
+	}
+
+CBoundWSPStep_5::CBoundWSPStep_5()
+/**
+* Constructor
+*/
+	{
+	}
+
+CBoundWSPStep_5::~CBoundWSPStep_5() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CBoundWSPStep_5::doTestStepL()
+/** 
+* Test Cancel Request 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("BoundCLPush. Testing Cancel Request"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer, port;
+			TInt err = KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect= EFalse;
+			SetLastError(KErrNone);
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) iLocalPort = (Wap::TPort)port;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, err)) SetExpectedError(err);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+
+			ShowConnectionInfo();
+			err = iImp->Connect(iBearer, iLocalPort, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				TBuf8<100> header, body;
+				TPckgBuf<TUint8> idPckg;
+				TWSPStatus wspStatus;
+				TRequestStatus reqStatus;
+				TUint32 timeout=0;
+				iImp->MethodResult(header, body, idPckg, wspStatus, reqStatus, timeout);
+				SetState(EUnitResult);
+				StartScheduler();
+				iControl->ReStart();
+				if(reqStatus==KErrCancel)
+					{
+					SetTestStepResult(EPass);
+					}
+				
+				}
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundWSPStep_5::CallStateMachine()
+	{
+	INFO_PRINTF2(_L("CallStateMachine: step %d"), State());
+	switch(iState)
+		{
+		case EUnitResult:
+			INFO_PRINTF1(_L("EUnitResult"));
+			iImp->CancelReq();
+			SetState(EFinish);
+			iControl->ReStart();
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+CBoundWSPStep_6::CBoundWSPStep_6() 
+	{
+	}
+CBoundWSPStep_6::~CBoundWSPStep_6()  
+	{
+	}
+
+TVerdict CBoundWSPStep_6::doTestStepL()
+/*
+* Test receive time out
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-WSP: Connect-UnitResult-TimeOut"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			TInt bearer, port;
+			TInt error = KErrNone;
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port))
+				{
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			TInt headerLength, bufLength, timeOut; 
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvHeaderLength, headerLength))
+				{
+				iHeaderRecvBufLength=static_cast<TUint16>(headerLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvBodyLength, bufLength))
+				{
+				iBodyRecvBufLength=static_cast<TUint16>(bufLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapTimeOut, timeOut))
+				{
+				iTimeout=timeOut;
+				}
+			iRecvHeaders = HBufC8::NewL(iHeaderRecvBufLength);
+			iRecvBody = HBufC8::NewL(iBodyRecvBufLength);
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			StartScheduler();
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundWSPStep_6::CallStateMachine()
+/*
+* Test receive time out
+*/
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iBearer, iLocalPort, EFalse);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+//				WaitForInitializeL();
+				iRecvHeadersBuf.Set(iRecvHeaders->Des());
+				iRecvBodyBuf.Set(iRecvBody->Des());
+				iImp->MethodResult(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, iWspStatus, *iStatus, iTimeout);
+				INFO_PRINTF1(_L("MethodResult"));
+				activate = 1;
+				}
+			else
+				{
+				iControl->ReStart();
+				}
+			SetLastError(err);
+			SetState(EFinish);
+			break;
+			
+		case EFinish:
+			
+			INFO_PRINTF1(_L("EFinish"));
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			
+			break;
+		}
+	return (activate);
+	}
+
+CBoundWSPStep_7::CBoundWSPStep_7() 
+	{
+	}
+CBoundWSPStep_7::~CBoundWSPStep_7()
+	{
+	}
+
+TVerdict CBoundWSPStep_7::doTestStepL()
+//
+//Wrong sequence
+//
+	{
+	INFO_PRINTF1(_L("BOUND-WSP: Connect-UnitResult-UnitResult"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			TInt bearer, port;
+			TInt error = KErrNone;
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port))
+				{
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			TInt headerLength, bufLength; 
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvHeaderLength, headerLength))
+				{
+				iHeaderRecvBufLength=static_cast<TUint16>(headerLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvBodyLength, bufLength))
+				{
+				iBodyRecvBufLength=static_cast<TUint16>(bufLength);
+				}
+			iRecvHeaders = HBufC8::NewL(iHeaderRecvBufLength);
+			iRecvBody = HBufC8::NewL(iBodyRecvBufLength);
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			// Start state machine
+			StartScheduler();
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CBoundWSPStep_7::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iBearer, iLocalPort, EFalse);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+//				WaitForInitializeL();
+				TRequestStatus reqStatus;
+				iRecvHeadersBuf.Set(iRecvHeaders->Des());
+				iRecvBodyBuf.Set(iRecvBody->Des());
+				iImp->MethodResult(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, iWspStatus, reqStatus, iTimeout);
+				iImp->MethodResult(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, iWspStatus, *iStatus, iTimeout);
+				INFO_PRINTF1(_L("MethodResult"));
+				activate = 1;
+				}
+			else
+				{
+				iControl->ReStart();
+				}
+			SetLastError(err);
+			SetState(EFinish);
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			iImp->CancelReq();
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d, State = %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			
+			break;
+		}
+	return (activate);
+	}
+
+CBoundWSPStep_8::CBoundWSPStep_8() 
+	{
+	}
+CBoundWSPStep_8::~CBoundWSPStep_8()  
+	{
+	}
+TVerdict CBoundWSPStep_8::doTestStepL()
+/*
+*	Using invalid values for API parameters:
+*	- Invalid TUid on construction
+*	- Invalid method for MethodInvoke
+*	- Invalid timeout for MethodResult
+*	Note: wrong bearer value has already been implemented as part of test 2
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-WSP: Wrong parameters testing"));
+	if(TestStepResult() == EPass )
+		{
+		TInt error;
+		if(GetIntFromConfig(ConfigSection(),KWapExError2, error))
+			{
+			iExError2=error;
+			}
+		TInt trapValue;
+		TUid invalidInterfaceUid = {0x00000000}; /*{0x101FBB3C};*/
+		INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), invalidInterfaceUid);
+		TRAP(trapValue, iImp = CWapBoundCLWSPService::NewL(invalidInterfaceUid));
+		TVerdict verdict = (trapValue == iExError2)?EPass:EFail;
+		if (verdict==EFail)
+			{
+			SetTestStepResult(EFail);
+			return TestStepResult();
+			}
+		else
+			{
+			INFO_PRINTF2(_L("CreateImplementation with wrong Uid- Failed as expected with error %d"),trapValue);
+			// Now use the correct Uid
+			iImp = LoadInterface();
+			if(iImp)
+				{
+				SetLastError(KErrNone);
+				TInt method;
+				TInt error = KErrNone;
+				TPtrC headers;
+				TPtrC body;
+				TPtrC uri;
+				
+				if(GetIntFromConfig(ConfigSection(), KWapExError, error))
+					{
+					SetExpectedError(error);
+					}
+				if (GetIntFromConfig(ConfigSection(),KWapWSPMethod, method))
+					{
+					iMethod=method;
+					}
+				
+				if(!GetStringFromConfig(ConfigSection(),KWapURI, uri) || \
+					!GetStringFromConfig(ConfigSection(),KWapWSPHeaders, headers) || \
+					!GetStringFromConfig(ConfigSection(),KWapWSPBody, body))
+					{
+					User::Leave(KErrNoMemory);
+					}
+				
+				iURI = HBufC16::NewL(uri.Length());
+				
+				iSendHeaders = HBufC8::NewL(headers.Length());
+				
+				iSendBody = HBufC8::NewL(body.Length());
+				
+				TPtr16 tmp16 = iURI->Des();
+				tmp16.Copy(uri);
+				TPtr8 tmp = iSendHeaders->Des();
+				tmp.Copy(headers);
+				TPtr8 tmp1 = iSendBody->Des();
+				tmp1.Copy(body);
+
+				ShowConnectionInfo();
+				error = iImp->Connect(iBearer, iLocalPort, EFalse);
+				INFO_PRINTF2(_L("Connection completed with code = %d"), error);
+				if( error == KErrNone)
+					{
+					error = iImp->MethodInvoke(iBearer, iRemoteHost, iRemotePort, iMethod, iURI->Des(), iSendHeaders->Des(), iSendBody->Des(), iTransactionId);
+					}
+				TVerdict verdict = (error == GetExpectedError())?EPass:EFail;
+				SetTestStepResult(verdict);
+				
+				delete iSendBody;
+				iSendBody=NULL;
+				delete iSendHeaders;
+				iSendHeaders=NULL;
+				delete iURI;
+				iURI=NULL;
+				UnloadInterface();
+				}
+			}
+		}
+	return TestStepResult();
+	}
+TInt CBoundWSPStep_8::CallStateMachine()
+	{
+	return (0);
+	}
+
+CBoundWSPStep_9::CBoundWSPStep_9() {}
+CBoundWSPStep_9::~CBoundWSPStep_9()  {}
+
+TVerdict CBoundWSPStep_9::doTestStepL()
+	{
+	return TestStepResult();
+	}
+
+TInt CBoundWSPStep_9::CallStateMachine()
+	{
+	return (0);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapBoundWSPSteps.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,139 @@
+/**
+* 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:
+*
+*/
+
+
+
+/**
+ @file WapBoundWSPSteps.h
+*/
+#if (!defined __BOUNDWSP_STEP_H__)
+#define __BOUNDWSP_STEP_H__
+#include <test/testexecutestepbase.h>
+#include <in_sock.h>
+#include <es_sock.h>
+#include <wapmessage.h>
+#include "WapStackSuiteStepBase.h"
+
+// steps names
+_LIT(KBoundWSPStep_1,"BoundWSP_1");
+_LIT(KBoundWSPStep_2,"BoundWSP_2");
+_LIT(KBoundWSPStep_3,"BoundWSP_3");
+_LIT(KBoundWSPStep_4,"BoundWSP_4");
+_LIT(KBoundWSPStep_5,"BoundWSP_5");
+_LIT(KBoundWSPStep_6,"BoundWSP_6");
+_LIT(KBoundWSPStep_7,"BoundWSP_7");
+_LIT(KBoundWSPStep_8,"BoundWSP_8");
+_LIT(KBoundWSPStep_9,"BoundWSP_9");
+
+class CBoundWSPStepBase : public CWapStackSuiteStepBase
+{
+public:
+	CBoundWSPStepBase();
+	~CBoundWSPStepBase();
+	CWapBoundCLWSPService* LoadInterface();
+	void UnloadInterface();
+protected:
+	CWapBoundCLWSPService* iImp;
+};
+
+class CBoundWSPStep_1 : public CBoundWSPStepBase
+	{
+public:
+	CBoundWSPStep_1();
+	~CBoundWSPStep_1();
+	virtual TVerdict doTestStepL();
+private:
+	};
+
+class CBoundWSPStep_2 : public CBoundWSPStepBase
+	{
+public:
+	CBoundWSPStep_2();
+	~CBoundWSPStep_2();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundWSPStep_3 : public CBoundWSPStepBase
+	{
+public:
+	CBoundWSPStep_3();
+	~CBoundWSPStep_3();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundWSPStep_4 : public CBoundWSPStepBase
+	{
+public:
+	CBoundWSPStep_4();
+	~CBoundWSPStep_4();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundWSPStep_5 : public CBoundWSPStepBase
+	{
+public:
+	CBoundWSPStep_5();
+	~CBoundWSPStep_5();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CBoundWSPStep_6 : public CBoundWSPStepBase
+	{
+public:
+	CBoundWSPStep_6();
+	~CBoundWSPStep_6();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CBoundWSPStep_7 : public CBoundWSPStepBase
+	{
+public:
+	CBoundWSPStep_7();
+	~CBoundWSPStep_7();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CBoundWSPStep_8 : public CBoundWSPStepBase
+	{
+public:
+	CBoundWSPStep_8();
+	~CBoundWSPStep_8();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CBoundWSPStep_9 : public CBoundWSPStepBase
+	{
+public:
+	CBoundWSPStep_9();
+	~CBoundWSPStep_9();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapFullySpecCLPushSteps.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,776 @@
+// 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:
+//
+
+/**
+ @file
+ @internalComponent
+*/
+
+#include "WapFullySpecCLPushSteps.h"
+#include "WapStackSuiteDefs.h"
+#include <simtsy.h>
+#include <wapmsgerr.h>
+#include <ecom/ecom.h>
+
+
+CFullySpecCLPushBase::CFullySpecCLPushBase()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecCLPushBase::~CFullySpecCLPushBase()
+/**
+* Destructor
+*/
+	{
+	if(iImp) 
+		{
+		UnloadInterface();
+		}
+	}
+
+CWapFullySpecCLPushService* CFullySpecCLPushBase::LoadInterface()
+	{
+	TInt trapValue;
+	CWapFullySpecCLPushService* implementation = NULL;
+	// UID {0x101FBB3A} - SWS implementation
+	TUid KInterfaceUid = {0x101FBB3A}; 	
+	INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), KInterfaceUid);
+	TRAP(trapValue, implementation = CWapFullySpecCLPushService::NewL(KInterfaceUid));
+	if(!trapValue)
+		{
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), implementation);
+		return implementation;
+		}
+	else return NULL;
+	}
+
+void CFullySpecCLPushBase::UnloadInterface()
+	{
+	INFO_PRINTF2(_L("Interface at implementation.addr = 0x%08x is deleted"), iImp);
+	delete iImp;
+	iImp = NULL;
+	REComSession::FinalClose();	
+	}
+
+CFullySpecCLPushStep_1::CFullySpecCLPushStep_1()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecCLPushStep_1::~CFullySpecCLPushStep_1()
+/**
+* Destructor
+*/
+	{
+	}
+
+
+TVerdict CFullySpecCLPushStep_1::doTestStepL()
+/**
+* @return - TVerdict code
+* Override of base class pure virtual
+* Our implementation only gets called if the base class doTestStepPreambleL() did
+* not leave. That being the case, the current test result value will be EPass.
+*/
+	{
+	//
+	// CWapFullySpecCLPushService
+	// 
+	INFO_PRINTF1(_L("CreateImplementation - CWapFullySpecCLPushService"));
+	INFO_PRINTF1(_L("Calling old NewL() method"));
+	
+	TInt trapValue; 
+	
+	SetTestStepResult(EFail);
+	TRAP(trapValue, iImp = CWapFullySpecCLPushService::NewL());
+	if(!trapValue)
+		{
+		// interface is loaded
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), iImp);
+		UnloadInterface();
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			INFO_PRINTF1(_L("CreateImplementation - OK"));
+			SetTestStepResult(EPass);
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+CFullySpecCLPushStep_2::CFullySpecCLPushStep_2()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecCLPushStep_2::~CFullySpecCLPushStep_2() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CFullySpecCLPushStep_2::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("FULLYSPEC-PUSH: Testing Connect"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer;
+			TInt error	= KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect = EFalse;
+			SetLastError(KErrNone);
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+			
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(), KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				}
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+			
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+
+			StartScheduler();
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecCLPushStep_2::CallStateMachine()
+	{
+	TInt err = KErrNone;
+	INFO_PRINTF2(_L("CallStateMachine: step [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				if(iReconnect)
+					{ 
+					INFO_PRINTF1(_L("Reconnection"));
+					iControl->ReStart();
+					break;
+					}
+				}
+			SetState(EFinish);
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(GetLastError() == GetExpectedError()) SetTestStepResult(EPass);
+			else SetTestStepResult(EFail);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+CFullySpecCLPushStep_3::CFullySpecCLPushStep_3()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecCLPushStep_3::~CFullySpecCLPushStep_3() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CFullySpecCLPushStep_3::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("FullySpecWSPPush. Requests without connection"));
+	// check preamble result
+	TVerdict verdict = TestStepResult();
+	if (verdict==EPass)
+		{
+		TInt err, ret;
+		iImp = LoadInterface();
+		if (!iImp)
+			{
+			ERR_PRINTF1(_L("Unable to load FullySpecWSPPush Interface"));
+			verdict = EFail;
+			}
+		else
+			{
+			GetIntFromConfig(ConfigSection(),KWapExError,(TInt&)iExError);
+			ShowConnectionInfo();
+			TRequestStatus reqStatus;
+			iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, reqStatus);
+			TRAP(ret, TEST_CHECKL(reqStatus.Int(), iExError, _L("AwaitPush Fails not as expected")))
+				if (ret) 
+					verdict = EFail;
+				else
+					{
+					Wap::TPort port;
+					err=iImp->GetLocalPort(port);
+					TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalPort Fails not as expected")))
+						if (ret)
+							verdict = EFail;
+						else
+							{
+							HBufC8* localHost;					
+							err=iImp->GetLocalAddress(localHost);
+							TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalAddress Fails not as expected")))
+								if (ret) 
+									verdict = EFail;
+							}
+					}
+				UnloadInterface();
+			}
+		}
+	if (verdict==EPass)
+		{
+		INFO_PRINTF1(_L("FullySpecCLPush. Requests Fail as expected"));
+		}
+	SetTestStepResult(verdict);
+	return TestStepResult();
+	}
+
+TInt CFullySpecCLPushStep_3::CallStateMachine()
+	{
+	return (0);
+	}
+
+CFullySpecCLPushStep_4::CFullySpecCLPushStep_4()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecCLPushStep_4::~CFullySpecCLPushStep_4() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CFullySpecCLPushStep_4::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("FULLYSPEC-CLPUSH: Connect-AwaitPush"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			
+			TInt bearer, port;
+			TInt error = KErrNone;
+			TPtrC16 remote_host;
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetStringFromConfig(ConfigSection(), KWapRemoteHost, remote_host))
+				{
+				iRemoteHost.Copy(remote_host);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) 
+				{
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapRemotePort, port)) 
+				{
+				iRemotePort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			GetBoolFromConfig(ConfigSection(), KMiddleCancel, iMiddleCancel);
+			GetBoolFromConfig(ConfigSection(), KMultiReadCancel, iMultiReadCancel);
+			TInt headerLength, bufLength; 
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvHeaderLength, headerLength))
+				{
+				iHeaderRecvBufLength=static_cast<TUint16>(headerLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvBodyLength, bufLength))
+				{
+				iBodyRecvBufLength=static_cast<TUint16>(bufLength);
+				}
+			
+			iRecvHeaders = HBufC8::NewL(iHeaderRecvBufLength);
+			iRecvBody = HBufC8::NewL(iBodyRecvBufLength);
+			
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+			
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(), KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				}
+				
+				
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			//	Start state machine
+			StartScheduler();
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+			UnloadInterface();
+			} 
+		
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecCLPushStep_4::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());	
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer, EFalse);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				TRAP(err, WaitForInitializeL());
+				iRecvHeadersBuf.Set(iRecvHeaders->Des());
+				iRecvBodyBuf.Set(iRecvBody->Des());
+				iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, *iStatus);
+				INFO_PRINTF1(_L("Start AwaitingPush....."));
+				activate = 1;
+				if (!iMiddleCancel)
+					{
+					SetState(EAwaitPush);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Cancel AwaitPush"));
+					iImp->CancelAwaitPush();
+					SetState(EFinish);
+					}
+				}
+			else 
+				{
+				SetState(EFinish);
+				iControl->ReStart();
+				}
+			SetLastError(err);
+			break;
+			
+		case EAwaitPush:
+			INFO_PRINTF1(_L("EAwaitPush"));
+			if(iStatus->Int() != KErrNone && iStatus->Int()!=Wap::EMoreData) 
+				// AwaitPush failed
+				{
+				INFO_PRINTF1(_L("AwaitPush failed"));
+				SetLastError(iStatus->Int());
+				SetState(EFinish);
+				iControl->ReStart();
+				}
+			else
+				{
+				iMaxWspHeaderRecvBuffer.Append(iRecvHeadersBuf);
+				iMaxWspDataRecvBuffer.Append(iRecvBodyBuf);
+				if (iStatus->Int()==Wap::EMoreData)
+					{
+					iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, *iStatus);
+					activate = 1;
+					if (!iMultiReadCancel)
+						{
+						SetState(EAwaitPush);
+						}
+					else
+						{
+						INFO_PRINTF1(_L("Cancel Receive in EMutipleReceive state"));
+						iImp->CancelAwaitPush();
+						SetState(EFinish);
+						}					
+					
+					}
+				else
+					{
+					SetLastError(iStatus->Int());
+					iControl->ReStart();
+					SetState(EFinish);
+					}
+				}
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			if (verdict==EPass && !iMiddleCancel && !iMultiReadCancel)
+				{
+				iImp->CancelAwaitPush();
+				INFO_PRINTF1(_L("Headers"));
+				DumpBuf(iMaxWspHeaderRecvBuffer);
+				INFO_PRINTF1(_L("Body"));
+				DumpBuf(iMaxWspDataRecvBuffer);
+				if (verdict==EPass)
+					{
+					Wap::TPort port;
+					iImp->GetLocalPort(port);
+					verdict = (port == iLocalPort)?EPass:EFail;
+					}
+				if (verdict==EPass)
+					{
+					//This test can not perform.
+					HBufC8* buf;
+					iImp->GetLocalAddress(buf);
+					delete buf;
+					}
+				}
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			break;
+		}
+		return (activate);
+}
+
+CFullySpecCLPushStep_5::CFullySpecCLPushStep_5()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecCLPushStep_5::~CFullySpecCLPushStep_5() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CFullySpecCLPushStep_5::doTestStepL()
+/** 
+* Test Cancel await push 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("FullySpecified-PUSH: Testing Cancel"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer;
+			TInt error	= KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect = EFalse;
+			SetLastError(KErrNone);
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+			
+			ShowConnectionInfo();
+			error = iImp->Connect(iRemoteHost, iRemotePort, iBearer, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), error);
+			if( error == KErrNone)
+				{
+				TBuf8<100> header, body;
+				TPckgBuf<TUint8> pushIdPckg;
+				TRequestStatus reqStatus;
+				iImp->AwaitPush(header, body, pushIdPckg, reqStatus);
+				SetState(EAwaitPush);
+				StartScheduler();
+				iControl->ReStart();
+				if(reqStatus==KErrCancel)
+					{
+					SetTestStepResult(EPass);
+					}
+				}
+			
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecCLPushStep_5::CallStateMachine()
+	{
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());	
+	switch(iState)
+		{
+		case EAwaitPush:
+			INFO_PRINTF1(_L("EAwaitPush"));
+			iImp->CancelAwaitPush();
+			SetState(EFinish);
+			iControl->ReStart();
+			break;
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			SetState(EIdle);
+			StopScheduler();
+			break;
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+CFullySpecCLPushStep_6::CFullySpecCLPushStep_6() 
+	{
+	}
+CFullySpecCLPushStep_6::~CFullySpecCLPushStep_6() 
+	{
+	}
+TVerdict CFullySpecCLPushStep_6::doTestStepL()
+	{
+	//Not in use
+	return TestStepResult();
+	}
+
+TInt CFullySpecCLPushStep_6::CallStateMachine()
+	{
+	return (0);
+	}
+
+CFullySpecCLPushStep_7::CFullySpecCLPushStep_7() 
+	{
+	}
+CFullySpecCLPushStep_7::~CFullySpecCLPushStep_7() 
+	{
+	}
+TVerdict CFullySpecCLPushStep_7::doTestStepL()
+	{
+	INFO_PRINTF1(_L("FULLYSPEC-CLPUSH: Connect-AwaitPush-AwaitPush"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			
+			TInt bearer;
+			TInt error = KErrNone;
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) 
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error)) 
+				{
+				SetExpectedError(error);
+				}
+			TInt headerLength, bufLength; 
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvHeaderLength, headerLength))
+				{
+				iHeaderRecvBufLength=static_cast<TUint16>(headerLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvBodyLength, bufLength))
+				{
+				iBodyRecvBufLength=static_cast<TUint16>(bufLength);
+				}
+			iRecvHeaders = HBufC8::NewL(iHeaderRecvBufLength);
+			iRecvBody = HBufC8::NewL(iBodyRecvBufLength);
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			// Start state machine
+			StartScheduler();
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecCLPushStep_7::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());	
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer, EFalse);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+//				WaitForInitializeL();
+				TRequestStatus reqStatus;
+				iRecvHeadersBuf.Set(iRecvHeaders->Des());
+				iRecvBodyBuf.Set(iRecvBody->Des());
+				iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, reqStatus);
+				iImp->AwaitPush(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, *iStatus);
+				INFO_PRINTF1(_L("AwaitPush"));
+				activate = 1;
+				}
+			else
+				{
+				iControl->ReStart();
+				}
+			SetLastError(err);
+			SetState(EFinish);
+			break;
+			
+		case EFinish:
+			
+			INFO_PRINTF1(_L("EFinish"));
+			iImp->CancelAwaitPush();
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			
+			break;
+		}
+	return (activate);
+	}
+
+CFullySpecCLPushStep_8::CFullySpecCLPushStep_8() 
+	{
+	}
+CFullySpecCLPushStep_8::~CFullySpecCLPushStep_8() 
+	{
+	}
+TVerdict CFullySpecCLPushStep_8::doTestStepL()
+/**
+*	@return - TVerdict code
+*	Wrong parameter values for FullySpecified CL Push API:
+*	- Wrong TUid on construction
+*	- Connect to wrong bearer (already implemented in test 2)
+*/
+	{
+	INFO_PRINTF1(_L("CreateImplementation with wrong Uid- CWapFullySpecCLPushService"));
+	if(TestStepResult() == EPass )
+		{
+		TInt error;
+		if(GetIntFromConfig(ConfigSection(),KWapExError2, error))
+			{
+			iExError2=error;
+			}
+		TInt trapValue;
+		TUid invalidInterfaceUid = {0x00000000}; 
+		INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), invalidInterfaceUid);
+		TRAP(trapValue, iImp = CWapFullySpecCLPushService::NewL(invalidInterfaceUid));
+		TVerdict verdict = (trapValue == iExError2)?EPass:EFail;
+		if (verdict==EPass)
+			{
+			INFO_PRINTF2(_L("CreateImplementation with wrong Uid- Failed as expected with error %d"),trapValue);
+			}
+		SetTestStepResult(verdict);
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecCLPushStep_8::CallStateMachine()
+	{
+	return (0);
+	}
+
+CFullySpecCLPushStep_9::CFullySpecCLPushStep_9() {}
+CFullySpecCLPushStep_9::~CFullySpecCLPushStep_9() {}
+TVerdict CFullySpecCLPushStep_9::doTestStepL()
+	{
+	return TestStepResult();
+	}
+
+TInt CFullySpecCLPushStep_9::CallStateMachine()
+	{
+	return (0);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapFullySpecCLPushSteps.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,138 @@
+/**
+* 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:
+*
+*/
+
+
+
+/**
+ @file WapFullySpecCLPush.h
+*/
+#if (!defined __FULLYSPECCLPUSH_STEP_H__)
+#define __FULLYSPECCLPUSH_STEP_H__
+#include <test/testexecutestepbase.h>
+#include <in_sock.h>
+#include <es_sock.h>
+#include <wapmessage.h>
+#include "WapStackSuiteStepBase.h"
+
+_LIT(KFullySpecCLPushStep_1,"FullySpecCLPush_1");
+_LIT(KFullySpecCLPushStep_2,"FullySpecCLPush_2");
+_LIT(KFullySpecCLPushStep_3,"FullySpecCLPush_3");
+_LIT(KFullySpecCLPushStep_4,"FullySpecCLPush_4");
+_LIT(KFullySpecCLPushStep_5,"FullySpecCLPush_5");
+_LIT(KFullySpecCLPushStep_6,"FullySpecCLPush_6");
+_LIT(KFullySpecCLPushStep_7,"FullySpecCLPush_7");
+_LIT(KFullySpecCLPushStep_8,"FullySpecCLPush_8");
+_LIT(KFullySpecCLPushStep_9,"FullySpecCLPush_9");
+
+class CFullySpecCLPushBase : public CWapStackSuiteStepBase
+{
+public:
+	CFullySpecCLPushBase();
+	~CFullySpecCLPushBase();
+	CWapFullySpecCLPushService* LoadInterface();
+	void UnloadInterface();
+protected:
+	CWapFullySpecCLPushService* iImp;
+};
+
+class CFullySpecCLPushStep_1 : public CFullySpecCLPushBase
+	{
+public:
+	CFullySpecCLPushStep_1();
+	~CFullySpecCLPushStep_1();
+	virtual TVerdict doTestStepL();
+private:
+	};
+
+class CFullySpecCLPushStep_2 : public CFullySpecCLPushBase
+	{
+public:
+	CFullySpecCLPushStep_2();
+	~CFullySpecCLPushStep_2();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecCLPushStep_3 : public CFullySpecCLPushBase
+	{
+public:
+	CFullySpecCLPushStep_3();
+	~CFullySpecCLPushStep_3();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecCLPushStep_4 : public CFullySpecCLPushBase
+	{
+public:
+	CFullySpecCLPushStep_4();
+	~CFullySpecCLPushStep_4();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecCLPushStep_5 : public CFullySpecCLPushBase
+	{
+public:
+	CFullySpecCLPushStep_5();
+	~CFullySpecCLPushStep_5();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecCLPushStep_6 : public CFullySpecCLPushBase
+	{
+public:
+	CFullySpecCLPushStep_6();
+	~CFullySpecCLPushStep_6();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CFullySpecCLPushStep_7 : public CFullySpecCLPushBase
+	{
+public:
+	CFullySpecCLPushStep_7();
+	~CFullySpecCLPushStep_7();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CFullySpecCLPushStep_8 : public CFullySpecCLPushBase
+	{
+public:
+	CFullySpecCLPushStep_8();
+	~CFullySpecCLPushStep_8();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CFullySpecCLPushStep_9 : public CFullySpecCLPushBase
+	{
+public:
+	CFullySpecCLPushStep_9();
+	~CFullySpecCLPushStep_9();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapFullySpecWDPSteps.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,885 @@
+// 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:
+//
+
+/**
+ @file
+ @internalComponent
+*/
+
+#include "WapFullySpecWDPSteps.h"
+#include "WapStackSuiteDefs.h"
+#include <wapmsgerr.h>
+#include <simtsy.h>
+#include <ecom/ecom.h>
+
+CFullySpecWDPStepBase::CFullySpecWDPStepBase()
+/*
+* Constructor
+*/
+	{
+	}
+CFullySpecWDPStepBase::~CFullySpecWDPStepBase()
+/*
+* Destructor
+*/
+	{
+	if(iImp) 
+		{
+		UnloadInterface();
+		}
+	}
+
+CWapFullySpecDatagramService* CFullySpecWDPStepBase::LoadInterface()
+/*
+* Load CWapFullySpecifiedDatagramService Interface with Interface ID
+*/
+	{
+	CWapFullySpecDatagramService* implementation = NULL;
+	TUid KInterfaceUid = {0x101FBB38};
+	INFO_PRINTF2(_L("Calling new NewL(%08X) method"), KInterfaceUid);
+	TRAPD(trapValue, implementation = CWapFullySpecDatagramService::NewL(KInterfaceUid));
+	if(!trapValue)	
+		{
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), implementation);
+		return implementation;
+		}
+	else 
+		return NULL;
+	}
+
+void CFullySpecWDPStepBase::UnloadInterface()
+	{
+	INFO_PRINTF2(_L("Interface at implementation.addr = 0x%08x is deleted"), iImp);
+	delete iImp;
+	iImp = NULL;
+	REComSession::FinalClose();	
+	}
+
+CFullySpecWDPStep_1::CFullySpecWDPStep_1()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecWDPStep_1::~CFullySpecWDPStep_1()
+/**
+* Destructor
+*/
+	{
+	}
+TVerdict CFullySpecWDPStep_1::doTestStepL()
+/** 
+* Load and destroy FullySpecifiedDatagtamService interface implementation
+* Two different methods are used NewL() and NewL(TUid InterfaceUid)
+* @return - TVerdict code
+*/
+	{
+	// CWapFullySpecDatagramService
+	INFO_PRINTF1(_L("CreateImplementation - CWapFullySpecDatagramService"));
+	INFO_PRINTF1(_L("Calling old NewL() method"));
+	
+	TInt trapValue; 
+	
+	SetTestStepResult(EFail);
+	TRAP(trapValue, iImp = CWapFullySpecDatagramService::NewL());
+	if(!trapValue)
+		{
+		// interface is loaded
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), iImp);
+		UnloadInterface();
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			INFO_PRINTF1(_L("CreateImplementation - OK"));
+			SetTestStepResult(EPass);
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+CFullySpecWDPStep_2::CFullySpecWDPStep_2()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecWDPStep_2::~CFullySpecWDPStep_2() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CFullySpecWDPStep_2::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("FULLYSPEC-WDP: Testing Connect"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer	= 0;
+			TInt error	= KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect = EFalse;
+			SetLastError(KErrNone);
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+			
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(), KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				}
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			StartScheduler();
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWDPStep_2::CallStateMachine()
+	{
+	TInt err = KErrNone;
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				if(iReconnect)
+					{ 
+					INFO_PRINTF1(_L("Reconnection"));
+					iControl->ReStart();
+					break;
+					}
+				}
+			SetState(EFinish);
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(GetLastError() == GetExpectedError()) SetTestStepResult(EPass);
+			else SetTestStepResult(EFail);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+CFullySpecWDPStep_3::CFullySpecWDPStep_3()
+/**
+* Constructor
+*/
+	{
+	SetTestStepName(KWapWDPStackSuiteLogFile);
+	}
+CFullySpecWDPStep_3::~CFullySpecWDPStep_3()
+/**
+* Destructor
+*/
+	{
+	}
+TVerdict CFullySpecWDPStep_3::doTestStepL()
+/*
+* Test the FullySpecWDP APIs in unconnected state.
+*/
+	{
+	INFO_PRINTF1(_L("FULLYSPECIFIEDWDP. Requests without connection"));
+	// check preamble result
+	TVerdict verdict = TestStepResult();
+	if (verdict==EPass)
+		{
+		TInt err, ret;
+		iImp = LoadInterface();
+		if (!iImp)
+			verdict = EFail;
+		else
+			{
+			GetIntFromConfig(ConfigSection(),KWapExError,(TInt&)iExError);
+			ShowConnectionInfo();
+			TBuf8<100> buf;
+			err = iImp->Send(buf);
+			TRAP(ret, TEST_CHECKL(err, iExError, _L("Connect Fails as expected")))
+				if (ret) 
+					verdict = EFail;
+				else
+					{
+					TPckg<TUint16> aDataSizePckg(0);
+					TRequestStatus reqStatus;
+					iImp->AwaitRecvDataSize(aDataSizePckg, reqStatus);
+					User::WaitForRequest(reqStatus);
+					TRAP(ret, TEST_CHECKL(reqStatus.Int(), iExError, _L("Connect Fails as expected")))
+						if (ret) 
+							verdict = EFail;
+						else
+							{
+							TBuf8<100> buf;
+							TBool truncated;
+							TUint32 timeout=0;
+							iImp->Recv(buf, truncated,reqStatus,timeout);
+							User::WaitForRequest(reqStatus);
+							TRAP(ret, TEST_CHECKL(reqStatus.Int(), iExError, _L("Connect Fails as expected")))
+								if (ret) 
+									verdict = EFail;
+								else
+									{
+									Wap::TPort aPort;
+									err=iImp->GetLocalPort(aPort);
+									TRAP(ret, TEST_CHECKL(err, iExError, _L("Connect Fails as expected")))
+										if (ret) 
+											verdict = EFail;
+										else
+											{
+											HBufC8* localHost;
+											err=iImp->GetLocalAddress(localHost);
+											TRAP(ret, TEST_CHECKL(err, iExError, _L("Connect Fails as expected")))
+												if (ret) 
+													verdict = EFail;
+												else
+													{
+													TUint16 maxSize, nominalSize;
+													err=iImp->GetDatagramSizes(maxSize, nominalSize);
+													if (err)
+														verdict = EFail;
+													}
+											}
+									}
+							}
+					}
+				UnloadInterface();
+			}
+		}
+	if (verdict==EPass)
+		{
+		INFO_PRINTF1(_L("FullySpecWDP. Requests Fail as expected"));
+		}
+	SetTestStepResult(verdict);
+	return TestStepResult();
+	}
+
+TInt CFullySpecWDPStep_3::CallStateMachine()
+	{
+	return KErrNone;
+	}
+
+CFullySpecWDPStep_4::~CFullySpecWDPStep_4()
+/**
+* Destructor
+*/
+	{
+	}
+
+CFullySpecWDPStep_4::CFullySpecWDPStep_4()
+/**
+* Constructor
+*/
+	{
+	}
+
+TVerdict CFullySpecWDPStep_4::doTestStepL()
+	{
+	INFO_PRINTF1(_L("FULLYSPEC-WDP: Connect-Send-Await-Receive"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			
+			TInt bearer, port, bufLen;
+			TInt error = KErrNone;
+			TPtrC data;
+			TPtrC16 remote_host;
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetStringFromConfig(ConfigSection(), KWapRemoteHost, remote_host))
+				{
+				iRemoteHost.Copy(remote_host);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapRemotePort, port))
+				{
+				iRemotePort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port))
+				{
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			GetIntFromConfig(ConfigSection(), KWapExError2, iExError2);
+			GetBoolFromConfig(ConfigSection(), KAwaitLengthTwice, iAwaitLengthTwice);
+			GetBoolFromConfig(ConfigSection(), KAwaitLengthCancel, iAwaitLengthCancel);
+			GetBoolFromConfig(ConfigSection(), KMiddleCancel, iMiddleCancel);
+			GetBoolFromConfig(ConfigSection(), KMultiReadCancel, iMultiReadCancel);
+			if(GetIntFromConfig(ConfigSection(),KWapWdpBufLength, bufLen))
+				{
+				iWdpRecvBufLength=static_cast<TUint16>(bufLen);
+				iRecvBuffPtr = HBufC8::NewL(iWdpRecvBufLength);
+				}
+			error = GetStringFromConfig(ConfigSection(),KWapData, data);
+			if(!error)
+				{
+				User::Leave(error);
+				}
+			iSendBuffPtr = HBufC8::NewL(data.Length());
+			TPtr8 tmp = iSendBuffPtr->Des();
+			tmp.Copy(data);
+			
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(), KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				}
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			// Start state machine
+			StartScheduler(); 
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWDPStep_4::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	TInt leaveError = KErrNone;
+	
+	INFO_PRINTF2(_L("CallStateMachine: state  [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				TRAP(leaveError, WaitForInitializeL());
+				err = iImp->Send(iSendBuffPtr->Des());
+				if(err == KErrNone && leaveError == KErrNone) 
+					{	
+					INFO_PRINTF2(_L("Send completetd with code = %d"), err);
+					SetState(EAwaitSize);
+					}
+				else 
+					{	
+					SetState(EFinish);
+					}
+				}
+			else 
+				{
+				SetState(EFinish);
+				}
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+			
+		case EAwaitSize:
+			INFO_PRINTF1(_L("EAwaitSize"));
+			iImp->AwaitRecvDataSize(iLength, *iStatus);
+			activate = 1;
+			if (!iAwaitLengthCancel)
+				{
+				SetState(EReceive);
+				}
+			else
+				{
+				INFO_PRINTF1(_L("Cancel Receive in AwaitSize state"));
+				iImp->CancelRecv();
+				SetState(EFinish);
+				}
+			
+			break;
+			
+		case EReceive:
+			INFO_PRINTF1(_L("EReceive"));
+			if(iStatus->Int()!=KErrNone) 
+				// AwaitSize failed
+				{
+				INFO_PRINTF1(_L("AwaitSize failed"));
+				SetLastError(iStatus->Int());
+				iControl->ReStart();
+				SetState(EFinish);
+				}
+			else
+				{	
+				INFO_PRINTF2(_L("AwaitSize returned - %d"),iLength());
+				if (!iAwaitLengthTwice)
+					{
+					if (iRecvBuffPtr==NULL)
+						{
+						TInt len=iLength();
+						TRAP(err, iRecvBuffPtr = HBufC8::NewL(len))
+							if (err!=KErrNone)
+								{
+								SetLastError(err);
+								iControl->ReStart();
+								SetState(EFinish);
+								break;
+								}
+						}
+					iRecvBuf.Set(iRecvBuffPtr->Des());
+					iImp->Recv(iRecvBuf, iTruncated, *iStatus, 0);
+					activate = 1;
+					if (!iMiddleCancel)
+						{
+						SetState(EMutipleReceive);
+						}
+					else
+						{
+						INFO_PRINTF1(_L("Cancel Receive in Receive state"));
+						iImp->CancelRecv();
+						SetState(EFinish);
+						}
+					}
+				else
+					{
+					iImp->AwaitRecvDataSize(iLength, *iStatus);
+					activate = 1;
+					SetState(EFinish);
+					}
+				}
+			break;
+			
+		case EMutipleReceive:
+			INFO_PRINTF1(_L("EMultipleReceive"));
+			if (iStatus->Int()!=KErrNone && iStatus->Int()!=Wap::EMoreData)
+				{
+				INFO_PRINTF1(_L("Receive failed"));
+				SetLastError(iStatus->Int());
+				iControl->ReStart();
+				SetState(EFinish);
+				}
+			else
+				{
+				iMaxWdpRecvBuffer.Append(iRecvBuf);
+				if (iTruncated)
+					{
+					iImp->Recv(iRecvBuf, iTruncated, *iStatus, 0);
+					activate = 1;
+					if (!iMultiReadCancel)
+						{
+						SetState(EMutipleReceive);
+						}
+					else
+						{
+						INFO_PRINTF1(_L("Cancel Receive in EMutipleReceive state"));
+						iImp->CancelRecv();
+						SetState(EFinish);
+						}					
+					}
+				else
+					{
+					SetLastError(iStatus->Int());
+					iControl->ReStart();
+					SetState(EFinish);
+					}
+				}	
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			if (verdict==EPass && !iAwaitLengthTwice && !iMiddleCancel && !iMultiReadCancel && !iAwaitLengthCancel)
+				{
+				iImp->CancelRecv();
+				INFO_PRINTF1(_L("Data received"));
+				DumpBuf(iMaxWdpRecvBuffer);
+				if (verdict==EPass)
+					{
+					verdict = (iSendBuffPtr->Match(iMaxWdpRecvBuffer)!=KErrNotFound)?EPass:EFail;
+					}
+				if (verdict==EPass)
+					{
+					Wap::TPort port;
+					iImp->GetLocalPort(port);
+					verdict = (port == iLocalPort)?EPass:EFail;
+					}
+				if (verdict==EPass)
+					{
+					//This test can not perform to get own telnumber
+					HBufC8* buf;
+					iImp->GetLocalAddress(buf);
+					delete buf;
+					}
+				}
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			
+			break;
+		}
+		return (activate);
+	}
+	
+	CFullySpecWDPStep_5::~CFullySpecWDPStep_5()
+	/**
+	* Destructor
+	*/
+		{
+		}
+	
+	CFullySpecWDPStep_5::CFullySpecWDPStep_5()
+	/**
+	* Constructor
+	*/
+		{
+		}
+	
+	TVerdict CFullySpecWDPStep_5::doTestStepL()
+	/** 
+	*	Test Cancel
+	*/
+		{
+		INFO_PRINTF1(_L("Fully Specified-WDP: Testing Cancel"));
+		
+		if(TestStepResult() == EPass )
+			{
+			SetTestStepResult(EFail);
+			iImp = LoadInterface();
+			if(iImp)
+				{	
+				TInt bearer	= 0;
+				TInt error	= KErrNone;
+				TBool secure= EFalse;
+				TBool reconnect = EFalse;
+				SetLastError(KErrNone);
+				
+				if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+				if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+				if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+				if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+
+				ShowConnectionInfo();				
+
+				error = iImp->Connect(iRemoteHost, iRemotePort, iBearer, iSecure);
+				INFO_PRINTF2(_L("Connection completed with code = %d"), error);
+				if( error == KErrNone)
+					{
+					TPckg<TUint16> aDataSizePckg(0);
+					TRequestStatus reqStatus;
+					iImp->AwaitRecvDataSize(aDataSizePckg, reqStatus);
+					SetState(EAwaitSize);
+					StartScheduler();
+					iControl->ReStart();
+					if(reqStatus==KErrCancel)
+						{
+						SetTestStepResult(EPass);
+						}
+					}
+				}
+			}
+		return TestStepResult();
+		}
+
+TInt CFullySpecWDPStep_5::CallStateMachine()
+	{
+	INFO_PRINTF2(_L("CallStateMachine: step [%d]"), State());
+	switch(iState)
+		{
+		case EAwaitSize:
+			INFO_PRINTF1(_L("EAwaitSize"));
+			iImp->CancelRecv();
+			SetState(EFinish);
+			iControl->ReStart();
+			break;
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			SetState(EIdle);
+			StopScheduler();
+			break;
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknow state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return 0;
+	}
+	
+CFullySpecWDPStep_6::~CFullySpecWDPStep_6() 
+	{
+	}
+
+CFullySpecWDPStep_6::CFullySpecWDPStep_6()
+	{
+	}
+
+TVerdict CFullySpecWDPStep_6::doTestStepL()
+	{
+	//Test timeout (Not in use)
+	return TestStepResult();
+	}
+
+TInt CFullySpecWDPStep_6::CallStateMachine()
+	{
+	return KErrNone;
+	}
+
+CFullySpecWDPStep_7::~CFullySpecWDPStep_7()
+	{
+	}
+
+CFullySpecWDPStep_7::CFullySpecWDPStep_7()
+	{
+	}
+
+TVerdict CFullySpecWDPStep_7::doTestStepL()
+	//
+	//Test wrong sequenece
+	//
+	{
+	INFO_PRINTF1(_L("FULLYSPEC-WDP: Connect-Receive-Await-Await"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			
+			TInt bearer, port, bufLen;
+			TInt error = KErrNone;
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port))
+				{	
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWdpBufLength, bufLen))
+				{
+				iWdpRecvBufLength=static_cast<TUint16>(bufLen);
+				}
+			iRecvBuffPtr = HBufC8::NewL(iWdpRecvBufLength);
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+
+			StartScheduler();
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWDPStep_7::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	
+	INFO_PRINTF2(_L("CallStateMachine: state  [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+//				WaitForInitializeL();
+				if(iRecvBuffPtr == NULL)
+					{
+					err=KErrNoMemory;
+					}
+				else
+					{
+					iRecvBuf.Set(iRecvBuffPtr->Des());
+					iImp->Recv(iRecvBuf, iTruncated, *iStatus, iTimeout);
+					SetState(EReceive);
+					activate = 1;
+					}
+				}
+			SetLastError(err);
+			if (err!=KErrNone)
+				{
+				SetState(EFinish);
+				iControl->ReStart();
+				}
+			break;
+			
+		case EReceive:
+			INFO_PRINTF1(_L("EReceive"));
+			SetLastError(iStatus->Int());
+			if(iStatus->Int() != KErrNone) 
+				// Receiving fails as expect
+				{
+				verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+				if (verdict==EPass)
+					{
+					INFO_PRINTF1(_L("Receiving failed as expect"));
+					TRequestStatus reqStatus;
+					iImp->AwaitRecvDataSize(iLength, reqStatus);
+					iImp->AwaitRecvDataSize(iLength, *iStatus);
+					activate = 1;
+					SetState(EAwaitSize);
+					}
+				else
+					{
+					INFO_PRINTF1(_L("Receiving failed not as expect"));
+					iControl->ReStart();
+					SetState(EFinish);
+					}
+				}
+			else
+				{	
+				INFO_PRINTF1(_L("Receiving succeed not as expect"));
+				iControl->ReStart();
+				SetState(EFinish);
+				}
+			break;
+			
+		case EAwaitSize:
+			INFO_PRINTF1(_L("EAwaitSize"));
+			SetLastError(iStatus->Int());
+			iImp->CancelRecv();
+			SetState(EFinish);
+			iControl->ReStart();
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			break;
+		}
+	return (activate);
+}
+
+CFullySpecWDPStep_8::~CFullySpecWDPStep_8()
+	{
+	}
+CFullySpecWDPStep_8::CFullySpecWDPStep_8() 
+	{
+	}
+
+TVerdict CFullySpecWDPStep_8::doTestStepL()
+/*
+*	Using invalid values for API parameters:
+*	- Invalid TUid on construction
+*	- Setting invalid timeout for Recv
+*	Note: wrong bearer value has already been implemented as part of test 2
+*/
+	{
+	INFO_PRINTF1(_L("FullySpec-WDP: Wrong parameter values"));
+	if(TestStepResult() == EPass )
+		{
+		TInt error;
+		if(GetIntFromConfig(ConfigSection(),KWapExError2, error))
+			{
+			iExError2=error;
+			}
+		TInt trapValue;
+		TUid invalidInterfaceUid = {0x00000000}; 	
+		INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), invalidInterfaceUid);
+		TRAP(trapValue, iImp = CWapFullySpecDatagramService::NewL(invalidInterfaceUid));
+		TVerdict verdict = (trapValue == iExError2)?EPass:EFail;
+		if (verdict==EPass)
+			{
+			INFO_PRINTF2(_L("CreateImplementation with wrong Uid- Failed as expected with error %d"),trapValue);
+			}
+		SetTestStepResult(verdict);
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWDPStep_8::CallStateMachine()
+	{
+	return KErrNone;
+	}
+
+CFullySpecWDPStep_9::~CFullySpecWDPStep_9() {}
+CFullySpecWDPStep_9::CFullySpecWDPStep_9() {}
+TVerdict CFullySpecWDPStep_9::doTestStepL()
+	{
+	return TestStepResult();
+	}
+TInt CFullySpecWDPStep_9::CallStateMachine()
+	{
+	return KErrNone;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapFullySpecWDPSteps.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,142 @@
+/**
+* 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:
+*
+*/
+
+
+
+/**
+ @file WapFullySpecWDPSteps.h
+*/
+#if (!defined __FULLYSPECWDP_STEP_H__)
+#define __FULLYSPECWDP_STEP_H__
+#include <test/testexecutestepbase.h>
+#include <in_sock.h>
+#include <es_sock.h>
+#include <wapmessage.h>
+
+#include "WapStackSuiteStepBase.h"
+
+_LIT(KFullySpecWDPStep_1,"FullySpecWDP_1");
+_LIT(KFullySpecWDPStep_2,"FullySpecWDP_2");
+_LIT(KFullySpecWDPStep_3,"FullySpecWDP_3");
+_LIT(KFullySpecWDPStep_4,"FullySpecWDP_4");
+_LIT(KFullySpecWDPStep_5,"FullySpecWDP_5");
+_LIT(KFullySpecWDPStep_6,"FullySpecWDP_6");
+_LIT(KFullySpecWDPStep_7,"FullySpecWDP_7");
+_LIT(KFullySpecWDPStep_8,"FullySpecWDP_8");
+_LIT(KFullySpecWDPStep_9,"FullySpecWDP_9");
+
+class CFullySpecWDPStepBase : public CWapStackSuiteStepBase
+{
+public:
+	~CFullySpecWDPStepBase();
+	void UnloadInterface();
+protected:
+	CFullySpecWDPStepBase();
+	CWapFullySpecDatagramService* LoadInterface();
+	CWapFullySpecDatagramService* iImp;
+};
+
+class CFullySpecWDPStep_1 : public CFullySpecWDPStepBase
+	{
+public:
+	CFullySpecWDPStep_1();
+	~CFullySpecWDPStep_1();
+	virtual TVerdict doTestStepL();
+private:
+	};
+
+class CFullySpecWDPStep_2 : public CFullySpecWDPStepBase
+	{
+public:
+	CFullySpecWDPStep_2();
+	~CFullySpecWDPStep_2();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWDPStep_3 : public CFullySpecWDPStepBase
+	{
+public:
+	CFullySpecWDPStep_3();
+	~CFullySpecWDPStep_3();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWDPStep_4 : public CFullySpecWDPStepBase
+	{
+public:
+	CFullySpecWDPStep_4();
+	~CFullySpecWDPStep_4();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWDPStep_5: public CFullySpecWDPStepBase
+	{
+public:
+	CFullySpecWDPStep_5();
+	~CFullySpecWDPStep_5();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWDPStep_6: public CFullySpecWDPStepBase
+	{
+public:
+	CFullySpecWDPStep_6();
+	~CFullySpecWDPStep_6();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWDPStep_7: public CFullySpecWDPStepBase
+	{
+public:
+	CFullySpecWDPStep_7();
+	~CFullySpecWDPStep_7();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWDPStep_8: public CFullySpecWDPStepBase
+	{
+public:
+	CFullySpecWDPStep_8();
+	~CFullySpecWDPStep_8();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWDPStep_9: public CFullySpecWDPStepBase
+	{
+public:
+	CFullySpecWDPStep_9();
+	~CFullySpecWDPStep_9();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapFullySpecWSPSteps.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,983 @@
+// 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:
+//
+
+/**
+ @file
+ @internalComponent
+*/
+
+#include "WapFullySpecWSPSteps.h"
+#include "WapStackSuiteDefs.h"
+#include <simtsy.h>
+#include <ecom/ecom.h>
+
+CFullySpecWSPStepBase::CFullySpecWSPStepBase()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecWSPStepBase::~CFullySpecWSPStepBase()
+/**
+* Destructor
+*/
+	{
+	if(iImp) 
+		{
+		UnloadInterface();
+		}
+	}
+
+// Load CWapBoundDatagramService Interface 
+CWapFullySpecCLWSPService* CFullySpecWSPStepBase::LoadInterface()
+	{
+	TInt trapValue;
+	CWapFullySpecCLWSPService* implementation = NULL;
+	// UID {0x101FBB3E} - SWS implementation
+	TUid KInterfaceUid = {0x101FBB3E}; 	
+	INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), KInterfaceUid);
+	TRAP(trapValue, implementation = CWapFullySpecCLWSPService::NewL(KInterfaceUid));
+	if(!trapValue)
+		{
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), implementation);
+		return implementation;
+		}
+	else return NULL;
+	}
+
+void CFullySpecWSPStepBase::UnloadInterface()
+	{
+	INFO_PRINTF2(_L("Interface at implementation.addr = 0x%08x is deleted"), iImp);
+	delete iImp;
+	iImp = NULL;
+	REComSession::FinalClose();	
+	}
+
+CFullySpecWSPStep_1::~CFullySpecWSPStep_1()
+/**
+* Destructor
+*/
+	{
+	}
+
+CFullySpecWSPStep_1::CFullySpecWSPStep_1()
+/**
+* Constructor
+*/
+	{
+	}
+
+TVerdict CFullySpecWSPStep_1::doTestStepL()
+/**
+* @return - TVerdict code
+* Override of base class pure virtual
+* Our implementation only gets called if the base class doTestStepPreambleL() did
+* not leave. That being the case, the current test result value will be EPass.
+*/
+	{
+	//
+	// CWapFullySpecCLWSPService
+	// 
+	INFO_PRINTF1(_L("CreateImplementation - CWapFullySpecCLWSPService"));
+	INFO_PRINTF1(_L("Calling old NewL() method"));
+	
+	TInt trapValue; 
+	
+	SetTestStepResult(EFail);
+	TRAP(trapValue, iImp = CWapFullySpecCLWSPService::NewL());
+	if(!trapValue)
+		{
+		// interface is loaded
+		INFO_PRINTF2(_L("Interface is loaded: implementation.addr = 0x%08x"), iImp);
+		UnloadInterface();
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			INFO_PRINTF1(_L("CreateImplementation - OK"));
+			SetTestStepResult(EPass);
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+CFullySpecWSPStep_2::CFullySpecWSPStep_2()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecWSPStep_2::~CFullySpecWSPStep_2() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CFullySpecWSPStep_2::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("FULLYSPEC-WSP: Testing Connect"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer	= 0;
+			TInt error	= KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect= EFalse;
+			SetLastError(KErrNone);
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+			
+			if(UseSimTsy())
+				{
+				GetIntFromConfig(ConfigSection(), KWapSIMTSYState, iSimTsyState);
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, iSimTsyState));
+				}
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+			// Start state machine
+			StartScheduler();
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWSPStep_2::CallStateMachine()
+	{
+	TInt err = KErrNone;
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(State())
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				if(iReconnect)
+					{ 
+					INFO_PRINTF1(_L("Reconnection"));
+					iControl->ReStart();
+					break;
+					}
+				}
+			SetState(EFinish);
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(GetLastError() == GetExpectedError()) 
+				{
+				SetTestStepResult(EPass);
+				}
+			else
+				{
+				SetTestStepResult(EFail);
+				}
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+CFullySpecWSPStep_3::CFullySpecWSPStep_3()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecWSPStep_3::~CFullySpecWSPStep_3() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CFullySpecWSPStep_3::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("FullySpecWSP. Requests without connection"));
+	// check preamble result
+	TVerdict verdict = TestStepResult();
+	if (verdict==EPass)
+		{
+		TInt err, ret;
+		iImp = LoadInterface();
+		if (!iImp)
+			{
+			ERR_PRINTF1(_L("Unable to load FullySpecWSP Interface"));
+			verdict = EFail;
+			}
+		else
+			{
+			GetIntFromConfig(ConfigSection(),KWapExError,(TInt&)iExError);
+			ShowConnectionInfo();
+			TBuf8<100> header, body;
+			TPckgBuf<TUint8> idPckg;
+			TWSPStatus wspStatus;
+			TRequestStatus reqStatus;
+			TUint32 timeout = 0;
+			ShowConnectionInfo();
+			iImp->MethodResult(header, body, idPckg, wspStatus, reqStatus, timeout);
+			TRAP(ret, TEST_CHECKL(reqStatus.Int(), iExError, _L("MethodResult Fails not as expected")))
+				if (ret) 
+					verdict = EFail;
+				else
+					{
+					Wap::TPort port;
+					err=iImp->GetLocalPort(port);
+					TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalPort Fails not as expected")))
+						if (ret)
+							verdict = EFail;
+						else
+							{
+							HBufC8* localHost;					
+							err=iImp->GetLocalAddress(localHost);
+							TRAP(ret, TEST_CHECKL(err, iExError, _L("GetLocalAddress Fails not as expected")))
+								if (ret) 
+									verdict = EFail;
+								else
+									{
+									TBuf<100> uri;
+									TUint8 id = 0;
+									err=iImp->MethodInvoke(0x40, uri, header, body, id);
+									TRAP(ret, TEST_CHECKL(err, iExError, _L("MethodInvoke Fails not as expected")))
+										if (ret) 
+											verdict = EFail;
+									}
+							}
+					}
+				UnloadInterface();
+			}
+		}
+	if (verdict==EPass)
+		{
+		INFO_PRINTF1(_L("FullySpecWSP. Requests Fail as expected"));
+		}
+	SetTestStepResult(verdict);
+	return TestStepResult();
+	}
+
+TInt CFullySpecWSPStep_3::CallStateMachine()
+	{
+	return (0);
+	}
+
+CFullySpecWSPStep_4::CFullySpecWSPStep_4()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecWSPStep_4::~CFullySpecWSPStep_4() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CFullySpecWSPStep_4::doTestStepL()
+/** 
+* Test Connect methoths 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("FULLYSPEC-WSP: UnitInvoke-UnitResult"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			
+			TInt bearer, port, repeat, method;
+			TInt error = KErrNone;
+			TPtrC headers;
+			TPtrC body;
+			TPtrC uri;
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port)) iLocalPort = (Wap::TPort)port;
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error)) SetExpectedError(error);
+			if(GetIntFromConfig(ConfigSection(),KWapWSPMethod, method)) iMethod = method;
+			if(GetIntFromConfig(ConfigSection(), KWapRepeat, repeat)) iRepeat = repeat;
+			
+			if(!GetStringFromConfig(ConfigSection(),KWapURI, uri)) 
+				{
+				User::Leave(KErrNoMemory);
+				}
+			GetStringFromConfig(ConfigSection(),KWapWSPHeaders, headers);
+			GetStringFromConfig(ConfigSection(),KWapWSPBody, body);
+			
+			User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidPhonePwr.iUid, ESAPhoneOn));
+			
+			if(UseSimTsy())
+				{
+				User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, 41));
+				}
+				
+			
+			iURI = HBufC16::NewL(uri.Length());
+			
+			iSendHeaders = HBufC8::NewL(headers.Length());
+			
+			iSendBody = HBufC8::NewL(body.Length());
+			
+			iRecvHeaders = HBufC8::NewL(KMaxWapWspHeaderBufferLength);
+			iRecvBody = HBufC8::NewL(KMaxWapWspDataBufferLength);
+
+			TPtr16 tmp16 = iURI->Des();
+			tmp16.Copy(uri);
+			TPtr8 tmp1 = iSendHeaders->Des();
+			tmp1.Copy(headers);
+			TPtr8 tmp2 = iSendBody->Des();
+			tmp2.Copy(body);
+
+			iRecvHeadersBuf.Set(iRecvHeaders->Des());
+			iRecvHeadersBuf.Zero();
+			iRecvBodyBuf.Set(iRecvBody->Des());
+			iRecvBodyBuf.Zero();
+			
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();
+
+			StartScheduler();
+			
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+
+			delete iSendBody;
+			iSendBody=NULL;
+			delete iSendHeaders;
+			iSendHeaders=NULL;
+			delete iURI;
+			iURI=NULL;
+
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWSPStep_4::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	TPtr8 tmp = iSendBody->Des();
+		
+	static TUint total_headers = 0;		
+	static TUint total_body = 0;		
+	static TUint repeat = 0;		
+	
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			total_headers = 0;
+			total_body = 0;
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer, EFalse);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				SetState(EUnitInvoke);
+				}
+			else
+				{
+				SetState(EFinish);
+				}
+			SetLastError(err);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			iControl->ReStart();
+			break;
+
+		case EUnitInvoke:
+			INFO_PRINTF2(_L("EUnitInvoke: Method - 0x%02x"), iMethod);
+			if(iBearer != Wap::EIP)
+			{
+				TRAP(err, WaitForInitializeL());
+			}
+			if(tmp.Length() != 0)
+				{
+				INFO_PRINTF1(_L("Data to send:"));
+				DumpBuf(tmp);
+				}
+			err = iImp->MethodInvoke(iMethod, iURI->Des(), iSendHeaders->Des(), iSendBody->Des(), iTransactionId);
+			INFO_PRINTF3(_L("MethodInvoke() retcode: - dec: %d hex: 0x%08x"), err, err);
+			if(err == KErrNone) 
+				{	
+				SetState(EUnitResult);
+				}
+			else 
+				{
+				SetState(EFinish);
+				}
+			SetLastError(err);
+			iControl->ReStart();
+			break;
+
+		case EUnitResult:
+
+			iRecvHeadersBuf.Set(iRecvHeaders->Des());
+			iRecvHeadersBuf.Zero();
+			iRecvBodyBuf.Set(iRecvBody->Des());
+			iRecvBodyBuf.Zero();
+			iImp->MethodResult(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, iWspStatus, *iStatus, iTimeout);
+			INFO_PRINTF2(_L("EUnitResult: status 0x%08x"), iStatus->Int());
+			activate = 1;
+			SetLastError(err);
+			SetState(EFinish);
+			break;
+			
+		case EFinish:
+			
+			INFO_PRINTF4(_L("EFinish: Status: %d, WSP status: %d (0x%02x)"), iStatus->Int(), iWspStatus, iWspStatus);
+
+			if(iRecvHeadersBuf.Length() != 0)
+				{
+				INFO_PRINTF1(_L("Headers"));
+				total_headers += iRecvHeadersBuf.Length();
+				DumpBuf(iRecvHeadersBuf);
+				}
+
+			if(iRecvBodyBuf.Length() != 0)
+				{
+				INFO_PRINTF1(_L("Body"));
+				total_body += iRecvBodyBuf.Length();
+				DumpBuf(iRecvBodyBuf);
+				}
+
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				if(iStatus->Int() == Wap::EMoreData)
+					{
+					INFO_PRINTF1(_L("NOTE: More data... calling MethodResult()"));
+					SetState(EUnitResult);
+					iControl->ReStart();
+					break;
+					}
+				}
+
+			INFO_PRINTF3(_L("Data received: headers - %d bytes, body - %d bytes"), total_headers, total_body);
+			total_headers = 0;
+			total_body = 0;
+			if((--iRepeat != 0) && (iStatus->Int() == KErrNone))
+				{
+				++repeat;
+				INFO_PRINTF2(_L("REPEAT TEST - %d"), repeat);
+				if(err == KErrNone) 
+					{	
+					SetState(EUnitInvoke);
+					iControl->ReStart();
+					break;
+					}
+				}
+
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			break;
+		}
+	return (activate);
+	}
+
+
+CFullySpecWSPStep_5::CFullySpecWSPStep_5()
+/**
+* Constructor
+*/
+	{
+	}
+
+CFullySpecWSPStep_5::~CFullySpecWSPStep_5() 
+/**
+* Destructor
+*/
+	{
+	}
+
+TVerdict CFullySpecWSPStep_5::doTestStepL()
+/** 
+* Test Cancel Request 
+* @return - TVerdict code
+* 
+*/
+	{
+	INFO_PRINTF1(_L("BoundCLPush. Testing Cancel Request"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			TInt bearer	= 0;
+			TInt error	= KErrNone;
+			TBool secure= EFalse;
+			TBool reconnect= EFalse;
+			SetLastError(KErrNone);
+			
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer)) iBearer = (Wap::TBearer)bearer;
+			if(GetIntFromConfig(ConfigSection(), KWapExError, error)) SetExpectedError(error);
+			if(GetBoolFromConfig(ConfigSection(), KWapSecure, secure)) iSecure = secure;
+			if(GetBoolFromConfig(ConfigSection(),_L("Reconnect"), reconnect)) iReconnect = reconnect;
+			
+			ShowConnectionInfo();			
+
+			error = iImp->Connect(iRemoteHost, iRemotePort, iBearer, iSecure);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), error);
+			if( error == KErrNone)
+				{
+				TBuf8<100> header, body;
+				TPckgBuf<TUint8> idPckg;
+				TWSPStatus wspStatus;
+				TRequestStatus reqStatus;
+				TUint32 timeout=0;
+				iImp->MethodResult(header, body, idPckg, wspStatus, reqStatus, timeout);
+				SetState(EUnitResult);
+				StartScheduler();
+				iControl->ReStart();
+				if(reqStatus==KErrCancel)
+					{
+					SetTestStepResult(EPass);
+					}
+				
+				}
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWSPStep_5::CallStateMachine()
+	{
+	INFO_PRINTF2(_L("CallStateMachine: step [%d]"), State());
+	switch(iState)
+		{
+		case EUnitResult:
+			INFO_PRINTF1(_L("EUnitResult"));
+			iImp->CancelReq();
+			SetState(EFinish);
+			iControl->ReStart();
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(EFail);
+			StopScheduler();
+			break;
+		}
+	return (0);
+	}
+
+
+CFullySpecWSPStep_6::CFullySpecWSPStep_6() 
+	{
+	}
+
+CFullySpecWSPStep_6::~CFullySpecWSPStep_6()
+	{
+	}
+
+TVerdict CFullySpecWSPStep_6::doTestStepL()
+/*
+* Test receive time out
+*/
+	{
+	INFO_PRINTF1(_L("BOUND-WSP: Connect-UnitResult-TimeOut"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			TInt bearer, port;
+			TInt error = KErrNone;
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port))
+				{
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			TInt headerLength, bufLength, timeOut; 
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvHeaderLength, headerLength))
+				{
+				iHeaderRecvBufLength=static_cast<TUint16>(headerLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvBodyLength, bufLength))
+				{
+				iBodyRecvBufLength=static_cast<TUint16>(bufLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapTimeOut, timeOut))
+				{
+				iTimeout=timeOut;
+				}
+			iRecvHeaders = HBufC8::NewL(iHeaderRecvBufLength);
+			iRecvBody = HBufC8::NewL(iBodyRecvBufLength);
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();						
+			// Start state machine
+			StartScheduler();
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWSPStep_6::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer, EFalse);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+				//				WaitForInitializeL();
+				iRecvHeadersBuf.Set(iRecvHeaders->Des());
+				iRecvBodyBuf.Set(iRecvBody->Des());
+				iImp->MethodResult(iRecvHeadersBuf, iRecvBodyBuf, iTransactionIdPckg, iWspStatus, *iStatus, iTimeout);
+				INFO_PRINTF1(_L("MethodResult"));
+				activate = 1;
+				}
+			else
+				{
+				iControl->ReStart();
+				}
+			SetLastError(err);
+			SetState(EFinish);
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			break;
+		}
+	return (activate);
+	}
+
+CFullySpecWSPStep_7::CFullySpecWSPStep_7() 
+	{
+	}
+CFullySpecWSPStep_7::~CFullySpecWSPStep_7()  
+	{
+	}
+TVerdict CFullySpecWSPStep_7::doTestStepL()
+	{
+	INFO_PRINTF1(_L("FULLYSPEC-WSP: Connect-UnitResult-TimeOut"));
+	if(TestStepResult() == EPass )
+		{
+		SetTestStepResult(EFail);
+		iImp = LoadInterface();
+		if(iImp)
+			{
+			SetLastError(KErrNone);
+			TInt bearer, port;
+			TInt error = KErrNone;
+			if(GetIntFromConfig(ConfigSection(),KWapBearer, bearer))
+				{
+				iBearer = static_cast<Wap::TBearer>(bearer);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapLocalPort, port))
+				{
+				iLocalPort = static_cast<Wap::TPort>(port);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapExError, error))
+				{
+				SetExpectedError(error);
+				}
+			TInt headerLength, bufLength; 
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvHeaderLength, headerLength))
+				{
+				iHeaderRecvBufLength=static_cast<TUint16>(headerLength);
+				}
+			if(GetIntFromConfig(ConfigSection(),KWapWSPRecvBodyLength, bufLength))
+				{
+				iBodyRecvBufLength=static_cast<TUint16>(bufLength);
+				}
+			iRecvHeaders = HBufC8::NewL(iHeaderRecvBufLength);
+			iRecvBody = HBufC8::NewL(iBodyRecvBufLength);
+			SetState(EConnect);
+			iControl->ReStart();
+			ShowConnectionInfo();						
+
+			StartScheduler();
+			delete iRecvBody;
+			iRecvBody=NULL;
+			delete iRecvHeaders;
+			iRecvHeaders=NULL;
+			UnloadInterface();
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWSPStep_7::CallStateMachine()
+	{
+	TVerdict verdict = EFail;
+	TInt err = KErrNone;
+	TInt activate = 0;
+	TDes8 headers = iRecvHeaders->Des();
+	TDes8 body = iRecvBody->Des();
+	
+	INFO_PRINTF2(_L("CallStateMachine: state [%d]"), State());
+	switch(iState)
+		{
+		case EConnect:
+			INFO_PRINTF1(_L("EConnect"));
+			err = iImp->Connect(iRemoteHost, iRemotePort, iBearer, EFalse);
+			INFO_PRINTF2(_L("Connection completed with code = %d"), err);
+			if( err == KErrNone)
+				{
+//				WaitForInitializeL();
+				TRequestStatus reqStatus;
+				iImp->MethodResult(headers, body, iTransactionIdPckg, iWspStatus, reqStatus, iTimeout);
+				iImp->MethodResult(headers, body, iTransactionIdPckg, iWspStatus, *iStatus, iTimeout);
+				INFO_PRINTF1(_L("MethodResult"));
+				activate = 1;
+				}
+			else
+				{
+				iControl->ReStart();
+				}
+			SetLastError(err);
+			SetState(EFinish);
+			break;
+			
+		case EFinish:
+			INFO_PRINTF1(_L("EFinish"));
+			if(iStatus->Int() != KErrNone) 
+				{
+				SetLastError(iStatus->Int());
+				}
+			verdict = (GetLastError() == GetExpectedError())?EPass:EFail;
+			SetTestStepResult(verdict);
+			SetState(EIdle);
+			StopScheduler();
+			break;
+			
+		case EIdle:
+		default:
+			INFO_PRINTF2(_L("Error: EIdle or unknown state %d"), State());
+			SetTestStepResult(verdict);
+			StopScheduler();
+			
+			break;
+		}
+	return (activate);
+	}
+
+CFullySpecWSPStep_8::CFullySpecWSPStep_8() 
+	{
+	}
+CFullySpecWSPStep_8::~CFullySpecWSPStep_8()  
+	{
+	}
+TVerdict CFullySpecWSPStep_8::doTestStepL()
+/*
+*	Using invalid values for API parameters:
+*	- Invalid TUid on construction
+*	- Invalid method for MethodInvoke
+*	- Invalid timeout for MethodResult
+*	Note: wrong bearer value has already been implemented as part of test 2
+*/
+	{
+	INFO_PRINTF1(_L("FullySpec-WSP: Wrong parameters testing"));
+	if(TestStepResult() == EPass )
+		{
+		TInt error;
+		if(GetIntFromConfig(ConfigSection(),KWapExError2, error))
+			{
+			iExError2=error;
+			}
+		TInt trapValue;
+		TUid invalidInterfaceUid = {0x00000000}; 	
+		INFO_PRINTF2(_L("Calling new NewL(0x%08X) method"), invalidInterfaceUid);
+		TRAP(trapValue, iImp = CWapFullySpecCLWSPService::NewL(invalidInterfaceUid));
+		TVerdict verdict = (trapValue == iExError2)?EPass:EFail;
+		if (verdict==EFail)
+			{
+			SetTestStepResult(EFail);
+			return TestStepResult();
+			}
+		else
+			{
+			INFO_PRINTF2(_L("CreateImplementation with wrong Uid- Failed as expected with error %d"),trapValue);
+			
+			// Now use the correct Uid
+			iImp = LoadInterface();
+			if(iImp)
+				{
+				SetLastError(KErrNone);
+				TInt error = KErrNone;
+				TInt method;
+				TPtrC headers;
+				TPtrC body;
+				TPtrC uri;
+				
+				if (GetIntFromConfig(ConfigSection(),KWapWSPMethod, method))
+					{
+					iMethod=method;
+					}
+				
+				if(GetIntFromConfig(ConfigSection(), KWapExError, error))
+					{
+					SetExpectedError(error);
+					}
+				
+				if(!GetStringFromConfig(ConfigSection(),KWapURI, uri) || \
+					!GetStringFromConfig(ConfigSection(),KWapWSPHeaders, headers) || \
+					!GetStringFromConfig(ConfigSection(),KWapWSPBody, body))
+					{
+					User::Leave(KErrNoMemory);
+					}
+				
+				iURI = HBufC16::NewL(uri.Length());
+				
+				iSendHeaders = HBufC8::NewL(headers.Length());
+				
+				iSendBody = HBufC8::NewL(body.Length());
+				
+				TPtr16 tmp16 = iURI->Des();
+				tmp16.Copy(uri);
+				TPtr8 tmp = iSendHeaders->Des();
+				tmp.Copy(headers);
+				TPtr8 tmp1 = iSendBody->Des();
+				tmp1.Copy(body);
+				
+				ShowConnectionInfo();						
+				error = iImp->Connect(iRemoteHost, iRemotePort, iBearer, EFalse);
+				INFO_PRINTF2(_L("Connection completed with code = %d"), error);
+				if( error == KErrNone)
+					{
+					error =iImp->MethodInvoke(iMethod, iURI->Des(), iSendHeaders->Des(), iSendBody->Des(), iTransactionId); 
+					}
+				TVerdict verdict = (error == GetExpectedError())?EPass:EFail;
+				SetTestStepResult(verdict);
+				delete iSendBody;
+				iSendBody=NULL;
+				delete iSendHeaders;
+				iSendHeaders=NULL;
+				delete iURI;
+				iURI=NULL;
+				UnloadInterface();
+				}
+			}
+		}
+	return TestStepResult();
+	}
+
+TInt CFullySpecWSPStep_8::CallStateMachine()
+	{
+	return (0);
+	}
+
+CFullySpecWSPStep_9::CFullySpecWSPStep_9() {}
+CFullySpecWSPStep_9::~CFullySpecWSPStep_9()  {}
+TVerdict CFullySpecWSPStep_9::doTestStepL()
+	{
+	return TestStepResult();
+	}
+
+TInt CFullySpecWSPStep_9::CallStateMachine()
+	{
+	return (0);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapFullySpecWSPSteps.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,139 @@
+/**
+* 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:
+*
+*/
+
+
+
+/**
+ @file WapFullySpecWSPSteps.h
+*/
+#if (!defined __FULLYSPECWSP_STEP_H__)
+#define __FULLYSPECWSP_STEP_H__
+#include <test/testexecutestepbase.h>
+#include <in_sock.h>
+#include <es_sock.h>
+#include <wapmessage.h>
+#include "WapStackSuiteStepBase.h"
+
+_LIT(KFullySpecWSPStep_1,"FullySpecWSP_1");
+_LIT(KFullySpecWSPStep_2,"FullySpecWSP_2");
+_LIT(KFullySpecWSPStep_3,"FullySpecWSP_3");
+_LIT(KFullySpecWSPStep_4,"FullySpecWSP_4");
+_LIT(KFullySpecWSPStep_5,"FullySpecWSP_5");
+_LIT(KFullySpecWSPStep_6,"FullySpecWSP_6");
+_LIT(KFullySpecWSPStep_7,"FullySpecWSP_7");
+_LIT(KFullySpecWSPStep_8,"FullySpecWSP_8");
+_LIT(KFullySpecWSPStep_9,"FullySpecWSP_9");
+
+class CFullySpecWSPStepBase : public CWapStackSuiteStepBase
+{
+public:
+	CFullySpecWSPStepBase();
+	~CFullySpecWSPStepBase();
+	CWapFullySpecCLWSPService* LoadInterface();
+	void UnloadInterface();
+protected:
+	CWapFullySpecCLWSPService* iImp;
+};
+
+
+class CFullySpecWSPStep_1 : public CFullySpecWSPStepBase
+	{
+public:
+	CFullySpecWSPStep_1();
+	~CFullySpecWSPStep_1();
+	virtual TVerdict doTestStepL();
+private:
+	};
+
+class CFullySpecWSPStep_2 : public CFullySpecWSPStepBase
+	{
+public:
+	CFullySpecWSPStep_2();
+	~CFullySpecWSPStep_2();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWSPStep_3: public CFullySpecWSPStepBase
+	{
+public:
+	CFullySpecWSPStep_3();
+	~CFullySpecWSPStep_3();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWSPStep_4: public CFullySpecWSPStepBase
+	{
+public:
+	CFullySpecWSPStep_4();
+	~CFullySpecWSPStep_4();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWSPStep_5: public CFullySpecWSPStepBase
+	{
+public:
+	CFullySpecWSPStep_5();
+	~CFullySpecWSPStep_5();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+class CFullySpecWSPStep_6: public CFullySpecWSPStepBase
+	{
+public:
+	CFullySpecWSPStep_6();
+	~CFullySpecWSPStep_6();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CFullySpecWSPStep_7: public CFullySpecWSPStepBase
+	{
+public:
+	CFullySpecWSPStep_7();
+	~CFullySpecWSPStep_7();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CFullySpecWSPStep_8: public CFullySpecWSPStepBase
+	{
+public:
+	CFullySpecWSPStep_8();
+	~CFullySpecWSPStep_8();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+class CFullySpecWSPStep_9: public CFullySpecWSPStepBase
+	{
+public:
+	CFullySpecWSPStep_9();
+	~CFullySpecWSPStep_9();
+	virtual TVerdict doTestStepL();
+	virtual TInt CallStateMachine();
+private:
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapStackSuiteDefs.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,96 @@
+/**
+* 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:
+*
+*/
+
+
+
+/**
+ @file WapStackSuiteDefs.h
+*/
+
+#include <es_wsms.h>
+#include <wapmsgerr.h>
+
+// Although Publish and Subscribe replaces System Agent, 
+// the UIDs we need are still defined by System Agent
+#include <sacls.h>
+
+_LIT(KWapCommonSec, "COMMON");
+
+_LIT(KWapBearer,"Bearer");
+_LIT(KWapRemoteHost,"Remote_Host");
+_LIT(KWapRemotePort,"Remote_Port");
+_LIT(KWapLocalHost,"Local_Host");
+_LIT(KWapLocalPort,"Local_Port");
+_LIT(KLocalPort,"LocalPort");
+_LIT(KRemotePort,"RemotePort");
+_LIT(KWapExError, "ExError");
+_LIT(KWapExError2, "ExError2");
+_LIT(KWapReconnect, "Reconnect");
+_LIT(KWapSecure, "Secure");
+_LIT(KWapRepeat, "Repeat");
+_LIT(KWapData, "Data");
+_LIT(KWapDataType, "Type");
+_LIT(KWapUseSIMTSY, "SimTsy");
+_LIT(KWapDetailedLogging, "DetailedLogging");
+_LIT(KWapDelayPortClosure, "DelayPortClosure");
+_LIT(KWapSIMTSYState, "TsyState");
+_LIT(KWapTimeOut, "TimeOut");
+_LIT(KWapWdpBufLength, "WDPBufLength");
+_LIT(KAwaitLengthCancel, "AwaitLengthCancel");
+_LIT(KMiddleCancel, "MiddleCancel");
+_LIT(KMultiReadCancel, "MultiReadCancel");
+_LIT(KAwaitLengthTwice, "AwaitLengthTwice");
+// WSP 
+_LIT(KWapWSPMethod, "WSPMethod");
+_LIT(KWapWSPHeaders, "WSPHeaders");
+_LIT(KWapWSPBody, "WSPBody");
+_LIT(KWapURI, "WSPURI");
+_LIT(KWapWSPRecvHeaderLength, "WSPHeaderLength");
+_LIT(KWapWSPRecvBodyLength, "WSPBodyLength");
+
+_LIT(KWapWDPStackSuiteLogFile,"WapWDPLog");
+_LIT(KWapPushStackSuiteLogFile,"WapPushLog");
+_LIT(KWapWSPStackSuiteLogFile,"WapWSPLog");
+
+
+_LIT(KWapStartC32,"StartC32");
+
+// For test step panics
+_LIT(KWapStackSuitePanic,"WapStackSuite");
+enum TWapSuitePanicCodes{EDataCorrupt = 1};
+
+// Port for the echo server
+// Could be read from the ini file
+const TInt KEchoPort = 7;
+
+//////////////////////////////////////////////////////////////////////////////
+// Wap Address / Port Settings
+//////////////////////////////////////////////////////////////////////////////
+/*
+	EWapPortUnspecified = -1,  // Unspecified
+	EWapPortWsp         = 9200,  // Connectionless session protocol
+	EWapPortWspWtp      = 9201,  // Connection oriented session protocol
+	EWapPortWspWtls     = 9202,  // Secure connectionless session protocol
+	EWapPortWspWtpWtls  = 9203,  // Secure connection oriented session protocol
+	EWapPortVCard       = 9204,  // vCard
+	EWapPortVCardWtls   = 9206,  // Secure vCard
+	EWapPortVCal        = 9205,  // vCal
+	EWapPortVCalWtls    = 9207   // Secure vCal
+	};
+*/
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapStackSuiteServer.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,236 @@
+// 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:
+// WAP stack test suite server
+// 
+//
+
+/**
+ @file
+ @internalComponent
+*/
+
+// Include your own server header file and step header file(s) here
+#include "WapStackSuiteServer.h"
+
+#include "WapBoundWDPSteps.h"
+#include "WapBoundCLPushSteps.h"
+#include "WapBoundWSPSteps.h"
+#include "WapFullySpecCLPushSteps.h"
+#include "WapFullySpecWDPSteps.h"
+#include "WapFullySpecWSPSteps.h"
+#include <ecom/ecom.h>
+
+_LIT(KServerName,"WapStackSuite");
+CWapStackSuite* CWapStackSuite::NewL()
+/**
+ * @return - Instance of the test server
+ * Same code for Secure and non-secure variants
+ * Called inside the MainL() function to create and start the
+ * CTestServer derived server.
+ */
+	{
+	CWapStackSuite * server = new (ELeave) CWapStackSuite();
+	CleanupStack::PushL(server);
+	// CServer base class call
+	server->StartL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+
+
+LOCAL_C void MainL()
+	{
+#if (defined __DATA_CAGING__)
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+#endif
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CWapStackSuite* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CWapStackSuite::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+
+GLDEF_C TInt E32Main()
+/**
+ * @return - Standard Epoc error code on process exit
+ * Secure variant only
+ * Process entry point. Called by client using RProcess API
+ */
+	{
+	__UHEAP_MARK;
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+CTestStep* CWapStackSuite::CreateTestStep(const TDesC& aStepName)
+/**
+ * @return - A CTestStep derived instance
+ * Secure and non-secure variants
+ * Implementation of CTestServer pure virtual
+ */
+	{
+	CTestStep* testStep = NULL;
+	// Creating your own test steps here
+	//*************************************
+	// BOUND connection tests
+	//*************************************
+
+	// Bound WDP steps [1 - 9]
+	if(aStepName == KBoundWDPStep_1) 
+		testStep = new CBoundWDPStep_1();
+	else if(aStepName == KBoundWDPStep_2) 
+		testStep = new CBoundWDPStep_2();
+	else if(aStepName == KBoundWDPStep_3) 
+		testStep = new CBoundWDPStep_3();
+	else if(aStepName == KBoundWDPStep_4) 
+		testStep = new CBoundWDPStep_4();
+	else if(aStepName == KBoundWDPStep_5) 
+		testStep = new CBoundWDPStep_5();
+	else if(aStepName == KBoundWDPStep_6) 
+		testStep = new CBoundWDPStep_6();
+	else if(aStepName == KBoundWDPStep_7) 
+		testStep = new CBoundWDPStep_7();
+	else if(aStepName == KBoundWDPStep_8) 
+		testStep = new CBoundWDPStep_8();
+	else if(aStepName == KBoundWDPStep_9) 
+		testStep = new CBoundWDPStep_9();
+	else if(aStepName == KBoundWDPStep_OutOfMemory) 
+		testStep = new CBoundWDPStep_OutOfMemory();
+
+	// Bound Push tests [1 - 9]
+	else if(aStepName == KBoundCLPushStep_1) 
+		testStep = new CBoundCLPushStep_1();
+	else if(aStepName == KBoundCLPushStep_2) 
+		testStep = new CBoundCLPushStep_2();
+	else if(aStepName == KBoundCLPushStep_3) 
+		testStep = new CBoundCLPushStep_3();
+	else if(aStepName == KBoundCLPushStep_4) 
+		testStep = new CBoundCLPushStep_4();
+	else if(aStepName == KBoundCLPushStep_5) 
+		testStep = new CBoundCLPushStep_5();
+	else if(aStepName == KBoundCLPushStep_6) 
+		testStep = new CBoundCLPushStep_6();
+	else if(aStepName == KBoundCLPushStep_7) 
+		testStep = new CBoundCLPushStep_7();
+	else if(aStepName == KBoundCLPushStep_8) 
+		testStep = new CBoundCLPushStep_8();
+	else if(aStepName == KBoundCLPushStep_9) 
+		testStep = new CBoundCLPushStep_9();
+	
+	// Bound WSP tests [1 - 9]
+	else if(aStepName == KBoundWSPStep_1) 
+		testStep = new CBoundWSPStep_1();
+	else if(aStepName == KBoundWSPStep_2) 
+		testStep = new CBoundWSPStep_2();
+	else if(aStepName == KBoundWSPStep_3) 
+		testStep = new CBoundWSPStep_3();
+	else if(aStepName == KBoundWSPStep_4) 
+		testStep = new CBoundWSPStep_4();
+	else if(aStepName == KBoundWSPStep_5) 
+		testStep = new CBoundWSPStep_5();
+	else if(aStepName == KBoundWSPStep_6) 
+		testStep = new CBoundWSPStep_6();
+	else if(aStepName == KBoundWSPStep_7) 
+		testStep = new CBoundWSPStep_7();
+	else if(aStepName == KBoundWSPStep_8) 
+		testStep = new CBoundWSPStep_8();
+	else if(aStepName == KBoundWSPStep_9) 
+		testStep = new CBoundWSPStep_9();
+
+	//*************************************
+	// FULLY SPECIFIED connection tests
+	//*************************************
+
+	// Fully spec. WDP [1 - 9
+	else if(aStepName == KFullySpecWDPStep_1) 
+		testStep = new CFullySpecWDPStep_1();
+	else if(aStepName == KFullySpecWDPStep_2) 
+		testStep = new CFullySpecWDPStep_2();
+	else if(aStepName == KFullySpecWDPStep_3) 
+		testStep = new CFullySpecWDPStep_3();
+	else if(aStepName == KFullySpecWDPStep_4) 
+		testStep = new CFullySpecWDPStep_4();
+	else if(aStepName == KFullySpecWDPStep_5) 
+		testStep = new CFullySpecWDPStep_5();
+	else if(aStepName == KFullySpecWDPStep_6) 
+		testStep = new CFullySpecWDPStep_6();
+	else if(aStepName == KFullySpecWDPStep_7) 
+		testStep = new CFullySpecWDPStep_7();
+	else if(aStepName == KFullySpecWDPStep_8) 
+		testStep = new CFullySpecWDPStep_8();
+	else if(aStepName == KFullySpecWDPStep_9) 
+		testStep = new CFullySpecWDPStep_9();
+	
+	// Fully spec. Push [1 - 9]
+	else if(aStepName == KFullySpecCLPushStep_1) 
+		testStep = new CFullySpecCLPushStep_1();
+	else if(aStepName == KFullySpecCLPushStep_2) 
+		testStep = new CFullySpecCLPushStep_2();
+	else if(aStepName == KFullySpecCLPushStep_3) 
+		testStep = new CFullySpecCLPushStep_3();
+	else if(aStepName == KFullySpecCLPushStep_4) 
+		testStep = new CFullySpecCLPushStep_4();
+	else if(aStepName == KFullySpecCLPushStep_5) 
+		testStep = new CFullySpecCLPushStep_5();
+	else if(aStepName == KFullySpecCLPushStep_6) 
+		testStep = new CFullySpecCLPushStep_6();
+	else if(aStepName == KFullySpecCLPushStep_7) 
+		testStep = new CFullySpecCLPushStep_7();
+	else if(aStepName == KFullySpecCLPushStep_8) 
+		testStep = new CFullySpecCLPushStep_8();
+	else if(aStepName == KFullySpecCLPushStep_9) 
+		testStep = new CFullySpecCLPushStep_9();
+
+	// Fully spec. WSP [1 - 9]
+	else if(aStepName == KFullySpecWSPStep_1) 
+		testStep = new CFullySpecWSPStep_1();
+	else if(aStepName == KFullySpecWSPStep_2) 
+		testStep = new CFullySpecWSPStep_2();
+	else if(aStepName == KFullySpecWSPStep_3) 
+		testStep = new CFullySpecWSPStep_3();
+	else if(aStepName == KFullySpecWSPStep_4) 
+		testStep = new CFullySpecWSPStep_4();
+	else if(aStepName == KFullySpecWSPStep_5) 
+		testStep = new CFullySpecWSPStep_5();
+	else if(aStepName == KFullySpecWSPStep_6) 
+		testStep = new CFullySpecWSPStep_6();
+	else if(aStepName == KFullySpecWSPStep_7)
+		testStep = new CFullySpecWSPStep_7();
+	else if(aStepName == KFullySpecWSPStep_8) 
+		testStep = new CFullySpecWSPStep_8();
+	else if(aStepName == KFullySpecWSPStep_9) 
+		testStep = new CFullySpecWSPStep_9();
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapStackSuiteServer.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,38 @@
+/**
+* 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:
+*
+*/
+
+
+
+/**
+ @file WapStackSuiteServer.h
+*/
+
+#if (!defined __WAPSTACK_SUITE_SERVER_H__)
+#define __WAPSTACK_SUITE_SERVER_H__
+#include <test/testexecuteserverbase.h>
+
+class CWapStackSuite : public CTestServer
+	{
+public:
+	IMPORT_C TInt NewServer();
+	static CWapStackSuite* NewL();
+	// Base class pure virtual override
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+private:
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapStackSuiteStepBase.cpp	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,410 @@
+// 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:
+//
+
+/**
+ @file
+ @internalComponent
+*/
+
+#include <c32comm.h>
+#include <etel.h>
+#include <wapmessage.h>
+#include <simtsy.h>
+#include "WapStackSuiteDefs.h"
+#include "WapStackSuiteStepBase.h"
+
+CWapStackSuiteStepBase::CWapStackSuiteStepBase() : iLenBuffer(0), iLength(iLenBuffer), iRecvBuf(0,0), iRecvHeadersBuf(0,0), iRecvBodyBuf(0,0)
+	{
+	SetTestStepName(KWapWDPStackSuiteLogFile);
+	iSendBuffPtr = NULL;
+	iRecvBuffPtr = NULL;
+	iRecvHeaders = NULL; 
+	iRecvBody = NULL;
+	iURI = NULL;
+	iSendHeaders = NULL;
+	iSendBody = NULL;
+	}
+
+CWapStackSuiteStepBase::~CWapStackSuiteStepBase()
+	{
+	if(iSendBuffPtr) delete iSendBuffPtr;
+	if(iRecvBuffPtr) delete iRecvBuffPtr;
+	if(iRecvHeaders) delete iRecvHeaders;
+	if(iRecvBody) delete iRecvBody;
+	if(iURI) delete iURI;
+	if(iSendHeaders) delete iSendHeaders;
+	if(iSendBody) delete iSendBody;
+	}
+
+TVerdict CWapStackSuiteStepBase::doTestStepPreambleL()
+/**
+* @return - TVerdict
+* Implementation of CTestStep base class virtual
+* Load serial drivers
+* Do all initialisation common to derived classes in here.
+*/
+	{
+	__UHEAP_MARK;
+	TInt err = KErrNone;
+	CActiveScheduler* sheduler;
+	sheduler = new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sheduler);
+	SetScheduler(sheduler);
+
+	iControl = CActiveControl::NewL(this);
+	sheduler->Add(iControl);
+	iStatus = iControl->Status();
+
+
+	err=User::LoadPhysicalDevice(PDD_NAME);
+    if (err!=KErrNone && err!=KErrAlreadyExists) User::Leave(err);
+
+    err=User::LoadLogicalDevice(LDD_NAME );
+    if (err!=KErrNone && err!=KErrAlreadyExists) User::Leave(err);
+
+	TBool startC32 = ETrue;
+	GetBoolFromConfig(ConfigSection(),KWapStartC32, startC32);
+	if(startC32)
+	{
+		_LIT(KPhbkSyncCMI, "phbsync.cmi");
+		err = StartC32WithCMISuppressions(KPhbkSyncCMI);
+		ERR_PRINTF2(TRefByValue<const TDesC>(_L("Start Comms Process Status = %d\n")), err);
+		if(err!=KErrNone && err!=KErrAlreadyExists)
+		    {
+		    User::Leave(err);
+			}
+	    }
+
+	LoadConfig();
+
+    SetTestStepResult(EPass);
+	return TestStepResult();
+	}
+
+TVerdict CWapStackSuiteStepBase::doTestStepPostambleL()
+	{
+
+	delete iControl;
+	iControl = NULL;
+	delete Scheduler();
+	if(iSendBuffPtr) delete iSendBuffPtr;
+	iSendBuffPtr = NULL;
+	if(iRecvBuffPtr) delete iRecvBuffPtr;
+	iRecvBuffPtr = NULL;
+	__UHEAP_MARKEND;
+	return TestStepResult();
+	}
+
+void CWapStackSuiteStepBase::LoadConfig()
+	{
+	TPtrC16 remote_host, local_host;
+
+	GetIntFromConfig(KWapCommonSec, KWapBearer, (TInt&)iBearer);
+	if(GetStringFromConfig(KWapCommonSec, KWapRemoteHost, remote_host))
+		{
+		iRemoteHost.Copy(remote_host);
+		}
+	if(GetStringFromConfig(KWapCommonSec, KWapLocalHost, local_host))
+		{
+		iLocalHost.Copy(local_host);
+		}
+	TInt remote, local, timeOut;
+	if(GetIntFromConfig(KWapCommonSec, KWapRemotePort, remote))
+		{
+		iRemotePort = static_cast<Wap::TPort>(remote);
+		}
+	if(GetIntFromConfig(KWapCommonSec, KWapLocalPort, local))
+		{
+		iLocalPort = static_cast<Wap::TPort>(local);
+		}
+	if(GetIntFromConfig(KWapCommonSec,KWapTimeOut, timeOut))
+		{
+		iTimeout=timeOut;
+		}
+	TInt headerLength, bufLength, bufLen, method; 
+	if(GetIntFromConfig(KWapCommonSec,KWapWSPRecvHeaderLength, headerLength))
+		{
+		iHeaderRecvBufLength=static_cast<TUint16>(headerLength);
+		}
+	if(GetIntFromConfig(KWapCommonSec,KWapWSPRecvBodyLength, bufLength))
+		{
+		iBodyRecvBufLength=static_cast<TUint16>(bufLength);
+		}
+	if(GetIntFromConfig(KWapCommonSec,KWapWdpBufLength, bufLen))
+		{
+		iWdpRecvBufLength=static_cast<TUint16>(bufLen);
+		}
+	if(GetIntFromConfig(KWapCommonSec,KWapWSPMethod, method))
+		{
+		iMethod = static_cast<TUint16>(method);
+		}
+	else
+		{
+		iMethod = 64; // default method GET
+		}
+	GetIntFromConfig(KWapCommonSec, KWapExError, iExError);
+	if(!GetIntFromConfig(KWapCommonSec, KWapRepeat, iRepeat))
+		{
+		iRepeat = 1;
+		};
+
+	GetIntFromConfig(KWapCommonSec, KWapExError2, iExError2);
+	GetBoolFromConfig(KWapCommonSec, KWapUseSIMTSY, iUseSIMTSY);
+	GetBoolFromConfig(KWapCommonSec, KWapDetailedLogging, iDetailedLogging);
+	GetBoolFromConfig(KWapCommonSec, KAwaitLengthCancel, iAwaitLengthCancel);
+	GetBoolFromConfig(KWapCommonSec, KMiddleCancel, iMiddleCancel);
+	GetBoolFromConfig(KWapCommonSec, KMultiReadCancel, iMultiReadCancel);
+	GetBoolFromConfig(KWapCommonSec, KAwaitLengthTwice, iAwaitLengthTwice);
+	GetBoolFromConfig(KWapCommonSec, KWapDelayPortClosure, iDelayPortClosure);
+	GetIntFromConfig(KWapCommonSec,KWapSIMTSYState, iSimTsyState);
+	
+	TInt result;
+	// if using SIMTSY, we need to define the test number property
+	// since we set the test number before loading SIMTSY
+	if (iUseSIMTSY)
+		{
+		result = RProperty::Define(KUidPSSimTsyCategory, KPSSimTsyTestNumber, RProperty::EInt);
+		__ASSERT_ALWAYS(result == KErrNone || result == KErrAlreadyExists,User::Panic(KWapStackSuitePanic, EDataCorrupt));
+		}
+
+	// Phone power property, normally defined by UIKON, is not defined by any
+	// startup code in console builds - we're on our own with this one.
+	result = RProperty::Define(KUidSystemCategory, KUidPhonePwr.iUid, RProperty::EInt);
+	__ASSERT_ALWAYS(result == KErrNone || result == KErrAlreadyExists,User::Panic(KWapStackSuitePanic, EDataCorrupt));
+
+	}
+
+TInt CWapStackSuiteStepBase::CallStateMachine()
+	{
+	return (0);
+	}
+
+void CWapStackSuiteStepBase::StartScheduler()
+	{
+	INFO_PRINTF1(_L("Star Scheduler"));
+	CActiveScheduler::Start();
+	}
+
+void CWapStackSuiteStepBase::StopScheduler()
+	{
+	INFO_PRINTF1(_L("Stop Scheduler"));
+	CActiveScheduler::Stop();
+	}
+
+void CWapStackSuiteStepBase::WaitForInitializeL()
+	{
+	_LIT(KMMTSY,"MM");
+	_LIT(KSIMTSY,"SIM");
+
+	TName tsy;
+	
+	if(UseSimTsy())
+		{
+		tsy=KSIMTSY;
+		}
+	else
+		{
+		tsy = KMMTSY;
+		}
+
+	RTelServer serverT;
+	User::LeaveIfError(serverT.Connect());
+	CleanupClosePushL(serverT);
+	User::LeaveIfError(serverT.LoadPhoneModule(tsy));
+	INFO_PRINTF2(_L("%S TSY loaded"), &tsy);
+
+	// Find the phone corresponding to this TSY and open a number of handles on it
+	TInt numPhones;
+	User::LeaveIfError(serverT.EnumeratePhones(numPhones));
+	RPhone phone;
+	while (numPhones--)
+		{
+		TName phoneTsy;
+		User::LeaveIfError(serverT.GetTsyName(numPhones,phoneTsy));
+		if (phoneTsy.CompareF(tsy)==KErrNone)
+			{
+			RTelServer::TPhoneInfo info;
+			User::LeaveIfError(serverT.GetPhoneInfo(numPhones,info));
+			User::LeaveIfError(phone.Open(serverT,info.iName));
+			CleanupClosePushL(phone);
+			const TInt err = phone.Initialise();
+			User::LeaveIfError(err);
+			CleanupStack::PopAndDestroy(&phone);
+			break;
+			}
+		}
+	CleanupStack::PopAndDestroy(&serverT);
+	}
+
+void CWapStackSuiteStepBase::DumpBuf(const TDesC8& aBuf)
+	{
+	if(!DetailedLogging()) return;
+	TBuf16<100> dumpbuf;
+	TInt totLen = aBuf.Length();
+
+	INFO_PRINTF1(_L("-------------------------------------------------------------------------"));
+	INFO_PRINTF2(_L("Buffer: %d bytes"), totLen);
+	INFO_PRINTF1(_L("-------------------------------------------------------------------------"));
+
+	for (TInt i = 0; i < totLen; i += 16)
+		{
+		dumpbuf.FillZ(100);
+		dumpbuf.Zero();
+		dumpbuf.AppendFormat(_L("%04x  "),i);
+		TInt j = 0;
+		TInt thisRow = Min(16,totLen - j - i);
+		for (j = 0; j < 16; j++)
+			{
+			if (j < thisRow)
+				{
+				TText8 chr = aBuf[i + j];
+				dumpbuf.AppendFormat(_L("%02x "),chr);
+				}
+			else
+				dumpbuf.AppendFormat(_L("   "));
+			}
+		dumpbuf.AppendFormat(_L("   "));
+		for (j = 0; j < thisRow; j++)
+			{
+			TText8 chr = aBuf[i + j];
+			TChar c(chr);
+			if (!c.IsPrint())
+				{
+					chr='.';
+				}
+			// NOTE: "<" & ">" are HTML tags (change to "[" & "]")
+			if((chr == '<') || (chr == '>'))
+				{ 
+				chr+=31;
+				}
+				dumpbuf.AppendFormat(_L("%c"),chr);
+			}
+		INFO_PRINTF2(_L("%s"), dumpbuf.Ptr());
+		}
+	INFO_PRINTF1(_L("-------------------------------------------------------------------------"));
+	}
+
+void CWapStackSuiteStepBase::ShowConnectionInfo()
+{
+	if(!DetailedLogging()) return;
+
+	TBuf16<WAP_MAX_HOST_NAME> host;
+	TBuf16<100> infostr;
+
+	INFO_PRINTF1(_L("-------------------------------------------------------------------------"));
+	INFO_PRINTF1(_L("Connection Info:"));
+	INFO_PRINTF1(_L("-------------------------------------------------------------------------"));
+
+	infostr.FillZ(100);
+	switch(iBearer)
+	{
+	case Wap::EAll: infostr.Copy(_L("EAll"));
+		break;
+	case Wap::EIP: infostr.Copy(_L("EIP"));
+		break;
+	case Wap::ESMS7: infostr.Copy(_L("ESMS7"));
+		break;
+	case Wap::ESMS: infostr.Copy(_L("ESMS"));
+		break;
+	case Wap::EWAPSMS7: infostr.Copy(_L("EWAPSMS7"));
+		break;
+	case Wap::EWAPSMS: infostr.Copy(_L("EWAPSMS"));
+		break;
+	default:
+		break;
+	}
+
+	INFO_PRINTF2(_L("Bearer      : %s"), infostr.Ptr());
+	host.FillZ(WAP_MAX_HOST_NAME);
+	host.Copy(iRemoteHost);
+	INFO_PRINTF2(_L("Remote Host : %s"), host.Ptr());
+	INFO_PRINTF2(_L("Remote Port : %d"),iRemotePort);
+	host.FillZ(100);
+	host.Copy(iLocalHost);
+	INFO_PRINTF2(_L("Local Host  : %s"), host.Ptr());
+	INFO_PRINTF2(_L("Local Port  : %d"), iLocalPort);
+	infostr.FillZ(100);
+	switch(iSecure)
+	{
+	case ETrue: infostr.Copy(_L("TRUE"));
+		break;
+	case EFalse: infostr.Copy(_L("FALSE"));
+		break;
+	default:
+		break;
+	}
+	INFO_PRINTF2(_L("Secure      : %s"), infostr.Ptr());
+	infostr.FillZ(100);
+	switch(iReconnect)
+	{
+	case ETrue: infostr.Copy(_L("TRUE"));
+		break;
+	case EFalse: infostr.Copy(_L("FALSE"));
+		break;
+	default:
+		break;
+	}
+	INFO_PRINTF2(_L("Timeout     : %d"), iTimeout);
+	INFO_PRINTF2(_L("Reconnect   : %s"), infostr.Ptr());
+	INFO_PRINTF2(_L("ExitCode    : %d"), iExError);
+	INFO_PRINTF2(_L("Repeat      : %d"), iRepeat);
+
+	INFO_PRINTF1(_L("-------------------------------------------------------------------------"));
+}
+
+/**
+	Active controller
+*/
+CActiveControl* CActiveControl::NewL(MControlNotify* aControl)
+	{
+	CActiveControl* self = new(ELeave) CActiveControl(aControl);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+void CActiveControl::ConstructL()
+	{
+	}
+
+CActiveControl::CActiveControl(MControlNotify* aControl)
+: CActive(EPriorityStandard)
+	{
+	iControl = aControl;
+	}
+
+CActiveControl::~CActiveControl()
+	{
+	}
+
+void CActiveControl::ReStart()
+	{
+	TRequestStatus* status = &iStatus;
+	SetActive();
+	User::RequestComplete(status, KErrNone);
+	}
+
+void CActiveControl::RunL()
+	{
+	if(iControl->CallStateMachine())
+		{
+			SetActive();
+		}
+	}
+
+void CActiveControl::DoCancel()
+	{
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/src/WapStackSuiteStepBase.h	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,167 @@
+/**
+* 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:
+*
+*/
+
+
+
+/**
+ @file WapStackSuiteStepBase.h
+*/
+
+#if (!defined __WAPSTACK_SUITE_STEP_BASE__)
+#define __WAPSTACK_SUITE_STEP_BASE__
+#include <test/testexecutestepbase.h>
+#include <es_wsms.h>
+
+#define WAP_MAX_HOST_NAME 128
+
+#if defined (__WINS__)
+#define PDD_NAME _L("ECDRV")
+#define PDD_NAME2 _L("ECDRV")
+#define LDD_NAME _L("ECOMM")
+#else
+#define PDD_NAME _L("EUART1")
+#define LDD_NAME _L("ECOMM")
+#endif
+
+typedef enum
+	{
+	EIdle,
+	EConnect,
+	ESend,
+	EAwaitSize,
+	EReceive,
+	EMutipleReceive,
+	EAwaitPush,
+	EUnitInvoke,
+	EUnitResult,
+	EFinish,
+	EAbortTest
+	} TWapStep;
+const TUint KMaxWapWdpPduBufferLength=1024;
+const TUint KMaxWapWspHeaderBufferLength=256;
+const TUint KMaxWapWspDataBufferLength=1024;
+class MControlNotify
+{
+public:
+	virtual TInt CallStateMachine() = 0;
+};
+
+class CActiveControl : public CActive
+{
+public:
+	static CActiveControl* NewL(MControlNotify* aControl);
+	CActiveControl(MControlNotify* aControl);
+	~CActiveControl();
+	void ConstructL();
+	virtual void RunL();
+	virtual void DoCancel();
+	virtual void ReStart();
+	inline TRequestStatus* Status() {return &iStatus;}
+public:
+	MControlNotify* iControl;
+};
+
+class CWapStackSuiteStepBase : public CTestStep, public MControlNotify
+	{
+public:
+	CWapStackSuiteStepBase();
+	virtual ~CWapStackSuiteStepBase();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TInt CallStateMachine();
+	void StartScheduler();
+	void StopScheduler();
+	void WaitForInitializeL();
+	inline void SetScheduler(CActiveScheduler* aScheduler) {iScheduler = aScheduler;}
+	inline CActiveScheduler* Scheduler() {return iScheduler;}
+	inline void SetState(TWapStep aState) { iState = aState; }
+	inline TWapStep State() { return iState; }
+	inline void SetLastError(TInt aError) { iLastError = aError; }
+	inline TInt GetLastError() { return iLastError; }
+	inline void SetExpectedError(TInt aError) {iExError = aError; }
+	inline TInt GetExpectedError() { return iExError; }
+	inline TBool UseSimTsy() { return iUseSIMTSY; }
+	inline TBool DetailedLogging() { return iDetailedLogging; }
+	void LoadConfig();
+	void DumpBuf(const TDesC8& aBuf);
+	void ShowConnectionInfo();
+protected:
+	CActiveControl* iControl;
+	TWapStep iState;
+	TRequestStatus* iStatus;
+
+	//Predefined value in .ini file
+	TInt iExError;
+	TInt iExError2;
+	TInt iRepeat;
+	TUint32 iTimeout;
+	TBool iSecure;
+	TBool iReconnect;
+	TBool iUseSIMTSY;
+	TBool iAwaitLengthCancel;
+	TBool iMiddleCancel;
+	TBool iMultiReadCancel;
+	TBool iAwaitLengthTwice;
+	TBool iDetailedLogging;
+	TBool iDelayPortClosure;
+	TInt iSimTsyState;
+	TUint16 iWdpRecvBufLength;
+	TUint16 iHeaderRecvBufLength;
+	TUint16 iBodyRecvBufLength;
+	Wap::TBearer iBearer;
+	Wap::TPort iLocalPort;
+	Wap::TPort iRemotePort;
+	TBuf8<WAP_MAX_HOST_NAME> iRemoteHost;
+	TBuf8<WAP_MAX_HOST_NAME> iLocalHost;
+	TInetAddr iRemoteAddr;
+	TInetAddr iLocalAddr;
+	TInt iRmtPort;
+	TInt iLclPort;	
+	//For WDP sending and receiving
+	HBufC8* iSendBuffPtr;
+	HBufC8* iRecvBuffPtr;
+	TUint16 iLenBuffer;
+	TPckg<TUint16> iLength;
+	TPtr8 iRecvBuf;
+	TBool iTruncated;
+	Wap::TPort iRecvRemotePort;
+	TBuf8<WAP_MAX_HOST_NAME> iRecvRemoteHost;
+	TBuf8<KMaxWapWdpPduBufferLength> iMaxWdpRecvBuffer;
+
+
+	//For both WSP Sending;
+	TUint8 iTransactionId;
+	TUint iMethod;
+	HBufC16* iURI;
+	HBufC8* iSendHeaders;
+	HBufC8* iSendBody;
+
+	//For WSP Receiving and Push
+	TPckgBuf<TUint8> iTransactionIdPckg;
+	TWSPStatus iWspStatus;
+	HBufC8* iRecvHeaders;
+	HBufC8* iRecvBody;
+	TPtr8 iRecvHeadersBuf;
+	TPtr8 iRecvBodyBuf;
+	TBuf8<KMaxWapWspHeaderBufferLength> iMaxWspHeaderRecvBuffer;
+	TBuf8<KMaxWapWspDataBufferLength> iMaxWspDataRecvBuffer;
+private:
+	CActiveScheduler* iScheduler;
+	TInt iLastError;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/testdata/UDPPush.ini	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,48 @@
+[COMMON]
+Bearer=3
+Remote_Host=127.0.0.1
+Local_Host= 127.0.0.1
+Remote_Port=2948
+Local_Port=2948
+TimeOut=0
+ExError=0
+ExError2=0
+SimTsy=false
+TsyState=411
+WSPHeaderLength=50
+WSPBodyLength=50
+WDPBufLength=30
+AwaitLengthCancel=false
+MiddleCancel=false
+MultiReadCancel=false
+AwaitLengthTwice=false
+DetailedLogging=true
+Secure=0
+WSPMethod=1
+WSPHeaders=GET:
+WSPBody=EMPTY-001-002-003-004-005-006-007-END
+WSPURI=http://wap.wapgateway.com
+
+
+[Test_1]
+Bearer=1
+Remote_Port=2949
+Local_Port=2948
+Remote_Host=127.0.0.1
+Local_Host= 127.0.0.1
+StartC32=true
+
+[Test_2]
+Bearer=2
+RemotePort=2948
+LocalPort=2949
+Remote_Host=127.0.0.1
+Local_Host= 127.0.0.1
+StartC32=false
+
+//Remote_Host=10.32.194.36
+//Local_Host=10.32.194.36
+//Remote_Host=127.0.0.1
+//Local_Host= 127.0.0.1
+//Remote_Host=10.32.194.75
+//Local_Host=10.32.194.75
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/testdata/WSP.ini	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,116 @@
+[COMMON]
+Bearer=1
+Remote_Host=10.32.194.45
+//Remote_Host=10.32.194.45
+//Remote_Host=192.168.20.11
+Local_Host=10.32.194.45
+Remote_Port=9200
+Local_Port=9200
+Secure=0
+Repeat=1
+TimeOut=0
+ExError=0
+ExError2=0
+SimTsy=false
+TsyState=411
+AwaitLengthCancel=false
+MiddleCancel=false
+MultiReadCancel=false
+AwaitLengthTwice=false
+WSPHeaderLength=50
+WSPBodyLength=50
+WDPBufLength=30
+WSPMethod=64
+
+[Test_9.1]
+Repeat=2
+WSPURI=http://10.35.2.4/wap/wstiot/welcome.wml
+//WSPHeaders=Accept-Language: English
+
+[Test_9.2]
+WSPURI=http://10.35.2.4/wap/wstiot/welcome.wml
+WSPHeaders=my1:125, my2:abcdefghijklmnopqrstuvxuz, m:y
+
+[Test_9.3]
+WSPURI=http://10.35.2.4:80/wap/wstiot/size1k.txt
+WSPHeaders=125:125
+
+[Test_9.4]
+WSPURI=http://10.35.2.4:80/wap/wstiot/small.wml
+WSPHeaders=Cat sat on the mat:125
+
+[Test_9.5]
+WSPURI=http://10.35.2.4/wap/wstiot/large.wml
+WSPHeaders=A=10:125
+
+[Test_9.6]
+WSPURI=http://10.35.2.4:80/wap/wstiot/large.wml
+WSPHeaders=Accept-Language:
+
+[Test_9.7]
+WSPURI=http://10.35.2.4:80/wap/wstiot/large.wml
+WSPHeaders=WAP:125
+
+[Test_9.8]
+WSPURI=http://10.35.2.4/wap/wstiot/large.wml
+WSPHeaders=::;
+
+[Test_9.9]
+WSPURI=http://10.35.2.4/wap/wstiot/welcome.wml
+WSPHeaders=Test-Case:CLIENT
+
+[Test_9.10]
+WSPURI=http://10.35.2.4/wap/wstiot/welcome.wml
+WSPHeaders=http://10.35.2.4/wap/wstiot/welcome.wml
+
+[Test_9.11]
+WSPMethod=66
+WSPURI=http://10.35.2.4/wap/wstiot/
+WSPHeaders=Accept-Language: English
+
+[Test_9.12]
+WSPURI=http://10.35.2.4:80/wap/wstiot/large.wml
+WSPHeaders=User-Agent:symbianAgentNameLongStringOne1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNMLongStringTwo1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNMLongStringThree1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM
+
+[Test_9.13]
+WSPMethod=96
+WSPURI=http://10.35.2.4/perl/dumpform.pl
+WSPHeaders=Accept-Language: English
+WSPBody=WSPTESTWSPTEST
+
+[Test_9.14]
+WSPMethod=97
+WSPURI=http://10.35.2.4/upload/tao.txt
+WSPHeaders=Accept-Language: English
+WSPBody=Tao Te Ching: An English-Language Interpolation 1. The Way The Way that can be experienced is not true; The world that can be constructed is not real. The Way manifests all that happens and may happen; The world represents all that exists and may exist. To experience without abstraction is to sense the world; To experience with abstraction is to know the world. These two experiences are indistinguishable; Their construction differs but their effect is the same. Beyond the gate of experience flows the Way, Which is ever greater and more subtle than the world. 2. Abstraction When beauty is abstracted Then ugliness has been implied; When good is abstracted Then evil has been implied. So alive and dead are abstracted from nature, Difficult and easy abstracted from progress, Long and short abstracted from contrast, High and low abstracted from depth, Song and speech abstracted from melody, After and before abstracted from sequence. The sage experiences without abstraction, And accomplishes without action; He accepts the ebb and flow of things, Nurtures them, but does not own them, And lives, but does not dwell. 3. Without Action Not praising the worthy prevents contention, Not esteeming the valuable prevents theft, Not displaying the beautiful prevents desire. In this manner the sage governs people: Emptying their minds, Filling their bellies, Weakening their ambitions, And strengthening their bones. If people lack knowledge and desire Then they can not act; If no action is taken Harmony remains. 4. Limitless The Way is a limitless vessel; Used by the self, it is not filled by the world; It cannot be cut, knotted, dimmed or stilled; Its depths are hidden, ubiquitous and eternal; I don't know where it comes from; It comes before nature. 5. Nature Nature is not kind; It treats all things impartially. The Sage is not kind, And treats all people impartially. Nature is like a bellows, Empty, yet never ceasing its supply. The more it moves, the more it yields; So the sage draws upon experience And cannot be exhausted. 6. Experience Experience is a riverbed,  Its source hidden, forever flowing: Its entrance, the root of the world, The Way moves within it: Draw upon it; it will not run dry. 7. Complete Nature is complete because it does not serve itself. The sage places himself after and finds himself before, Ignores his desire and finds himself content. He is complete because he does not serve himself. 8. Water The best of man is like water, Which benefits all things, and does not contend with them, Which flows in places that others disdain, Where it is in harmony with the Way. So the sage: Lives within nature, Thinks within the deep, Gives within impartiality, Speaks within trust, Governs within order, Crafts within ability, Acts within opportunity. He does not contend, and none contend against him. 9. Retire Fill a cup to its brim and it is easily spilled; Temper a sword to its hardest and it is easily broken; Amass the greatest treasure and it is easily stolen; Claim credit and honour and you easily fall; Retire once your purpose is achieved - this is natural. 10. Harmony Embracing the Way, you become embraced; Breathing gently, you become newborn; Clearing your mind, you become clear; Nurturing your children, you become impartial; Opening your heart, you become accepted; Accepting the world, you embrace the Way. Bearing and nurturing, Creating but not owning, Giving without demanding, This is harmony. 11. Tools Thirty spokes meet at a nave; because of the hole we may use the wheel. Clay is moulded into a vessel; Because of the hollow we may use the cup. Walls are built around a hearth; Because of the doors we may use the house. Thus tools come from what exists, But use from what does not. 12. Substance Too much colour blinds the eye, Too much music deafens the ear, Too much taste dulls the palate, Too much play maddens the mind, Too much desire tears the heart. In this manner the sage cares for people: He provides for the belly, not for the senses; He ignores abstraction and holds fast to substance. 13. Self Both praise and blame cause concern, For they bring people hope and fear. The object of hope and fear is the self - For, without self, to whom may fortune and disaster occur? Therefore, Who distinguishes himself from the world may be given the world, But who regards himself as the world may accept the world. 14. Mystery Looked at but cannot be seen - it is beneath form; Listened to but cannot be heard - it is beneath sound; Held but cannot be touched - it is beneath feeling; These depthless things evade definition, And blend into a single mystery. In its rising there is no light, In its falling there is no darkness, A continuous thread beyond description, Lining what does not exist; Its form formless, Its image nothing, Its name silence; Follow it, it has no back, et it, it has no face. Attend the present to deal with the past; Thus you grasp the continuity of the Way, Which is its essence. 15. Enlightenment The enlightened possess understanding So profound they can not be understood. Because they cannot be understood I can only describe their appearance: Cautious as one crossing thin ice, Undecided as one surrounded by danger, Modest as one who is a guest, Unbounded as melting ice, Genuine as unshaped wood, Broad as a valley, Seamless as muddy water. Who stills the water that the mud may settle, Who seeks to stop that he may travel on, Who desires less than what may transpire, Decays, but will not renew. 16. Decay and Renewal Empty the self completely; Embrace perfect peace. The world will rise and move; Watch it return to rest. All the flourishing things Will return to their source. This return is peaceful; It is the flow of nature, An eternal decay and renewal. Accepting this brings enlightenment, Ignoring this brings misery. Who accepts nature's flow becomes all-cherishing; Being all-cherishing he becomes impartial; Being impartial he becomes magnanimous; Being magnanimous he becomes natural; Being natural he becomes one with the Way; Being one with the Way he becomes immortal: Though his body will decay, the Way will not. 17. Rulers The best rulers are scarcely known by their subjects; The next best are loved and praised; The next are feared; The next despised: They have no faith in their people, And their people become unfaithful to them. When the best rulers achieve their purpose Their subjects claim the achievement as their own. 18. Hypocrisy When the Way is forgotten Duty and justice appear; Then knowledge and wisdom are born Along with hypocrisy. When harmonious relationships dissolve Then respect and devotion arise; When a nation falls to chaos Then loyalty and patriotism are born. 19. Simplify If we could discard knowledge and wisdom Then people would profit a hundredfold; If we could discard duty and justice Then harmonious relationships would form; If we could discard artifice and profit Then waste and theft would disappear. Yet such remedies treat only symptoms And so they are inadequate. People need personal remedies: Reveal your naked self and embrace your original nature; Bind your self-interest and control your ambition; Forget your habits and simplify your affairs. 20. Wandering What is the difference between assent and denial? What is the difference between beautiful and ugly? What is the difference between fearsome and afraid? The people are merry as if at a magnificent party Or playing in the park at springtime, But I am tranquil and wandering, Like a newborn before it learns to smile, Alone, with no true home. The people have enough and to spare, Where I have nothing, And my heart is foolish, Muddled and cloudy. The people are bright and certain, Where I am dim and confused; The people are clever and wise, Where I am dull and ignorant; Aimless as a wave drifting over the sea, Attached to nothing. The people are busy with purpose, Where I am ipractical and rough; I do not share the peoples' cares But I am fed at nature's breast. 21. Accept Harmony is only in following the Way. The Way is without form or quality, But expresses all forms and qualities; The Way is hidden and implicate, But expresses all of nature; The Way is unchanging, But expresses all motion. Beneath sensation and memory The Way is the source of all the world. How can I understand the source of the world? By accepting. 22. Home Accept and you become whole, Bend and you straighten, Empty and you fill, Decay and you renew, Want and you acquire, Fulfill and you become confused. The sage accepts the world As the world accepts the Way; He does not display himself, so is clearly seen, Does not justify himself, so is recognized, Does not boast, so is credited, Does not pride himself, so endures, Does not contend, so none contend against him. The ancients said, "Accept and you become whole", Once whole, the world is as your home. 23. Words Nature says only a few words: High wind does not last long, Nor does heavy rain. If nature's words do not last Why should those of man? Who accepts harmony, becomes harmonious. Who accepts loss, becomes lost. For who accepts harmony, the Way harmonizes with him, And who accepts loss, the Way cannot find. 24. Indulgence Straighten yourself and you will not stand steady; Display yourself and you will not be clearly seen; Justify yourself and you will not be respected; Promote yourself and you will not be believed; Pride yourself and you will not endure. These behaviours are wasteful, indulgent, And so they attract disfavour; Harmony avoids them. 25. Beneath Abstraction There is a mystery, Beneath abstraction, Silent, depthless, Alone, unchanging, Ubiquitous and liquid, The mother of nature. It has no name, but I call it "the Way"; It has no limit, but I call it "limitless". Being limitless, it flows away forever; Flowing away forever, it returns to my self: The Way is limitless, So nature is limitless, So the world is limitless, And so I am limitless. For I am abstracted from the world, The world from nature, Nature from the Way, And the Way from what is beneath abstraction. 26. Calm Gravity is the source of lightness, Calm, the master of haste. A lone traveller will journey all day, watching over his belongings; Only safe in his own bed may he lose them in sleep. So the captain of a great vessel should not act lightly or hastily. Acting lightly, he loses sight of the world, Acting hastily, he loses control of himself. The captain can not treat his great ship as a small boat; Rather than glitter like jade He must stand like stone. 27. Perfection The perfect traveller leaves no trail to be followed; The perfect speaker leaves no question to be answered; The perfect accountant leaves no working to be completed; The perfect container leaves no lock to be closed; The perfect knot leaves no end to be ravelled. So the sage nurtures all men And abandons no one. He accepts everything And rejects nothing. He attends to the smallest details. For the strong must guide the weak; The weak are raw material to the strong. If the guide is not respected, Or the material is not cared for, Confusion will result, no matter how clever one is. This is the secret of perfection: When raw wood is carved, it becomes a tool; When a man is employed, he becomes a tool; The perfect carpenter leaves no wood to be carved. 28. Becoming Using the male, being female, Being the entrance of the world, You embrace harmony And become as a newborn. Using strength, being weak, Being the root of the world, You complete harmony And become as unshaped wood. Using the light, being dark, Being the world, You perfect harmony And return to the Way. 29. Ambition Those who wish to change the world According with their desire Cannot succeed. The world is shaped by the Way; It cannot be shaped by the self. Trying to change it, you damage it; Trying to possess it, you lose it. So some will lead, while others follow. Some will be warm, others cold Some will be strong, others weak. Some will get where they are going While others fall by the side of the road. So the sage will be neither extravagant nor violent. 30. Violence Powerful men are well advised not to use violence, For violence has a habit of returning; Thorns and weeds grow wherever an army goes, And lean years follow a great war. A general is well advised To achieve nothing more than his orders: Not to take advantage of his victory. Nor to glory, boast or pride himself; To do what is dictated by necessity, Not by choice. For even the strongest force will weaken with time, And then its violence will return, and kill it. 31. Armies Armies are tools of violence; They cause men to hate and fear. The sage will not join them. His purpose is creation; Their purpose is destruction. Weapons are tools of violence, Not of the sage; He uses them only when there is no choice, And then calmly, and with tact, For he finds no beauty in them. Whoever finds beauty in weapons Delights in the slaughter of men; And who delights in slaughter Cannot content himself with peace. So slaughters must be mourned And conquest celebrated with a funeral. 32. Shapes The Way has no true shape, And therefore none can control it. If a ruler could control the Way All things would follow In harmony with his desire, And sweet rain would fall, Effortlessly slaking every thirst. The Way is shaped by use, But then the shape is lost. Do not hold fast to shapes But let sensation flow into the world As a river courses down to the sea. 33. Virtues Who understands the world is learned; Who understands the self is enlightened. Who conquers the world has strength; Who conquers the self has harmony; Who is determined has purpose. Who is contented has wealth; Who defends his home may long endure; Who surrenders his home may long survive it. 34. Control The Way flows and ebbs, creating and destroying, Implementing all the world, attending to the tiniest details, Claiming nothing in return. It nurtures all things, Though it does not control them; It has no intention, So it seems inconsequential. It is the substance of all things; Though it does not control them; It has no exception, So it seems all-important. The sage would not control the world;  He is in harmony with the world. 35. Peace If you offer music and food Strangers may stop with you; But if you accord with the Way All the people of the world will keep you In safety, health, community, and peace. The Way lacks art and flavour; It can neither be seen  or heard, But its benefit cannot be exhausted.  36. Opposition To reduce someone's influence, first expand it; To reduce someone's force, first increase it; To overthrow someone, first exalt them; To take from someone, first give to them. This is the subtlety by which the weak overcome the strong: Fish should not leave their depths, And swords should not leave their scabbards. 37. Tranquillity The Way takes no action, but leaves nothing undone. When you accept this The world will flourish, In harmony with nature. Nature does not possess desire; Without desire, the heart becomes quiet; In this manner the whole world is made tranquil. Tao Te Ching: An English-Language Interpolation 1. The Way The Way that can be experienced is not true; The world that can be constructed is not real. The Way manifests all that happens and may happen; The world represents all that exists and may exist. To experience without abstraction is to sense the world; To experience with abstraction is to know the world. These two experiences are indistinguishable; Their construction differs but their effect is the same. Beyond the gate of experience flows the Way, Which is ever greater and more subtle than the world. 2. Abstraction When beauty is abstracted Then ugliness has been implied; When good is abstracted Then evil has been implied. So alive and dead are abstracted from nature, Difficult and easy abstracted from progress, Long and short abstracted from contrast, High and low abstracted from depth, Song and speech abstracted from melody, After and before abstracted from sequence. The sage experiences without abstraction, And accomplishes without action; He accepts the ebb and flow of things, Nurtures them, but does not own them, And lives, but does not dwell. 3. Without Action Not praising the worthy prevents contention, Not esteeming the valuable prevents theft, Not displaying the beautiful prevents desire. In this manner the sage governs people: Emptying their minds, Filling their bellies, Weakening their ambitions, And strengthening their bones. If people lack knowledge and desire Then they can not act; If no action is taken Harmony remains. 4. Limitless The Way is a limitless vessel; Used by the self, it is not filled by the world; It cannot be cut, knotted, dimmed or stilled; Its depths are hidden, ubiquitous and eternal; I don't know where it comes from; It comes before nature. 5. Nature Nature is not kind; It treats all things impartially. The Sage is not kind, And treats all people impartially. Nature is like a bellows, Empty, yet never ceasing its supply. The more it moves, the more it yields; So the sage draws upon experience And cannot be exhausted. 6. Experience Experience is a riverbed,  Its source hidden, forever flowing: Its entrance, the root of the world, The Way moves within it: Draw upon it; it will not run dry. 7. Complete Nature is complete because it does not serve itself. The sage places himself after and finds himself before, Ignores his desire and finds himself content. He is complete because he does not serve himself. 8. Water The best of man is like water, Which benefits all things, and does not contend with them, Which flows in places that others disdain, Where it is in harmony with the Way. So the sage: Lives within nature, Thinks within the deep, Gives within impartiality, Speaks within trust, Governs within order, Crafts within ability, Acts within opportunity. He does not contend, and none contend against him. 9. Retire Fill a cup to its brim and it is easily spilled; Temper a sword to its hardest and it is easily broken; Amass the greatest treasure and it is easily stolen; Claim credit and honour and you easily fall; Retire once your purpose is achieved - this is natural. 10. Harmony Embracing the Way, you become embraced; Breathing gently, you become newborn; Clearing your mind, you become clear; Nurturing your children, you become impartial; Opening your heart, you become accepted; Accepting the world, you embrace the Way. Bearing and nurturing, Creating but not owning, Giving without demanding, This is harmony. 11. Tools Thirty spokes meet at a nave; because of the hole we may use the wheel. Clay is moulded into a vessel; Because of the hollow we may use the cup. Walls are built around a hearth; Because of the doors we may use the house. Thus tools come from what exists, But use from what does not. 12. Substance Too much colour blinds the eye, Too much music deafens the ear, Too much taste dulls the palate, Too much play maddens the mind, Too much desire tears the heart. In this manner the sage cares for people: He provides for the belly, not for the senses; He ignores abstraction and holds fast to substance. 13. Self Both praise and blame cause concern, For they bring people hope and fear. The object of hope and fear is the self - For, without self, to whom may fortune and disaster occur? Therefore, Who distinguishes himself from the world may be given the world, But who regards himself as the world may accept the world. 14. Mystery Looked at but cannot be seen - it is beneath form; Listened to but cannot be heard - it is beneath sound; Held but cannot be touched - it is beneath feeling; These depthless things evade definition, And blend into a single mystery. In its rising there is no light, In its falling there is no darkness, A continuous thread beyond description, Lining what does not exist; Its form formless, Its image nothing, Its name silence; Follow it, it has no back, et it, it has no face. Attend the present to deal with the past; Thus you grasp the continuity of the Way, Which is its essence. 15. Enlightenment The enlightened possess understanding So profound they can not be understood. Because they cannot be understood I can only describe their appearance: Cautious as one crossing thin ice, Undecided as one surrounded by danger, Modest as one who is a guest, Unbounded as melting ice, Genuine as unshaped wood, Broad as a valley, Seamless as muddy water. Who stills the water that the mud may settle, Who seeks to stop that he may travel on, Who desires less than what may transpire, Decays, but will not renew. 16. Decay and Renewal Empty the self completely; Embrace perfect peace. The world will rise and move; Watch it return to rest. All the flourishing things Will return to their source. This return is peaceful; It is the flow of nature, An eternal decay and renewal. Accepting this brings enlightenment, Ignoring this brings misery. Who accepts nature's flow becomes all-cherishing; Being all-cherishing he becomes impartial; Being impartial he becomes magnanimous; Being magnanimous he becomes natural; Being natural he becomes one with the Way; Being one with the Way he becomes immortal: Though his body will decay, the Way will not. 17. Rulers The best rulers are scarcely known by their subjects; The next best are loved and praised; The next are feared; The next despised: They have no faith in their people, And their people become unfaithful to them. When the best rulers achieve their purpose Their subjects claim the achievement as their own. 18. Hypocrisy When the Way is forgotten Duty and justice appear; Then knowledge and wisdom are born Along with hypocrisy. When harmonious relationships dissolve Then respect and devotion arise; When a nation falls to chaos Then loyalty and patriotism are born. 19. Simplify If we could discard knowledge and wisdom Then people would profit a hundredfold; If we could discard duty and justice Then harmonious relationships would form; If we could discard artifice and profit Then waste and theft would disappear. Yet such remedies treat only symptoms And so they are inadequate. People need personal remedies: Reveal your naked self and embrace your original nature; Bind your self-interest and control your ambition; Forget your habits and simplify your affairs. 20. Wandering What is the difference between assent and denial? What is the difference between beautiful and ugly? What is the difference between fearsome and afraid? The people are merry as if at a magnificent party Or playing in the park at springtime, But I am tranquil and wandering, Like a newborn before it learns to smile, Alone, with no true home. The people have enough and to spare, Where I have nothing, And my heart is foolish, Muddled and cloudy. The people are bright and certain, Where I am dim and confused; The people are clever and wise, Where I am dull and ignorant; Aimless as a wave drifting over the sea, Attached to nothing. The people are busy with purpose, Where I am ipractical and rough; I do not share the peoples' cares But I am fed at nature's breast. 21. Accept Harmony is only in following the Way. The Way is without form or quality, But expresses all forms and qualities; The Way is hidden and implicate, But expresses all of nature; The Way is unchanging, But expresses all motion. Beneath sensation and memory The Way is the source of all the world. How can I understand the source of the world? By accepting. 22. Home Accept and you become whole, Bend and you straighten, Empty and you fill, Decay and you renew, Want and you acquire, Fulfill and you become confused. The sage accepts the world As the world accepts the Way; He does not display himself, so is clearly seen, Does not justify himself, so is recognized, Does not boast, so is credited, Does not pride himself, so endures, Does not contend, so none contend against him. The ancients said, "Accept and you become whole", Once whole, the world is as your home. 23. Words Nature says only a few words: High wind does not last long, Nor does heavy rain. If nature's words do not last Why should those of man? Who accepts harmony, becomes harmonious. Who accepts loss, becomes lost. For who accepts harmony, the Way harmonizes with him, And who accepts loss, the Way cannot find. 24. Indulgence Straighten yourself and you will not stand steady; Display yourself and you will not be clearly seen; Justify yourself and you will not be respected; Promote yourself and you will not be believed; Pride yourself and you will not endure. These behaviours are wasteful, indulgent, And so they attract disfavour; Harmony avoids them. 25. Beneath Abstraction There is a mystery, Beneath abstraction, Silent, depthless, Alone, unchanging, Ubiquitous and liquid, The mother of nature. It has no name, but I call it "the Way"; It has no limit, but I call it "limitless". Being limitless, it flows away forever; Flowing away forever, it returns to my self: The Way is limitless, So nature is limitless, So the world is limitless, And so I am limitless. For I am abstracted from the world, The world from nature, Nature from the Way, And the Way from what is beneath abstraction. 26. Calm Gravity is the source of lightness, Calm, the master of haste. A lone traveller will journey all day, watching over his belongings; Only safe in his own bed may he lose them in sleep. So the captain of a great vessel should not act lightly or hastily. Acting lightly, he loses sight of the world, Acting hastily, he loses control of himself. The captain can not treat his great ship as a small boat; Rather than glitter like jade He must stand like stone. 27. Perfection The perfect traveller leaves no trail to be followed; The perfect speaker leaves no question to be answered; The perfect accountant leaves no working to be completed; The perfect container leaves no lock to be closed; The perfect knot leaves no end to be ravelled. So the sage nurtures all men And abandons no one. He accepts everything And rejects nothing. He attends to the smallest details. For the strong must guide the weak; The weak are raw material to the strong. If the guide is not respected, Or the material is not cared for, Confusion will result, no matter how clever one is. This is the secret of perfection: When raw wood is carved, it becomes a tool; When a man is employed, he becomes a tool; The perfect carpenter leaves no wood to be carved. 28. Becoming Using the male, being female, Being the entrance of the world, You embrace harmony And become as a newborn. Using strength, being weak, Being the root of the world, You complete harmony And become as unshaped wood. Using the light, being dark, Being the world, You perfect harmony And return to the Way. 29. Ambition Those who wish to change the world According with their desire Cannot succeed. The world is shaped by the Way; It cannot be shaped by the self. Trying to change it, you damage it; Trying to possess it, you lose it. So some will lead, while others follow. Some will be warm, others cold Some will be strong, others weak. Some will get where they are going While others fall by the side of the road. So the sage will be neither extravagant nor violent. 30. Violence Powerful men are well advised not to use violence, For violence has a habit of returning; Thorns and weeds grow wherever an army goes, And lean years follow a great war. A general is well advised To achieve nothing more than his orders: Not to take advantage of his victory. Nor to glory, boast or pride himself; To do what is dictated by necessity, Not by choice. For even the strongest force will weaken with time, And then its violence will return, and kill it. 31. Armies Armies are tools of violence; They cause men to hate and fear. The sage will not join them. His purpose is creation; Their purpose is destruction. Weapons are tools of violence, Not of the sage; He uses them only when there is no choice, And then calmly, and with tact, For he finds no beauty in them. Whoever finds beauty in weapons Delights in the slaughter of men; And who delights in slaughter Cannot content himself with peace. So slaughters must be mourned And conquest celebrated with a funeral. 32. Shapes The Way has no true shape, And therefore none can control it. If a ruler could control the Way All things would follow In harmony with his desire, And sweet rain would fall, Effortlessly slaking every thirst. The Way is shaped by use, But then the shape is lost. Do not hold fast to shapes But let sensation flow into the world As a river courses down to the sea. 33. Virtues Who understands the world is learned; Who understands the self is enlightened. Who conquers the world has strength; Who conquers the self has harmony; Who is determined has purpose. Who is contented has wealth; Who defends his home may long endure; Who surrenders his home may long survive it. 34. Control The Way flows and ebbs, creating and destroying, Implementing all the world, attending to the tiniest details, Claiming nothing in return. It nurtures all things, Though it does not control them; It has no intention, So it seems inconsequential. It is the substance of all things; Though it does not control them; It has no exception, So it seems all-important. The sage would not control the world;  He is in harmony with the world. 35. Peace If you offer music and food Strangers may stop with you; But if you accord with the Way All the people of the world will keep you In safety, health, community, and peace. The Way lacks art and flavour; It can neither be seen  or heard, But its benefit cannot be exhausted.  36. Opposition To reduce someone's influence, first expand it; To reduce someone's force, first increase it; To overthrow someone, first exalt them; To take from someone, first give to them. This is the subtlety by which the weak overcome the strong: Fish should not leave their depths, And swords should not leave their scabbards.
+
+[Test_9.14.1]
+//Repeat=2
+WSPURI=http://192.168.20.11/upload/tao.txt
+//WSPURI=http://10.32.194.45/upload/tao.txt
+//WSPURI=http://10.35.2.4/upload/tao.txt
+
+[Test_9.14.2]
+WSPMethod=97
+WSPURI=http://192.168.20.11/upload/tao.txt
+//WSPURI=http://10.32.194.45/upload/tao.txt
+//WSPURI=http://10.35.2.4/upload/tao.txt
+WSPHeaders=Accept-Language: English
+WSPBody=Tao Te Ching: An English-Language Interpolation 1. The Way The Way that can be experienced is not true; The world that can be constructed is not real. The Way manifests all that happens and may happen; The world represents all that exists and may exist. To experience without abstraction is to sense the world; To experience with abstraction is to know the world. These two experiences are indistinguishable; Their construction differs but their effect is the same. Beyond the gate of experience flows the Way, Which is ever greater and more subtle than the world. 2. Abstraction When beauty is abstracted Then ugliness has been implied; When good is abstracted Then evil has been implied. So alive and dead are abstracted from nature, Difficult and easy abstracted from progress, Long and short abstracted from contrast, High and low abstracted from depth, Song and speech abstracted from melody, After and before abstracted from sequence. The sage experiences without abstraction, And accomplishes without action; He accepts the ebb and flow of things, Nurtures them, but does not own them, And lives, but does not dwell. 3. Without Action Not praising the worthy prevents contention, Not esteeming the valuable prevents theft, Not displaying the beautiful prevents desire. In this manner the sage governs people: Emptying their minds, Filling their bellies, Weakening their ambitions, And strengthening their bones. If people lack knowledge and desire Then they can not act; If no action is taken Harmony remains. 4. Limitless The Way is a limitless vessel; Used by the self, it is not filled by the world; It cannot be cut, knotted, dimmed or stilled; Its depths are hidden, ubiquitous and eternal; I don't know where it comes from; It comes before nature. 5. Nature Nature is not kind; It treats all things impartially. The Sage is not kind, And treats all people impartially. Nature is like a bellows, Empty, yet never ceasing its supply. The more it moves, the more it yields; So the sage draws upon experience And cannot be exhausted. 6. Experience Experience is a riverbed,  Its source hidden, forever flowing: Its entrance, the root of the world, The Way moves within it: Draw upon it; it will not run dry. 7. Complete Nature is complete because it does not serve itself. The sage places himself after and finds himself before, Ignores his desire and finds himself content. He is complete because he does not serve himself. 8. Water The best of man is like water, Which benefits all things, and does not contend with them, Which flows in places that others disdain, Where it is in harmony with the Way. So the sage: Lives within nature, Thinks within the deep, Gives within impartiality, Speaks within trust, Governs within order, Crafts within ability, Acts within opportunity. He does not contend, and none contend against him. 9. Retire Fill a cup to its brim and it is easily spilled; Temper a sword to its hardest and it is easily broken; Amass the greatest treasure and it is easily stolen; Claim credit and honour and you easily fall; Retire once your purpose is achieved - this is natural. 10. Harmony Embracing the Way, you become embraced; Breathing gently, you become newborn; Clearing your mind, you become clear; Nurturing your children, you become impartial; Opening your heart, you become accepted; Accepting the world, you embrace the Way. Bearing and nurturing, Creating but not owning, Giving without demanding, This is harmony. 11. Tools Thirty spokes meet at a nave; because of the hole we may use the wheel. Clay is moulded into a vessel; Because of the hollow we may use the cup. Walls are built around a hearth; Because of the doors we may use the house. Thus tools come from what exists, But use from what does not. 12. Substance Too much colour blinds the eye, Too much music deafens the ear, Too much taste dulls the palate, Too much play maddens the mind, Too much desire tears the heart. In this manner the sage cares for people: He provides for the belly, not for the senses; He ignores abstraction and holds fast to substance. 13. Self Both praise and blame cause concern, For they bring people hope and fear. The object of hope and fear is the self - For, without self, to whom may fortune and disaster occur? Therefore, Who distinguishes himself from the world may be given the world, But who regards himself as the world may accept the world. 14. Mystery Looked at but cannot be seen - it is beneath form; Listened to but cannot be heard - it is beneath sound; Held but cannot be touched - it is beneath feeling; These depthless things evade definition, And blend into a single mystery. In its rising there is no light, In its falling there is no darkness, A continuous thread beyond description, Lining what does not exist; Its form formless, Its image nothing, Its name silence; Follow it, it has no back, et it, it has no face. Attend the present to deal with the past; Thus you grasp the continuity of the Way, Which is its essence. 15. Enlightenment The enlightened possess understanding So profound they can not be understood. Because they cannot be understood I can only describe their appearance: Cautious as one crossing thin ice, Undecided as one surrounded by danger, Modest as one who is a guest, Unbounded as melting ice, Genuine as unshaped wood, Broad as a valley, Seamless as muddy water. Who stills the water that the mud may settle, Who seeks to stop that he may travel on, Who desires less than what may transpire, Decays, but will not renew. 16. Decay and Renewal Empty the self completely; Embrace perfect peace. The world will rise and move; Watch it return to rest. All the flourishing things Will return to their source. This return is peaceful; It is the flow of nature, An eternal decay and renewal. Accepting this brings enlightenment, Ignoring this brings misery. Who accepts nature's flow becomes all-cherishing; Being all-cherishing he becomes impartial; Being impartial he becomes magnanimous; Being magnanimous he becomes natural; Being natural he becomes one with the Way; Being one with the Way he becomes immortal: Though his body will decay, the Way will not. 17. Rulers The best rulers are scarcely known by their subjects; The next best are loved and praised; The next are feared; The next despised: They have no faith in their people, And their people become unfaithful to them. When the best rulers achieve their purpose Their subjects claim the achievement as their own. 18. Hypocrisy When the Way is forgotten Duty and justice appear; Then knowledge and wisdom are born Along with hypocrisy. When harmonious relationships dissolve Then respect and devotion arise; When a nation falls to chaos Then loyalty and patriotism are born. 19. Simplify If we could discard knowledge and wisdom Then people would profit a hundredfold; If we could discard duty and justice Then harmonious relationships would form; If we could discard artifice and profit Then waste and theft would disappear. Yet such remedies treat only symptoms And so they are inadequate. People need personal remedies: Reveal your naked self and embrace your original nature; Bind your self-interest and control your ambition; Forget your habits and simplify your affairs. 20. Wandering What is the difference between assent and denial? What is the difference between beautiful and ugly? What is the difference between fearsome and afraid? The people are merry as if at a magnificent party Or playing in the park at springtime, But I am tranquil and wandering, Like a newborn before it learns to smile, Alone, with no true home. The people have enough and to spare, Where I have nothing, And my heart is foolish, Muddled and cloudy. The people are bright and certain, Where I am dim and confused; The people are clever and wise, Where I am dull and ignorant; Aimless as a wave drifting over the sea, Attached to nothing. The people are busy with purpose, Where I am ipractical and rough; I do not share the peoples' cares But I am fed at nature's breast. 21. Accept Harmony is only in following the Way. The Way is without form or quality, But expresses all forms and qualities; The Way is hidden and implicate, But expresses all of nature; The Way is unchanging, But expresses all motion. Beneath sensation and memory The Way is the source of all the world. How can I understand the source of the world? By accepting. 22. Home Accept and you become whole, Bend and you straighten, Empty and you fill, Decay and you renew, Want and you acquire, Fulfill and you become confused. The sage accepts the world As the world accepts the Way; He does not display himself, so is clearly seen, Does not justify himself, so is recognized, Does not boast, so is credited, Does not pride himself, so endures, Does not contend, so none contend against him. The ancients said, "Accept and you become whole", Once whole, the world is as your home. 23. Words Nature says only a few words: High wind does not last long, Nor does heavy rain. If nature's words do not last Why should those of man? Who accepts harmony, becomes harmonious. Who accepts loss, becomes lost. For who accepts harmony, the Way harmonizes with him, And who accepts loss, the Way cannot find. 24. Indulgence Straighten yourself and you will not stand steady; Display yourself and you will not be clearly seen; Justify yourself and you will not be respected; Promote yourself and you will not be believed; Pride yourself and you will not endure. These behaviours are wasteful, indulgent, And so they attract disfavour; Harmony avoids them. 25. Beneath Abstraction There is a mystery, Beneath abstraction, Silent, depthless, Alone, unchanging, Ubiquitous and liquid, The mother of nature. It has no name, but I call it "the Way"; It has no limit, but I call it "limitless". Being limitless, it flows away forever; Flowing away forever, it returns to my self: The Way is limitless, So nature is limitless, So the world is limitless, And so I am limitless. For I am abstracted from the world, The world from nature, Nature from the Way, And the Way from what is beneath abstraction. 26. Calm Gravity is the source of lightness, Calm, the master of haste. A lone traveller will journey all day, watching over his belongings; Only safe in his own bed may he lose them in sleep. So the captain of a great vessel should not act lightly or hastily. Acting lightly, he loses sight of the world, Acting hastily, he loses control of himself. The captain can not treat his great ship as a small boat; Rather than glitter like jade He must stand like stone. 27. Perfection The perfect traveller leaves no trail to be followed; The perfect speaker leaves no question to be answered; The perfect accountant leaves no working to be completed; The perfect container leaves no lock to be closed; The perfect knot leaves no end to be ravelled. So the sage nurtures all men And abandons no one. He accepts everything And rejects nothing. He attends to the smallest details. For the strong must guide the weak; The weak are raw material to the strong. If the guide is not respected, Or the material is not cared for, Confusion will result, no matter how clever one is. This is the secret of perfection: When raw wood is carved, it becomes a tool; When a man is employed, he becomes a tool; The perfect carpenter leaves no wood to be carved. 28. Becoming Using the male, being female, Being the entrance of the world, You embrace harmony And become as a newborn. Using strength, being weak, Being the root of the world, You complete harmony And become as unshaped wood. Using the light, being dark, Being the world, You perfect harmony And return to the Way. 29. Ambition Those who wish to change the world According with their desire Cannot succeed. The world is shaped by the Way; It cannot be shaped by the self. Trying to change it, you damage it; Trying to possess it, you lose it. So some will lead, while others follow. Some will be warm, others cold Some will be strong, others weak. Some will get where they are going While others fall by the side of the road. So the sage will be neither extravagant nor violent. 30. Violence Powerful men are well advised not to use violence, For violence has a habit of returning; Thorns and weeds grow wherever an army goes, And lean years follow a great war. A general is well advised To achieve nothing more than his orders: Not to take advantage of his victory. Nor to glory, boast or pride himself; To do what is dictated by necessity, Not by choice. For even the strongest force will weaken with time, And then its violence will return, and kill it. 31. Armies Armies are tools of violence; They cause men to hate and fear. The sage will not join them. His purpose is creation; Their purpose is destruction. Weapons are tools of violence, Not of the sage; He uses them only when there is no choice, And then calmly, and with tact, For he finds no beauty in them. Whoever finds beauty in weapons Delights in the slaughter of men; And who delights in slaughter Cannot content himself with peace. So slaughters must be mourned And conquest celebrated with a funeral. 32. Shapes The Way has no true shape, And therefore none can control it. If a ruler could control the Way All things would follow In harmony with his desire, And sweet rain would fall, Effortlessly slaking every thirst. The Way is shaped by use, But then the shape is lost. Do not hold fast to shapes But let sensation flow into the world As a river courses down to the sea. 33. Virtues Who understands the world is learned; Who understands the self is enlightened. Who conquers the world has strength; Who conquers the self has harmony; Who is determined has purpose. Who is contented has wealth; Who defends his home may long endure; Who surrenders his home may long survive it. 34. Control The Way flows and ebbs, creating and destroying, Implementing all the world, attending to the tiniest details, Claiming nothing in return. It nurtures all things, Though it does not control them; It has no intention, So it seems inconsequential. It is the substance of all things; Though it does not control them; It has no exception, So it seems all-important. The sage would not control the world;  He is in harmony with the world. 35. Peace If you offer music and food Strangers may stop with you; But if you accord with the Way All the people of the world will keep you In safety, health, community, and peace. The Way lacks art and flavour; It can neither be seen  or heard, But its benefit cannot be exhausted.  36. Opposition To reduce someone's influence, first expand it; To reduce someone's force, first increase it; To overthrow someone, first exalt them; To take from someone, first give to them. This is the subtlety by which the weak overcome the strong: Fish should not leave their depths, And swords should not leave their scabbards. 37. Tranquillity The Way takes no action, but leaves nothing undone. When you accept this The world will flourish, In harmony with nature. Nature does not possess desire; Without desire, the heart becomes quiet; In this manner the whole world is made tranquil. Tao Te Ching: An English-Language Interpolation 1. The Way The Way that can be experienced is not true; The world that can be constructed is not real. The Way manifests all that happens and may happen; The world represents all that exists and may exist. To experience without abstraction is to sense the world; To experience with abstraction is to know the world. These two experiences are indistinguishable; Their construction differs but their effect is the same. Beyond the gate of experience flows the Way, Which is ever greater and more subtle than the world. 2. Abstraction When beauty is abstracted Then ugliness has been implied; When good is abstracted Then evil has been implied. So alive and dead are abstracted from nature, Difficult and easy abstracted from progress, Long and short abstracted from contrast, High and low abstracted from depth, Song and speech abstracted from melody, After and before abstracted from sequence. The sage experiences without abstraction, And accomplishes without action; He accepts the ebb and flow of things, Nurtures them, but does not own them, And lives, but does not dwell. 3. Without Action Not praising the worthy prevents contention, Not esteeming the valuable prevents theft, Not displaying the beautiful prevents desire. In this manner the sage governs people: Emptying their minds, Filling their bellies, Weakening their ambitions, And strengthening their bones. If people lack knowledge and desire Then they can not act; If no action is taken Harmony remains. 4. Limitless The Way is a limitless vessel; Used by the self, it is not filled by the world; It cannot be cut, knotted, dimmed or stilled; Its depths are hidden, ubiquitous and eternal; I don't know where it comes from; It comes before nature. 5. Nature Nature is not kind; It treats all things impartially. The Sage is not kind, And treats all people impartially. Nature is like a bellows, Empty, yet never ceasing its supply. The more it moves, the more it yields; So the sage draws upon experience And cannot be exhausted. 6. Experience Experience is a riverbed,  Its source hidden, forever flowing: Its entrance, the root of the world, The Way moves within it: Draw upon it; it will not run dry. 7. Complete Nature is complete because it does not serve itself. The sage places himself after and finds himself before, Ignores his desire and finds himself content. He is complete because he does not serve himself. 8. Water The best of man is like water, Which benefits all things, and does not contend with them, Which flows in places that others disdain, Where it is in harmony with the Way. So the sage: Lives within nature, Thinks within the deep, Gives within impartiality, Speaks within trust, Governs within order, Crafts within ability, Acts within opportunity. He does not contend, and none contend against him. 9. Retire Fill a cup to its brim and it is easily spilled; Temper a sword to its hardest and it is easily broken; Amass the greatest treasure and it is easily stolen; Claim credit and honour and you easily fall; Retire once your purpose is achieved - this is natural. 10. Harmony Embracing the Way, you become embraced; Breathing gently, you become newborn; Clearing your mind, you become clear; Nurturing your children, you become impartial; Opening your heart, you become accepted; Accepting the world, you embrace the Way. Bearing and nurturing, Creating but not owning, Giving without demanding, This is harmony. 11. Tools Thirty spokes meet at a nave; because of the hole we may use the wheel. Clay is moulded into a vessel; Because of the hollow we may use the cup. Walls are built around a hearth; Because of the doors we may use the house. Thus tools come from what exists, But use from what does not. 12. Substance Too much colour blinds the eye, Too much music deafens the ear, Too much taste dulls the palate, Too much play maddens the mind, Too much desire tears the heart. In this manner the sage cares for people: He provides for the belly, not for the senses; He ignores abstraction and holds fast to substance. 13. Self Both praise and blame cause concern, For they bring people hope and fear. The object of hope and fear is the self - For, without self, to whom may fortune and disaster occur? Therefore, Who distinguishes himself from the world may be given the world, But who regards himself as the world may accept the world. 14. Mystery Looked at but cannot be seen - it is beneath form; Listened to but cannot be heard - it is beneath sound; Held but cannot be touched - it is beneath feeling; These depthless things evade definition, And blend into a single mystery. In its rising there is no light, In its falling there is no darkness, A continuous thread beyond description, Lining what does not exist; Its form formless, Its image nothing, Its name silence; Follow it, it has no back, et it, it has no face. Attend the present to deal with the past; Thus you grasp the continuity of the Way, Which is its essence. 15. Enlightenment The enlightened possess understanding So profound they can not be understood. Because they cannot be understood I can only describe their appearance: Cautious as one crossing thin ice, Undecided as one surrounded by danger, Modest as one who is a guest, Unbounded as melting ice, Genuine as unshaped wood, Broad as a valley, Seamless as muddy water. Who stills the water that the mud may settle, Who seeks to stop that he may travel on, Who desires less than what may transpire, Decays, but will not renew. 16. Decay and Renewal Empty the self completely; Embrace perfect peace. The world will rise and move; Watch it return to rest. All the flourishing things Will return to their source. This return is peaceful; It is the flow of nature, An eternal decay and renewal. Accepting this brings enlightenment, Ignoring this brings misery. Who accepts nature's flow becomes all-cherishing; Being all-cherishing he becomes impartial; Being impartial he becomes magnanimous; Being magnanimous he becomes natural; Being natural he becomes one with the Way; Being one with the Way he becomes immortal: Though his body will decay, the Way will not. 17. Rulers The best rulers are scarcely known by their subjects; The next best are loved and praised; The next are feared; The next despised: They have no faith in their people, And their people become unfaithful to them. When the best rulers achieve their purpose Their subjects claim the achievement as their own. 18. Hypocrisy When the Way is forgotten Duty and justice appear; Then knowledge and wisdom are born Along with hypocrisy. When harmonious relationships dissolve Then respect and devotion arise; When a nation falls to chaos Then loyalty and patriotism are born. 19. Simplify If we could discard knowledge and wisdom Then people would profit a hundredfold; If we could discard duty and justice Then harmonious relationships would form; If we could discard artifice and profit Then waste and theft would disappear. Yet such remedies treat only symptoms And so they are inadequate. People need personal remedies: Reveal your naked self and embrace your original nature; Bind your self-interest and control your ambition; Forget your habits and simplify your affairs. 20. Wandering What is the difference between assent and denial? What is the difference between beautiful and ugly? What is the difference between fearsome and afraid? The people are merry as if at a magnificent party Or playing in the park at springtime, But I am tranquil and wandering, Like a newborn before it learns to smile, Alone, with no true home. The people have enough and to spare, Where I have nothing, And my heart is foolish, Muddled and cloudy. The people are bright and certain, Where I am dim and confused; The people are clever and wise, Where I am dull and ignorant; Aimless as a wave drifting over the sea, Attached to nothing. The people are busy with purpose, Where I am ipractical and rough; I do not share the peoples' cares But I am fed at nature's breast. 21. Accept Harmony is only in following the Way. The Way is without form or quality, But expresses all forms and qualities; The Way is hidden and implicate, But expresses all of nature; The Way is unchanging, But expresses all motion. Beneath sensation and memory The Way is the source of all the world. How can I understand the source of the world? By accepting. 22. Home Accept and you become whole, Bend and you straighten, Empty and you fill, Decay and you renew, Want and you acquire, Fulfill and you become confused. The sage accepts the world As the world accepts the Way; He does not display himself, so is clearly seen, Does not justify himself, so is recognized, Does not boast, so is credited, Does not pride himself, so endures, Does not contend, so none contend against him. The ancients said, "Accept and you become whole", Once whole, the world is as your home. 23. Words Nature says only a few words: High wind does not last long, Nor does heavy rain. If nature's words do not last Why should those of man? Who accepts harmony, becomes harmonious. Who accepts loss, becomes lost. For who accepts harmony, the Way harmonizes with him, And who accepts loss, the Way cannot find. 24. Indulgence Straighten yourself and you will not stand steady; Display yourself and you will not be clearly seen; Justify yourself and you will not be respected; Promote yourself and you will not be believed; Pride yourself and you will not endure. These behaviours are wasteful, indulgent, And so they attract disfavour; Harmony avoids them. 25. Beneath Abstraction There is a mystery, Beneath abstraction, Silent, depthless, Alone, unchanging, Ubiquitous and liquid, The mother of nature. It has no name, but I call it "the Way"; It has no limit, but I call it "limitless". Being limitless, it flows away forever; Flowing away forever, it returns to my self: The Way is limitless, So nature is limitless, So the world is limitless, And so I am limitless. For I am abstracted from the world, The world from nature, Nature from the Way, And the Way from what is beneath abstraction. 26. Calm Gravity is the source of lightness, Calm, the master of haste. A lone traveller will journey all day, watching over his belongings; Only safe in his own bed may he lose them in sleep. So the captain of a great vessel should not act lightly or hastily. Acting lightly, he loses sight of the world, Acting hastily, he loses control of himself. The captain can not treat his great ship as a small boat; Rather than glitter like jade He must stand like stone. 27. Perfection The perfect traveller leaves no trail to be followed; The perfect speaker leaves no question to be answered; The perfect accountant leaves no working to be completed; The perfect container leaves no lock to be closed; The perfect knot leaves no end to be ravelled. So the sage nurtures all men And abandons no one. He accepts everything And rejects nothing. He attends to the smallest details. For the strong must guide the weak; The weak are raw material to the strong. If the guide is not respected, Or the material is not cared for, Confusion will result, no matter how clever one is. This is the secret of perfection: When raw wood is carved, it becomes a tool; When a man is employed, he becomes a tool; The perfect carpenter leaves no wood to be carved. 28. Becoming Using the male, being female, Being the entrance of the world, You embrace harmony And become as a newborn. Using strength, being weak, Being the root of the world, You complete harmony And become as unshaped wood. Using the light, being dark, Being the world, You perfect harmony And return to the Way. 29. Ambition Those who wish to change the world According with their desire Cannot succeed. The world is shaped by the Way; It cannot be shaped by the self. Trying to change it, you damage it; Trying to possess it, you lose it. So some will lead, while others follow. Some will be warm, others cold Some will be strong, others weak. Some will get where they are going While others fall by the side of the road. So the sage will be neither extravagant nor violent. 30. Violence Powerful men are well advised not to use violence, For violence has a habit of returning; Thorns and weeds grow wherever an army goes, And lean years follow a great war. A general is well advised To achieve nothing more than his orders: Not to take advantage of his victory. Nor to glory, boast or pride himself; To do what is dictated by necessity, Not by choice. For even the strongest force will weaken with time, And then its violence will return, and kill it. 31. Armies Armies are tools of violence; They cause men to hate and fear. The sage will not join them. His purpose is creation; Their purpose is destruction. Weapons are tools of violence, Not of the sage; He uses them only when there is no choice, And then calmly, and with tact, For he finds no beauty in them. Whoever finds beauty in weapons Delights in the slaughter of men; And who delights in slaughter Cannot content himself with peace. So slaughters must be mourned And conquest celebrated with a funeral. 32. Shapes The Way has no true shape, And therefore none can control it. If a ruler could control the Way All things would follow In harmony with his desire, And sweet rain would fall, Effortlessly slaking every thirst. The Way is shaped by use, But then the shape is lost. Do not hold fast to shapes But let sensation flow into the world As a river courses down to the sea. 33. Virtues Who understands the world is learned; Who understands the self is enlightened. Who conquers the world has strength; Who conquers the self has harmony; Who is determined has purpose. Who is contented has wealth; Who defends his home may long endure; Who surrenders his home may long survive it. 34. Control The Way flows and ebbs, creating and destroying, Implementing all the world, attending to the tiniest details, Claiming nothing in return. It nurtures all things, Though it does not control them; It has no intention, So it seems inconsequential. It is the substance of all things; Though it does not control them; It has no exception, So it seems all-important. The sage would not control the world;  He is in harmony with the world. 35. Peace If you offer music and food Strangers may stop with you; But if you accord with the Way All the people of the world will keep you In safety, health, community, and peace. The Way lacks art and flavour; It can neither be seen  or heard, But its benefit cannot be exhausted.  36. Opposition To reduce someone's influence, first expand it; To reduce someone's force, first increase it; To overthrow someone, first exalt them; To take from someone, first give to them. This is the subtlety by which the weak overcome the strong: Fish should not leave their depths, And swords should not leave their scabbards.
+
+[Test_9.15]
+WSPMethod=67
+WSPURI=http://10.32.194.45/upload/tao.txt
+//WSPURI=http://10.35.2.4/upload/tao.txt
+//WSPHeaders=Accept-Language: English
+
+[Test_9.16]
+WSPMethod=68
+WSPURI=http://10.35.2.4/wap/wstiot/
+WSPHeaders=Accept-Language: English
+
+[Test_9.17]
+WSPMethod=65
+WSPURI=http://10.35.2.4/*
+WSPHeaders=Accept-Language: English
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/testdata/WapSIMTSY.txt	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,271 @@
+[test411]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=55000C9144775622322100F5A77B040402E2E2424547494E3A56434152445C725C6E56455253494F4E3A322E315C725C6E464E3A4A616C5C725C6E4E3A4A616C5C725C6E4F52473A50616E536F6674776172655C725C6E5449544C453A4469726563746F725C725C6E4C4142454C3A49736C696E67746F6E5C725C6E454E443A56434152445C725C6E,447765222312,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=440C9144775622322100F5308010118590407B040402E2E2424547494E3A56434152445C725C6E56455253494F4E3A322E315C725C6E464E3A4A616C5C725C6E4E3A4A616C5C725C6E4F52473A50616E536F6674776172655C725C6E5449544C453A4469726563746F725C725C6E4C4142454C3A49736C696E67746F6E5C725C6E454E443A56434152445C725C6E, 447765222312
+SmsStartRxDelay= 4207, 1, 1
+
+[test413]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  440C914477562232210000307003615225409F0500030402015EAFE97059A4156930184C068B8184C563D2A9B30E83CCA29318946E5E6E6B513A4D3E9DBA980BB679B985C563D2A9B316AD452775F3720F83D4E2F1294D16A7BA66B1484D3A8F9B977B4A0D52AB531DB5E8A406A9496B71F37213A9536A504AD5C960B0188C068B5161B3190C06D36E5E6E22B5E824EA6430580C4683C5A830DA0C06836901, 447765222312        
+SmsRx=440C9144775622322100003070036152754016050003040202362FF7B4DA6C06A5595DB33C9F03, 447765222312   
+SmsRx=040C9144775622322100003070036162504094AFD774B82CD28A34180C2683C940E173DA7D0635CB657ADA7DDEBCDCC4E274284D42A9C9A7532794A7E9EE721E14769341CAFA9C9E7683E86F90BC6C4F97EF2077F95E9ED34170F91BFE9E87D9A076985E96A7C3ECCDCB3D6406A7531D549AB406A9C5CDCB5D741275D6A2B5E8A46E5EEEA293A8B30E83CCA29318946E5EF2CDCB0D, 447765222312
+SmsStartRxDelay= 4207, 1, 3
+
+[test415]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=15000C914477562232210000A78EAFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95386D99B977CF3723B75CA307BF3926F5EEEA7F4A88386DDD3B7997E0FCBCB9B977CF3725393546651474CCBCB63FA5BBE79C9372F3733282C3275C9393BED3ED3DFEECD4BBE79B98B4EA2CE3A0C4A899B977CF37203,447765222312,12, 01A0, 0     
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  040C914477562232210000308010219024408EAFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95386D99B977CF3723B75CA307BF3926F5EEEA7F4A88386DDD3B7997E0FCBCB9B977CF3725393546651474CCBCB63FA5BBE79C9372F3733282C3275C9393BED3ED3DFEECD4BBE79B98B4EA2CE3A0C4A899B977CF37203, 447765222312
+SmsStartRxDelay= 4207, 1, 1
+
+[test421]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=55000C9144775622322100F5A77B0404020101424547494E3A56434152445C725C6E56455253494F4E3A322E315C725C6E464E3A4A616C5C725C6E4E3A4A616C5C725C6E4F52473A50616E536F6674776172655C725C6E5449544C453A4469726563746F725C725C6E4C4142454C3A49736C696E67746F6E5C725C6E454E443A56434152445C725C6E,447765222315,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  440C9144775622322100F5307003513340407B0404020101424547494E3A56434152445C725C6E56455253494F4E3A322E315C725C6E464E3A4A616C5C725C6E4E3A4A616C5C725C6E4F52473A50616E536F6674776172655C725C6E5449544C453A4469726563746F725C725C6E4C4142454C3A49736C696E67746F6E5C725C6E454E443A56434152445C725C6E, 447765222315
+SmsStartRxDelay= 4207, 1, 1
+
+[test423]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  440C914477562232210000307013017510409F0500030002015EAFE970098BC16230184C068B8184C563D2A9B30E83CCA29318946E5E6E6B513A4D3E9DBA980BB679B985C563D2A9B316AD452775F3720F83D4E2F1294D16A7BA66B1484D3A8F9B977B4A0D52AB531DB5E8A406A9496B71F37213A9536A504AD5C960B0188C068B5161B3190C06D36E5E6E22B5E824EA6430580C4683C5A830DA0C06836901, 447765222312        
+SmsRx=440C9144775622322100003070130175114016050003000202362FF7B4DA6C06A5595DB33C9F03, 447765222312       
+SmsRx=040C9144775622322100003070130175024094AFD774B884C56031180C2683C940E173DA7D0635CB657ADA7DDEBCDCC4E274284D42A9C9A7532794A7E9EE721E14769341CAFA9C9E7683E86F90BC6C4F97EF2077F95E9ED34170F91BFE9E87D9A076985E96A7C3ECCDCB3D6406A7531D549AB406A9C5CDCB5D741275D6A2B5E8A46E5EEEA293A8B30E83CCA29318946E5EF2CDCB0D, 447765222312
+SmsStartRxDelay= 4207, 1, 3
+
+[test425]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  440C9144775622322100F5307013514502408C09040201010003050301424547494E3A5643414C454E4441525C6E56455253494F4E3A312E305C6E424547494E3A564556454E545C6E43415445474F524945533A4D454554494E475C6E5354415455533A54454E5441544956455C6E445453544152543A3230303130343031543033333030305A5C6E4454454E443A3230303130343031543034333030305A, 447765222312        
+SmsRx=440C9144775622322100F5307013514562408C090402010100030503025C6E53554D4D4152593A4D6573736167696E67204D656574696E675C6E4445534352495054494F4E3A427269746E657920616E64204A757374696E20746F20726576696577206E65776573742070726F706F73616C206D6174657269616C5C6E434C4153533A505249564154455C6E454E443A564556454E545C6E454E443A564341, 447765222312       
+SmsRx=440C9144775622322100F53070135145134014090402010100030503034C454E4441525C725C6E, 447765222312
+SmsStartRxDelay= 4207, 1, 3
+
+[test426]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=55000C9144775622322100F5A77D0605041581158130323441334135393331424442444239393545343034303034344438463531313431363631353631333631313632344432353434353835393835353834443835313835353235353835353834353834443834353835353834353834443839333443353131363234433330444230443330423338303030,447765222312,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=440C9144775622322100F5309030710491407D0605041581158130323441334135393331424442444239393545343034303034344438463531313431363631353631333631313632344432353434353835393835353834443835313835353235353835353834353834443834353835353834353834443839333443353131363234433330444230443330423338303030, 447765222312        
+SmsStartRxDelay= 4207, 1, 1
+
+[test427]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx= 440C9144775622322100F5309030810000408C0B050415881588000303030131206E657720656D61696C206D6573736167655C6E2046726F6D3A204B616D72616E204E6F62617269203C4B616D72616E2E4E6F626172694053796D6269616E2E636F6D3E5C6E205375626A6563743A2074657374206F6E6C792C20706C656173652069676E6F72655C6E2073697A653A2034324B425C6E206174743A315C6E, 447765222312        
+SmsRx= 440C9144775622322100F5309030810060408C0B050415881588000303030220546F3A20536F6D656F6E65203C736F6D656F6E65406E6F77686572652E636F6D3E5C6E20446174653A20332053657074656D6265722032303033202B303030305C6E2073656E6465723A4B616D72616E2E4E6F626172694073796D6269616E2E636F6D5C6E207265706C792D746F3A20736F6D656F6E652E656C7365405379, 447765222312       
+SmsRx= 440C9144775622322100F530903081002140490B05041588158800030303036D6269616E2E636F6D5C6E20666C64723A20757365722E736D6172746D652E746869732E666F6C6465722E69732E666F722E6A756E6B2E6D61696C5C6E, 447765222312
+SmsStartRxDelay= 4207, 1, 3
+
+[test428]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx= 440C9144775622322100F5309030815001408C0B0504157F157F000304020157656C636F6D65215C6E20496E616D653A2044656D6F6E5C6E20497569643A207073696F6E385C6E20497077643A207365637265745C6E204974656C3A202B3132333435363738393031323334355C6E204969703A203132332E3132332E3132332E3132335C6E2049646E73313A203132332E3132332E3132332E3132335C6E, 447765222312        
+SmsRx= 440C9144775622322100F530903081505140230B0504157F157F00030402022049646E73323A203132332E3132332E3132332E313234, 447765222312       
+SmsStartRxDelay= 4207, 1, 2
+
+[test429]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsTx=00, 447765222312,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx= 440C9144775622322100F5309050014521408C0B050415821582000305020133303432463435303A30413030343830453A30313030303030303A30303030303030303A30303030303030303A30303030303030303A30303030303031453A30303030303030303A30323030303030303A32313030303030313A30303032303030303A30303231303030303A30313030303230303A30303030323133433A3733, 447765222312        
+SmsRx= 440C9144775622322100F5309050014571403F0B05041582158200030502023339394343323A30373145373032313A32323841303532323A38323038413238383A32313232464133443A3232383230384132, 447765222312       
+SmsStartRxDelay= 4207, 1, 2
+
+[test431]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=
+440C9144775622322100F530600351120340580605040B840B8459060A03AE81EAAF828DC4B48401056A0045C60D0373796D6269616E2E636F6D00110353492F34393534372F323738000AC3072003061613205310C3072003063013205807010320414C45525420000101, 447765222315
+SmsStartRxDelay= 0, 0, 1
+
+[test441]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=
+440C9144775622322100F53080103112444056040402010159060A03AE81EAAF828DC4B48401056A0045C60D0373796D6269616E2E636F6D00110353492F34393534372F323738000AC3072003061613205310C3072003063013205807010320414C45525420000101, 447765222315
+SmsStartRxDelay= 0, 0, 1
+
+
+[test2]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=55000C914477562232510000A79F0500030002015EAFE97059A4156930184C068B8184C563D2A9B30E83CCA29318946E5E6E6B513A4D3E9DBA980BB679B985C563D2A9B316AD452775F3720F83D4E2F1294D16A7BA66B1484D3A8F9B977B4A0D52AB531DB5E8A406A9496B71F37213A9536A504AD5C960B0188C068B5161B3190C06D36E5E6E22B5E824EA6430580C4683C5A830DA0C06836901, 447765222315,12, 01A0, 0
+SmsTx=55000C914477562232510000A716050003000202362FF7B4DA6C06A5595DB33C9F03, 447765222315,12, 01A0, 0
+SmsTx=15000C914477562232510000A794AFD774B82CD28A34180C2683C940E173DA7D0635CB657ADA7DDEBCDCC4E274284D42A9C9A7532794A7E9EE721E14769341CAFA9C9E7683E86F90BC6C4F97EF2077F95E9ED34170F91BFE9E87D9A076985E96A7C3ECCDCB3D6406A7531D549AB406A9C5CDCB5D741275D6A2B5E8A46E5EEEA293A8B30E83CCA29318946E5EF2CDCB0D, 447765222315,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  440C914477562232510000306062516261409F0500030F02015EAFE97059A4156930184C068B8184C563D2A9B30E83CCA29318946E5E6E6B513A4D3E9DBA980BB679B985C563D2A9B316AD452775F3720F83D4E2F1294D16A7BA66B1484D3A8F9B977B4A0D52AB531DB5E8A406A9496B71F37213A9536A504AD5C960B0188C068B5161B3190C06D36E5E6E22B5E824EA6430580C4683C5A830DA0C06836901, 447765222315
+SmsRx=440C91447756223251000030606251620240160500030F0202362FF7B4DA6C06A5595DB33C9F03, 447765222315
+SmsRx=040C9144775622325100003060626191124094AFD774B82CD28A34180C2683C940E173DA7D0635CB657ADA7DDEBCDCC4E274284D42A9C9A7532794A7E9EE721E14769341CAFA9C9E7683E86F90BC6C4F97EF2077F95E9ED34170F91BFE9E87D9A076985E96A7C3ECCDCB3D6406A7531D549AB406A9C5CDCB5D741275D6A2B5E8A46E5EEEA293A8B30E83CCA29318946E5EF2CDCB0D, 447765222315
+SmsStartRxDelay= 4207, 1, 3
+
+[test3]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx=15000C914477562232510000A795AFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95B86DBF2B07BF3926F5E6EA76E196E8BDFE474D8BD79C9372FF7537AD42DC36D79D83D7D9BE9F7B0BCBC79C9372F373549651675C3E273F3926F5E6E66505864EA927376DA7DA6BFDD9B977CF372179D449D75189412372FF9E6E506, 447765222315,12, 01A0, 0
+SmsTx=15000C914477562232510000A78EAFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95386D99B977CF3723B75CA307BF3926F5EEEA7F4A88386DDD3B7997E0FCBCB9B977CF3725393546651474CCBCB63FA5BBE79C9372F3733282C3275C9393BED3ED3DFEECD4BBE79B98B4EA2CE3A0C4A899B977CF37203, 447765222315,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=040C9144775622325100003060724135804095AFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95B86DBF2B07BF3926F5E6EA76E196E8BDFE474D8BD79C9372FF7537AD42DC36D79D83D7D9BE9F7B0BCBC79C9372F373549651675C3E273F3926F5E6E66505864EA927376DA7DA6BFDD9B977CF372179D449D75189412372FF9E6E506, 447765222315
+SmsRx=040C914477562232510000306062113084408EAFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95386D99B977CF3723B75CA307BF3926F5EEEA7F4A88386DDD3B7997E0FCBCB9B977CF3725393546651474CCBCB63FA5BBE79C9372F3733282C3275C9393BED3ED3DFEECD4BBE79B98B4EA2CE3A0C4A899B977CF37203, 447765222315
+SmsStartRxDelay= 4207, 1, 2
+
+[test123]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx= 15000C914477562232510000A78EAFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95386D99B977CF3723B75CA307BF3926F5EEEA7F4A88386DDD3B7997E0FCBCB9B977CF3725393546651474CCBCB63FA5BBE79C9372F3733282C3275C9393BED3ED3DFEECD4BBE79B98B4EA2CE3A0C4A899B977CF37203, 447765222315,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  040C914477562232510000306062113084408EAFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95386D99B977CF3723B75CA307BF3926F5EEEA7F4A88386DDD3B7997E0FCBCB9B977CF3725393546651474CCBCB63FA5BBE79C9372F3733282C3275C9393BED3ED3DFEECD4BBE79B98B4EA2CE3A0C4A899B977CF37203, 447765222315
+SmsStartRxDelay= 4207, 1, 1
+
+[test5]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  440C9144775622325100F530600351120340580605040B840B8459060A03AE81EAAF828DC4B48401056A0045C60D0373796D6269616E2E636F6D00110353492F34393534372F323738000AC3072003061613205310C3072003063013205807010320414C45525420000101, 447765222315
+SmsStartRxDelay= 0, 0, 3
+
+[test6]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx= 15000C914477562232510000A78EAFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95386D99B977CF3723B75CA307BF3926F5EEEA7F4A88386DDD3B7997E0FCBCB9B977CF3725393546651474CCBCB63FA5BBE79C9372F3733282C3275C9393BED3ED3DFEECD4BBE79B98B4EA2CE3A0C4A899B977CF37203, 447765222315,12, 01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  040C914477562232510000306062113084408EAFD774B82CCA40C2E231E9D45987412971F3926F5E6E6B513A4D3E9D3A992BB679C9372FB7D1A95386D99B977CF3723B75CA307BF3926F5EEEA7F4A88386DDD3B7997E0FCBCB9B977CF3725393546651474CCBCB63FA5BBE79C9372F3733282C3275C9393BED3ED3DFEECD4BBE79B98B4EA2CE3A0C4A899B977CF37203, 447765222315
+SmsStartRxDelay= 4207, 1, 1
+
+[test7]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=
+440C9144775622325100F530600351120340580605040B840B8459060A03AE81EAAF828DC4B48401056A0045C60D0373796D6269616E2E636F6D00110353492F34393534372F323738000AC3072003061613205310C3072003063013205807010320414C45525420000101, 447765222315
+SmsStartRxDelay= 0, 0, 1
+
+[test8]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=  440C9144775622325100F530600351120340580605040B840B8459060A03AE81EAAF828DC4B48401056A0045C60D0373796D6269616E2E636F6D00110353492F34393534372F323738000AC3072003061613205310C3072003063013205807010320414C45525420000101, 447765222315
+SmsRx=  440C9144775622325100F530600351120340580605040B840B8459060A03AE81EAAF828DC4B48401056A0045C60D0373796D6269616E2E636F6D00110353492F34393534372F323738000AC3072003061613205310C3072003063013205807010320414C45525420000101, 447765222315
+SmsStartRxDelay= 0, 0, 2
+
+[test9]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx=
+440C9144775622325100F530600351120340580605040B840B8459060A03AE81EAAF828DC4B48401056A0045C60D0373796D6269616E2E636F6D00110353492F34393534372F323738000AC3072003061613205310C3072003063013205807010320414C45525420000101, 447765222315
+SmsStartRxDelay= 0, 0, 1
+
+[test10]
+DiallingPauseDuration= 3
+ConnectingPauseDuration= 1
+DisconnectingPauseDuration= 5
+AnswerIncomingPauseDuration= 5
+SmsTxPause= 2
+SmsTx= 15000C914477562232510000A791AFD774B864C284381A48583C269D3AEB3028256E5EF2CDCB6D2D4AA7C9A7532773C5362FF9E6E5363A75CA307BF3926F5E6EA74E19666F5EF2CDCBFD941E75D0B07BFA36D3EF617979F3926F5E6E6A92CA2CEA886979794C7FCB372FF9E6E566068545A62E3967A7DD67FADBBD79C9372F77D149D45987412971F3926F5E6E, 447765222315,12,01A0, 0
+SmsAckNackPause= 1
+SmsRxPeriod= 2
+SmsRx= 040C9144775622325100003070700103634091AFD774B864C284381A48583C269D3AEB3028256E5EF2CDCB6D2D4AA7C9A7532773C5362FF9E6E5363A75CA307BF3926F5E6EA74E19666F5EF2CDCBFD941E75D0B07BFA36D3EF617979F3926F5E6E6A92CA2CEA886979794C7FCB372FF9E6E566068545A62E3967A7DD67FADBBD79C9372F77D149D45987412971F3926F5E6E,447765222315
+SmsStartRxDelay= 4207, 1, 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/testdata/WapStackSuite.ini	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,404 @@
+[COMMON]
+Bearer=3
+Remote_Host=+447765222312
+Local_Host=+447765222312
+Remote_Port=226
+Local_Port=226
+TimeOut=0
+ExError=0
+ExError2=0
+SimTsy=true
+TsyState=411
+WSPHeaderLength=50
+WSPBodyLength=50
+WDPBufLength=30
+AwaitLengthCancel=false
+MiddleCancel=false
+MultiReadCancel=false
+AwaitLengthTwice=false
+DetailedLogging=true
+Secure=0
+WSPMethod=1
+WSPHeaders=GET:
+WSPBody=EMPTY-001-002-003-004-005-006-007-END
+WSPURI=http://wap.wapgateway.com
+
+
+[Test_2.1]
+Bearer=2
+DelayPortClosure=true
+
+[Test_2.1.1]
+Bearer=2
+ExError=-5498
+
+[Test_2.1.2]
+Bearer=2
+Local_Port=5501
+
+[Test_2.1.3]
+Bearer=2
+Local_Port=5502
+
+[Test_2.2]
+Bearer=3
+
+[Test_2.3]
+Bearer=4
+
+[Test_2.4]
+Bearer=5
+
+[Test_2.5]
+Bearer=1
+
+[Test_2.6]
+Bearer=0
+
+[Test_2.7]
+Bearer=-1
+ExError=-5499
+
+[Test_2.8]
+Bearer=3
+Secure=true
+ExError=-5
+
+[Test_2.9]
+Bearer=0
+ExError=-5499
+
+[Test_2.10]
+Bearer=3
+Reconnect=true
+ExError=-14
+
+// API Request without connect 
+[Test_3]
+ExError=-18
+
+// Send and receive VCARD For Bound WDP (single read)
+[Test_4.1.1]
+Bearer=3
+Local_Port=226
+Remote_Port=226
+Type=VCARD
+TsyState=411
+WDPBufLength=118
+Data=BEGIN:VCARD\r\nVERSION:2.1\r\nFN:Jal\r\nN:Jal\r\nORG:PanSoftware\r\nTITLE:Director\r\nLABEL:Islington\r\nEND:VCARD\r\n
+
+// Send and receive VCARD For Bound WDP(Multi read)
+[Test_4.1.2]
+Bearer=3
+Local_Port=226
+Remote_Port=226
+Type=VCARD
+TsyState=411
+WDPBufLength=30
+Data=BEGIN:VCARD\r\nVERSION:2.1\r\nFN:Jal\r\nN:Jal\r\nORG:PanSoftware\r\nTITLE:Director\r\nLABEL:Islington\r\nEND:VCARD\r\n
+
+// Send and receive VCALENDAR For Bound WDP(single read)
+[Test_4.1.3]
+Bearer=2
+Local_Port=228
+Remote_Port=228
+TsyState=413
+Type=VCALENDAR
+WDPBufLength=512
+Data=BEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nCATEGORIES:MEETING\nSTATUS:TENTATIVE\nDTSTART:20010401T033000Z\nDTEND:20010401T043000Z\nSUMMARY:Messaging Meeting\nDESCRIPTION:Britney and Justin to review newest proposal material\nCLASS:PRIVATE\nEND:VEVENT\nEND:VCALENDAR\r\n
+
+// Send and receive VCALENDAR For Bound WDP(single read)
+[Test_4.1.4]
+Bearer=2
+Local_Port=228
+Remote_Port=228
+TsyState=413
+Type=VCALENDAR
+WDPBufLength=80
+Data=BEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nCATEGORIES:MEETING\nSTATUS:TENTATIVE\nDTSTART:20010401T033000Z\nDTEND:20010401T043000Z\nSUMMARY:Messaging Meeting\nDESCRIPTION:Britney and Justin to review newest proposal material\nCLASS:PRIVATE\nEND:VEVENT\nEND:VCALENDAR\r\n
+
+// Send and receive VCARD For Bound WDP (single read)
+[Test_4.1.5]
+Bearer=2
+Local_Port=226
+Remote_Port=226
+Type=VCARD
+TsyState=415
+WDPBufLength=118
+Data=BEGIN:VCARD\r\nVERSION:2.1\r\nFN:Jal\r\nN:Jal\r\nORG:PanSoftware\r\nTITLE:Director\r\nLABEL:Islington\r\nEND:VCARD\r\n
+
+// Send and receive Ring Tone for Bound WDP
+[Test_4.1.5.1]
+Bearer=3
+Local_Port=5505
+Remote_Port= 5505
+Type= RINGTONE
+TsyState=426
+Data=024A3A5931BDBDB995E4040044D8F511416615613611624D2544585985584D85185525585584584D84585584584D8934C511624C30DB0D30B38000
+
+// Send and receive Email notification for Bound WDP
+[Test_4.1.5.2]
+Bearer=3
+Local_Port=5512
+Remote_Port= 5512
+Type= EMAILNOTIFICATION
+TsyState=427
+Data=1 new email message\n From: Kamran Nobari <Kamran.Nobari@Symbian.com>\n Subject: test only, please ignore\n size: 42KB\n att:1\n To: Someone <someone@nowhere.com>\n Date: 3 September 2003 +0000\n sender:Kamran.Nobari@symbian.com\n reply-to: someone.else@Symbian.com\n fldr: user.smartme.this.folder.is.for.junk.mail\n
+
+// Send and receive Internet Access configuration for Bound WDP
+[Test_4.1.5.3]
+Bearer=3
+Local_Port=5503
+Remote_Port= 5503
+Type= IACONFIG
+TsyState=428
+Data= Welcome!\n Iname: Demon\n Iuid: psion8\n Ipwd: secret\n Itel: +123456789012345\n Iip: 123.123.123.123\n Idns1: 123.123.123.123\n Idns2: 123.123.123.124
+
+// Send and receive operator logo for Bound WDP
+[Test_4.1.5.4]
+Bearer=3
+Local_Port=5506
+Remote_Port= 5506
+Type=OprtrLogo
+TsyState=429
+Data=3042F450:0A00480E:01000000:00000000:00000000:00000000:0000001E:00000000:02000000:21000001:00020000:00210000:01000200:0000213C:73399CC2:071E7021:228A0522:8208A288:2122FA3D:228208A2
+
+// Cancel For Bound WDP
+[Test_4.1.6]
+Bearer=3
+Local_Port=226
+Remote_Port=226
+Type=VCARD
+TsyState=411
+WDPBufLength=30
+AwaitLengthCancel=true
+ExError=-3
+Data=BEGIN:VCARD\r\nVERSION:2.1\r\nFN:Jal\r\nN:Jal\r\nORG:PanSoftware\r\nTITLE:Director\r\nLABEL:Islington\r\nEND:VCARD\r\n
+
+// Cancel For Bound WDP
+[Test_4.1.7]
+Bearer=3
+Local_Port=226
+Remote_Port=226
+Type=VCARD
+TsyState=411
+WDPBufLength=30
+MiddleCancel=true
+ExError=-3
+Data=BEGIN:VCARD\r\nVERSION:2.1\r\nFN:Jal\r\nN:Jal\r\nORG:PanSoftware\r\nTITLE:Director\r\nLABEL:Islington\r\nEND:VCARD\r\n
+
+// Cancel For Bound WDP
+[Test_4.1.8]
+Bearer=3
+Local_Port=226
+Remote_Port=226
+Type=VCARD
+TsyState=411
+WDPBufLength=30
+MultiReadCancel=true
+ExError=-3
+Data=BEGIN:VCARD\r\nVERSION:2.1\r\nFN:Jal\r\nN:Jal\r\nORG:PanSoftware\r\nTITLE:Director\r\nLABEL:Islington\r\nEND:VCARD\r\n
+
+// AwaitDataSize twice
+[Test_4.1.9]
+Bearer=3
+Local_Port=226
+Remote_Port=226
+Type=VCARD
+TsyState=411
+WDPBufLength=30
+AwaitLengthTwice=true
+ExError=-14
+Data=BEGIN:VCARD\r\nVERSION:2.1\r\nFN:Jal\r\nN:Jal\r\nORG:PanSoftware\r\nTITLE:Director\r\nLABEL:Islington\r\nEND:VCARD\r\n
+
+// Send and receive VCALENDAR For FullySpec WDP(single read)
+[Test_4.2.1]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+Type=VCALENDAR
+TsyState=421
+WDPBufLength=118
+Data=BEGIN:VCARD\r\nVERSION:2.1\r\nFN:Jal\r\nN:Jal\r\nORG:PanSoftware\r\nTITLE:Director\r\nLABEL:Islington\r\nEND:VCARD\r\n
+
+// Send and receive VCALENDAR For FullySpec WDP(multi read)
+[Test_4.2.2]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+Type=VCALENDAR
+TsyState=421
+WDPBufLength=30
+Data=BEGIN:VCARD\r\nVERSION:2.1\r\nFN:Jal\r\nN:Jal\r\nORG:PanSoftware\r\nTITLE:Director\r\nLABEL:Islington\r\nEND:VCARD\r\n
+
+// Send and receive VCALENDAR For FullySpec WDP(single read)
+[Test_4.2.3]
+Bearer=2
+Local_Port=1
+Remote_Port=1
+Type=VCALENDAR
+TsyState=423
+WDPBufLength=512
+Data=BEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nCATEGORIES:MEETING\nSTATUS:TENTATIVE\nDTSTART:20010401T033000Z\nDTEND:20010401T043000Z\nSUMMARY:Messaging Meeting\nDESCRIPTION:Britney and Justin to review newest proposal material\nCLASS:PRIVATE\nEND:VEVENT\nEND:VCALENDAR\r\n
+
+// Send and receive VCALENDAR For FullySpec WDP(Multi read)
+[Test_4.2.4]
+Bearer=2
+Local_Port=1
+Remote_Port=1
+Type=VCALENDAR
+TsyState=423
+WDPBufLength=30
+Data=BEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nCATEGORIES:MEETING\nSTATUS:TENTATIVE\nDTSTART:20010401T033000Z\nDTEND:20010401T043000Z\nSUMMARY:Messaging Meeting\nDESCRIPTION:Britney and Justin to review newest proposal material\nCLASS:PRIVATE\nEND:VEVENT\nEND:VCALENDAR\r\n
+
+// Send and receive VCALENDAR For FullySpec WDP(Multi read)
+[Test_4.2.5]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+Type=VCALENDAR
+TsyState=425
+WDPBufLength=30
+Data=BEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nCATEGORIES:MEETING\nSTATUS:TENTATIVE\nDTSTART:20010401T033000Z\nDTEND:20010401T043000Z\nSUMMARY:Messaging Meeting\nDESCRIPTION:Britney and Justin to review newest proposal material\nCLASS:PRIVATE\nEND:VEVENT\nEND:VCALENDAR\r\n
+
+// Cancell receiving VCALENDAR For FullySpec WDP
+[Test_4.2.6]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+Type=VCALENDAR
+TsyState=425
+WDPBufLength=30
+AwaitLengthCancel=true
+ExError=-3
+Data=BEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nCATEGORIES:MEETING\nSTATUS:TENTATIVE\nDTSTART:20010401T033000Z\nDTEND:20010401T043000Z\nSUMMARY:Messaging Meeting\nDESCRIPTION:Britney and Justin to review newest proposal material\nCLASS:PRIVATE\nEND:VEVENT\nEND:VCALENDAR\r\n
+
+// Cancell receiving VCALENDAR For FullySpec WDP
+[Test_4.2.7]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+Type=VCALENDAR
+TsyState=425
+WDPBufLength=30
+MiddleCancel=true
+ExError=-3
+Data=BEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nCATEGORIES:MEETING\nSTATUS:TENTATIVE\nDTSTART:20010401T033000Z\nDTEND:20010401T043000Z\nSUMMARY:Messaging Meeting\nDESCRIPTION:Britney and Justin to review newest proposal material\nCLASS:PRIVATE\nEND:VEVENT\nEND:VCALENDAR\r\n
+
+// Cancell receiving VCALENDAR For FullySpec WDP
+[Test_4.2.8]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+Type=VCALENDAR
+TsyState=425
+ExError=-3
+WDPBufLength=30
+MultiReadCancel=true
+Data=BEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nCATEGORIES:MEETING\nSTATUS:TENTATIVE\nDTSTART:20010401T033000Z\nDTEND:20010401T043000Z\nSUMMARY:Messaging Meeting\nDESCRIPTION:Britney and Justin to review newest proposal material\nCLASS:PRIVATE\nEND:VEVENT\nEND:VCALENDAR\r\n
+
+[Test_4.2.9]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+Type=VCALENDAR
+TsyState=425
+WDPBufLength=30
+AwaitLengthTwice=true
+ExError=-14
+Data=BEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nCATEGORIES:MEETING\nSTATUS:TENTATIVE\nDTSTART:20010401T033000Z\nDTEND:20010401T043000Z\nSUMMARY:Messaging Meeting\nDESCRIPTION:Britney and Justin to review newest proposal material\nCLASS:PRIVATE\nEND:VEVENT\nEND:VCALENDAR\r\n
+
+
+//AwaitPush For Bound API
+[Test_4.3.1]
+Bearer=3
+Local_Port=2948
+Remote_Port=2948
+TsyState=431
+
+//AwaitPush For Bound API
+[Test_4.3.2]
+Bearer=3
+Local_Port=2948
+Remote_Port=2948
+TsyState=431
+WSPHeaderLength=512
+WSPBodyLength=512
+
+[Test_4.3.3]
+Bearer=3
+Local_Port=2948
+Remote_Port=2948
+TsyState=431
+MiddleCancel=true
+ExError=-3
+
+[Test_4.3.4]
+Bearer=3
+Local_Port=2948
+Remote_Port=2948
+TsyState=431
+MultiReadCancel=true
+ExError=-3
+
+//AwaitPush For FullySpec API
+[Test_4.4.1]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+TsyState=441
+
+//AwaitPush For FullySpec API
+[Test_4.4.2]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+TsyState=441
+WSPHeaderLength=512
+WSPBodyLength=512
+
+//AwaitPush For FullySpec API
+[Test_4.4.3]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+TsyState=441
+MiddleCancel=true
+ExError=-3
+
+//AwaitPush For FullySpec API
+[Test_4.4.4]
+Bearer=3
+Local_Port=1
+Remote_Port=1
+TsyState=441
+MultiReadCancel=true
+ExError=-3
+
+
+//TimeOut
+[Test_6.1]
+Local_Port=2948
+Remote_Port=2948
+WSPHeaderLength=10
+WSPBodyLength=10
+TimeOut=100000
+ExError=-33
+
+//Wrong Sequence
+[Test_7.1]
+WDPBufLength=10
+WSPHeaderLength=10
+WSPBodyLength=10
+TsyState=411
+ExError=-14
+
+//Invalid parameter
+[Test_8]
+WSPMethod=0x30
+WSPHeaders=GET:
+WSPBody=EMPTY-001-002-003-004-005-006-007-END
+WSPURI=http://wap.wapgateway.com
+ExError=-5448
+ExError2=-6
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/testdata/WapStackSuite.xml	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,859 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2003-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:
+ CommDB Settings File
+ All Rights Reserved
+
+-->
+
+
+
+<CommDB:Config xmlns="SymbianOS.Generic.Comms-Infras.CommDB"
+               xmlns:CommDB="SymbianOS.Generic.Comms-Infras.CommDB"
+               xmlns:xlink="http://www.w3.org/1999/xlink"
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:schemaLocation="SymbianOS.Generic.Comms-Infras.CommDB CommDB.xsd">
+
+<InformationTable>
+</InformationTable>
+
+<NetworkTable>
+    <Network operation="add">
+        <Name>Intranet</Name>
+    </Network>
+</NetworkTable>
+
+<IAPTable>
+    <IAP operation="add">
+        <Name>Pipex CSD IR</Name>
+        <IAPService>DialOutISP.TEST Network </IAPService>
+        <IAPBearer>ModemBearer.GSM Mobile Phone via Serial</IAPBearer>
+        <IAPNetwork>Network.Intranet</IAPNetwork>
+        <IAPNetworkWeighting>0</IAPNetworkWeighting>
+        <LocationRef>Location.Office Direct Dial</LocationRef>
+    </IAP>
+</IAPTable>
+
+<ModemBearerTable>
+    <ModemBearer operation="template">
+        <Name>Default Modem</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>SIM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>0</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>0</XonChar>
+        <XoffChar>0</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>AT</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+44123456789</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>30</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+    </ModemBearer>
+    <ModemBearer operation="add">
+        <Name>GSM Mobile Phone via Serial 01</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>SIM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>196</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+447785016005</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>30</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+    </ModemBearer>    
+    <ModemBearer operation="add">
+        <Name>GSM Mobile Phone via Serial</Name>
+        <Agent>CSD.agt</Agent>
+        <IfName>PPP</IfName>
+        <PortName>COMM::0</PortName>
+        <TSYName>SIM</TSYName>
+        <CSYName>ECUART</CSYName>
+        <DataBits>8</DataBits>
+        <StopBits>1</StopBits>
+        <Parity>NONE</Parity>
+        <Rate>115200</Rate>
+        <Handshaking>196</Handshaking>
+        <SpecialRate>0</SpecialRate>
+        <XonChar>17</XonChar>
+        <XoffChar>19</XoffChar>
+        <FaxClassPref>AUTO</FaxClassPref>
+        <SpeakerPref>NEVER</SpeakerPref>
+        <SpeakerVolPref>QUIET</SpeakerVolPref>
+        <ModemInitString>ATZ</ModemInitString>
+        <DataInitString>AT</DataInitString>
+        <FaxInitString>AT</FaxInitString>
+        <DialPauseLength>S8=</DialPauseLength>
+        <SpeakerVolContorlLow>L0</SpeakerVolContorlLow>
+        <SpeakerVolControlMedium>L1</SpeakerVolControlMedium>
+        <SpeakerVolControlHigh>L2</SpeakerVolControlHigh>
+        <SpeakerAlwaysOff>M0</SpeakerAlwaysOff>
+        <SpeakerOnUntilCarrier>M1</SpeakerOnUntilCarrier>
+        <SpeakerAlwaysOn>M2</SpeakerAlwaysOn>
+        <SpeakerOnAfterUntilCarrier>M3</SpeakerOnAfterUntilCarrier>
+        <DialToneWaitModifier>W</DialToneWaitModifier>
+        <CallProgress1>X1</CallProgress1>
+        <CallProgress2>X2</CallProgress2>
+        <CallProgress3>X3</CallProgress3>
+        <CallProgress4>X4</CallProgress4>
+        <EchoOff>E0</EchoOff>
+        <VerboseText>V1</VerboseText>
+        <QuietOff>Q0</QuietOff>
+        <QuietOn>Q1</QuietOn>
+        <DialCommandStateModifier>;</DialCommandStateModifier>
+        <OnLine>O</OnLine>
+        <ResetConfiguration>Z</ResetConfiguration>
+        <ReturnToFactoryDefs>&amp;F</ReturnToFactoryDefs>
+        <DCDOnDuringLink>&amp;C1</DCDOnDuringLink>
+        <DTRHangUp>&amp;D2</DTRHangUp>
+        <DSRAlwaysOn>&amp;S0</DSRAlwaysOn>
+        <RTSCTSHandshake>&amp;K3</RTSCTSHandshake>
+        <XonXoffHandshake>&amp;K4</XonXoffHandshake>
+        <EscapeCharacter>+</EscapeCharacter>
+        <EscapeGuardPeriod>S12</EscapeGuardPeriod>
+        <NoDialTone>NO DIAL TONE</NoDialTone>
+        <Busy>BUSY</Busy>
+        <NoAnswer>NO ANSWER</NoAnswer>
+        <Carrier>CARRIER</Carrier>
+        <Connect>CONNECT</Connect>
+        <CompressionClass5>COMPRESSION:CLASS 5</CompressionClass5>
+        <CompressionV42bis>COMPRESSION:V.42 bis</CompressionV42bis>
+        <CompressionNone>COMPRESSION:NONE</CompressionNone>
+        <ProtocolLAPD>PROTOCOL:LAPD</ProtocolLAPD>
+        <ProtocolALT>PROTOCOL:ALT</ProtocolALT>
+        <ProtocolALTCELLULAR>PROTOCOL:ALT-CELLULAR</ProtocolALTCELLULAR>
+        <ProtocolNone>PROTOCOL:NONE</ProtocolNone>
+        <MessageCentreNumber>+447785016005</MessageCentreNumber>
+        <MessageValidityPeriod>1440</MessageValidityPeriod>
+        <MessageDeliveryReport>FALSE</MessageDeliveryReport>
+        <MinimumSignalLevel>9905</MinimumSignalLevel>
+        <LastSocketActivityTimeout>30</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>180</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>30</LastSocketClosedTimeout>
+    </ModemBearer>
+</ModemBearerTable>
+
+<LANBearerTable>
+    <LANBearer operation="add">
+        <Name>Assabet on-board Ethernet</Name>
+        <Agent>nullagent.agt</Agent>
+        <IfName>ethint</IfName>
+        <LDDName>not used</LDDName>
+        <PDDName>not used</PDDName>
+        <LastSocketActivityTimeout>-1</LastSocketActivityTimeout>
+        <LastSessionClosedTimeout>-1</LastSessionClosedTimeout>
+        <LastSocketClosedTimeout>-1</LastSocketClosedTimeout>
+    </LANBearer>
+</LANBearerTable>
+
+<LANServiceTable>
+    <LANService operation="add">
+        <Name>Ethernet</Name>
+        <IfNetworks>ip,ip6</IfNetworks>
+        <IpNetMask>255.255.255.0</IpNetMask>
+        <IpGateway>194.72.6.1</IpGateway>
+        <IpAddr>192.168.0.100</IpAddr>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <IpNameServer1>194.72.6.51</IpNameServer1>
+        <IpNameServer2>194.72.6.52</IpNameServer2>
+    </LANService>
+</LANServiceTable>
+
+<DialInISPTable>
+    <DialInISP operation="template">
+        <Name>Default Dial In ISP</Name>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <UseEdge>FALSE</UseEdge>
+    </DialInISP>
+    <DialInISP operation="add">
+        <Name>Dial In ISP01</Name>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <UseEdge>FALSE</UseEdge>
+    </DialInISP>
+</DialInISPTable>
+
+<DialOutISPTable>
+    <DialOutISP operation="template">
+        <Name>Default Dial Out ISP</Name>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>TRUE</PromptForLogin>
+        <IfPromptForAuth>TRUE</IfPromptForAuth>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerProtocol>0</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+    <DialOutISP operation="add">
+        <Name>TEST0 Network </Name>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <Description>dial in test network </Description>
+        <Type>INTERNETANDWAP</Type>
+        <DefaultTelNum>02075632200</DefaultTelNum>
+        <LoginName>wapusr</LoginName>
+        <LoginPass>train</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfNetworks>ip</IfNetworks>
+        <IfAuthName>wapusr</IfAuthName>
+        <IfAuthPass>train</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpNameServer1>158.43.128.1</IpNameServer1>
+        <IpNameServer2>158.43.192.1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerName>ASYNCHRONOUS</BearerName>
+        <BearerSpeed>UNSPECIFIED</BearerSpeed>
+        <BearerCE>UNSPECIFIED</BearerCE>
+        <BearerType>CSD</BearerType>
+        <ChannelCoding>UNSPECIFIED</ChannelCoding>
+        <AIUR>UNSPECIFIED</AIUR>
+        <RequestedTimeSlots>0</RequestedTimeSlots>
+        <MaximumTimeSlots>0</MaximumTimeSlots>
+        <BearerProtocol>0</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>    
+    <DialOutISP operation="add">
+        <Name>TEST Network </Name>
+        <DialResolution>TRUE</DialResolution>
+        <UseLoginScript>FALSE</UseLoginScript>
+        <PromptForLogin>FALSE</PromptForLogin>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <Description>dial in test network </Description>
+        <Type>INTERNETANDWAP</Type>
+        <DefaultTelNum>02075632200</DefaultTelNum>
+        <LoginName>wapusr</LoginName>
+        <LoginPass>train</LoginPass>
+        <DisplayPCT>FALSE</DisplayPCT>
+        <IfNetworks>ip</IfNetworks>
+        <IfAuthName>wapusr</IfAuthName>
+        <IfAuthPass>train</IfAuthPass>
+        <AuthRetries>0</AuthRetries>
+        <IfCallbackEnabled>FALSE</IfCallbackEnabled>
+        <CallbackTimeout>0</CallbackTimeout>
+        <IpNameServer1>158.43.128.1</IpNameServer1>
+        <IpNameServer2>158.43.192.1</IpNameServer2>
+        <EnableIPHeaderComp>FALSE</EnableIPHeaderComp>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <EnableSWComp>FALSE</EnableSWComp>
+        <BearerService>0</BearerService>
+        <BearerName>ASYNCHRONOUS</BearerName>
+        <BearerSpeed>UNSPECIFIED</BearerSpeed>
+        <BearerCE>UNSPECIFIED</BearerCE>
+        <BearerType>CSD</BearerType>
+        <ChannelCoding>UNSPECIFIED</ChannelCoding>
+        <AIUR>UNSPECIFIED</AIUR>
+        <RequestedTimeSlots>0</RequestedTimeSlots>
+        <MaximumTimeSlots>0</MaximumTimeSlots>
+        <BearerProtocol>0</BearerProtocol>
+        <RlpVersion>0</RlpVersion>
+        <IwfToMs>0</IwfToMs>
+        <MsToIwf>0</MsToIwf>
+        <AckTimer>0</AckTimer>
+        <RetransmissionAttempts>0</RetransmissionAttempts>
+        <ResequencePeriod>0</ResequencePeriod>
+        <V42Compression>0</V42Compression>
+        <V42Codewords>0</V42Codewords>
+        <V42MaxLength>0</V42MaxLength>
+        <Asymmetry>0</Asymmetry>
+        <UserInitUpgrade>FALSE</UserInitUpgrade>
+        <UseEdge>FALSE</UseEdge>
+    </DialOutISP>
+</DialOutISPTable>
+
+<AgentLookupTable>
+</AgentLookupTable>
+
+<CDMA2000PacketServiceTable>
+    <CDMA2000PacketService operation="add">
+        <Name>test name cdma2000</Name>
+        <IwfName>Test2000</IwfName>
+        <ServiceOption>HIGHSPEEDCDMA2000DATA</ServiceOption>
+        <PdpType>IPV4</PdpType>
+        <ReqFwdPriority>PRIORITY04</ReqFwdPriority>
+        <ReqRevPriority>PRIORITY04</ReqRevPriority>
+        <ReqFwdBitrate>32KBPS</ReqFwdBitrate>
+        <ReqRevBitrate>32KBPS</ReqRevBitrate>
+        <ReqFwdLoss>LOSS1</ReqFwdLoss>
+        <ReqRevLoss>LOSS1</ReqRevLoss>
+        <ReqFwdMaxdelay>40MS</ReqFwdMaxdelay>
+        <ReqRevMaxdelay>40MS</ReqRevMaxdelay>
+        <MinFwdBitrate>32KBPS</MinFwdBitrate>
+        <MinRevBitrate>32KBPS</MinRevBitrate>
+        <AccptFwdLoss>LOSS2</AccptFwdLoss>
+        <AccptRevLoss>LOSS2</AccptRevLoss>
+        <AccptFwdMaxdelay>120MS</AccptFwdMaxdelay>
+        <AccptRevMaxdelay>120MS</AccptRevMaxdelay>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfAuthName>RasUser</IfAuthName>
+        <IfAuthPass>pass</IfAuthPass>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <AuthRetries>1</AuthRetries>
+        <IpNetMask>0.255.255.255</IpNetMask>
+        <IpGateway>10.0.0.1</IpGateway>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <EnableLCPExtension>TRUE</EnableLCPExtension>
+        <DisablePlainTextAuth>TRUE</DisablePlainTextAuth>
+        <ApType>2</ApType>
+        <QosWarningTimeout>1000000</QosWarningTimeout>
+        <RlpMode>TRANSPARENT</RlpMode>
+        <CDMAMobileIP>FALSE</CDMAMobileIP>
+        <CDMAMobileIPTimeout>10000000</CDMAMobileIPTimeout>
+    </CDMA2000PacketService>
+</CDMA2000PacketServiceTable>
+
+<DefaultCDMA2000Table>
+</DefaultCDMA2000Table>
+
+<ChargecardTable>
+    <Chargecard operation="add">
+        <Name>Dummy BT Chargecard</Name>
+        <AccountNumber>144,12345678</AccountNumber>
+        <Pin>0000</Pin>
+        <LocalRule>HG</LocalRule>
+        <NatRule>HFG</NatRule>
+        <IntlRule>HEFG</IntlRule>
+    </Chargecard>
+    <Chargecard operation="add">
+        <Name>Dummy Mercury Chargecard</Name>
+        <AccountNumber>0500800800,,12345678</AccountNumber>
+        <Pin>****</Pin>
+        <LocalRule>HG</LocalRule>
+        <NatRule>J,K,0FG</NatRule>
+        <IntlRule>HEFG</IntlRule>
+    </Chargecard>
+</ChargecardTable>
+
+<ConnectionPreferencesTable>
+    <ConnectionPreferences operation="add">
+        <Name>ConnectionPreferencesTable1</Name>
+        <Ranking>1</Ranking>
+        <Direction>OUTGOING</Direction>
+        <DialogPref>DONOTPROMPT</DialogPref>
+        <BearerSet>CSD</BearerSet>
+        <IAPRef>IAP.Pipex CSD IR</IAPRef>
+    </ConnectionPreferences>
+    <ConnectionPreferences operation="add">
+        <Name>ConnectionPreferencesTable2</Name>
+        <Ranking>2</Ranking>
+        <Direction>OUTGOING</Direction>
+        <DialogPref>DONOTPROMPT</DialogPref>
+        <BearerSet>CSD</BearerSet>
+        <IAPRef>IAP.Pipex CSD IR</IAPRef>
+    </ConnectionPreferences>
+</ConnectionPreferencesTable>
+
+<GlobalSettingsTable>
+    <GlobalSettings operation="add">
+        <Name>GlobalSettingsTable1</Name>
+        <WAPAccess>WAPAccessPoint.Default Dial In ISP</WAPAccess>
+        <RedialAttempts>3</RedialAttempts>
+        <SmsBearer>WAPSMSBearer.WAPSMSBearerTable1</SmsBearer>
+        <SmsReceiveMode>2</SmsReceiveMode>
+        <GPRSAttachMode>1</GPRSAttachMode>
+        <AcceptIncomingGprs>1</AcceptIncomingGprs>
+        <ConnectionAttempts>2</ConnectionAttempts>
+        <ModemForDataAndFax>2</ModemForDataAndFax>
+        <ModemForPhoneServicesAndSMS>2</ModemForPhoneServicesAndSMS>
+        <LocationForDataAndFax>Location.Office</LocationForDataAndFax>
+        <LocationForPhoneServicesAndSMS>Location.Office</LocationForPhoneServicesAndSMS>
+        <GPRSClassCBearer>GSM</GPRSClassCBearer>
+        <DefaultNetwork>Network.Intranet</DefaultNetwork>
+        <BearerAvailabilityCheckTSY>mm</BearerAvailabilityCheckTSY>
+    </GlobalSettings>
+</GlobalSettingsTable>
+
+<IncomingGPRSTable>
+    <IncomingGPRS operation="add">
+        <Name>Incoming GPRS Settings PlaceHolder</Name>
+        <APN>Test</APN>
+        <PDPType>IPV4</PDPType>
+        <PDPAddress>0.0.0.0</PDPAddress>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>TRUE</IpDNSAddrFromServer>
+        <ReqPrecedence>1</ReqPrecedence>
+        <ReqDelay>1</ReqDelay>
+        <ReqReliability>1</ReqReliability>
+        <ReqPeakThroughput>1</ReqPeakThroughput>
+        <ReqMeanThroughput>1</ReqMeanThroughput>
+        <MinPrecedence>1</MinPrecedence>
+        <MinDelay>1</MinDelay>
+        <MinReliability>1</MinReliability>
+        <MinPeakThroughput>1</MinPeakThroughput>
+        <MinMeanThroughput>1</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <IfAuthName>RasUser</IfAuthName>
+        <IfAuthPass>pass</IfAuthPass>
+        <AuthRetries>1</AuthRetries>
+        <IpNameServer1>0.0.0.0</IpNameServer1>
+        <IpNameServer2>0.0.0.0</IpNameServer2>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+    </IncomingGPRS>
+</IncomingGPRSTable>
+
+<OutgoingGPRSTable>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS01</Name>
+        <APN>gprs01APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <AuthRetries>1</AuthRetries>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS02</Name>
+        <APN>gprs02APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <AuthRetries>1</AuthRetries>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+    <OutgoingGPRS operation="add">
+        <Name>GPRS03</Name>
+        <APN>gprs03APNPlaceHolder</APN>
+        <PDPType>IPV4</PDPType>
+        <IfPromptForAuth>FALSE</IfPromptForAuth>
+        <IpAddrFromServer>TRUE</IpAddrFromServer>
+        <IpDNSAddrFromServer>FALSE</IpDNSAddrFromServer>
+        <ReqPrecedence>0</ReqPrecedence>
+        <ReqDelay>0</ReqDelay>
+        <ReqReliability>0</ReqReliability>
+        <ReqPeakThroughput>0</ReqPeakThroughput>
+        <ReqMeanThroughput>0</ReqMeanThroughput>
+        <MinPrecedence>0</MinPrecedence>
+        <MinDelay>0</MinDelay>
+        <MinReliability>0</MinReliability>
+        <MinPeakThroughput>0</MinPeakThroughput>
+        <MinMeanThroughput>0</MinMeanThroughput>
+        <DataCompression>FALSE</DataCompression>
+        <HeaderCompression>FALSE</HeaderCompression>
+        <AnonymousAccess>FALSE</AnonymousAccess>
+        <IfNetworks>ip</IfNetworks>
+        <AuthRetries>1</AuthRetries>
+        <EnableLCPExtension>FALSE</EnableLCPExtension>
+        <DisablePlainTextAuth>FALSE</DisablePlainTextAuth>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <GprsAccessPointType>0</GprsAccessPointType>
+        <QosWarningTimeout>0</QosWarningTimeout>
+    </OutgoingGPRS>
+</OutgoingGPRSTable>
+
+<DefaultGPRSTable>
+    <DefaultGPRS operation="add">
+        <Name>Dummy Default GPRS Settings</Name>
+        <APN>Access point name</APN>
+        <PDPType>IPV6</PDPType>
+        <PDPAddress>www.wid.com</PDPAddress>
+        <Usage>1</Usage>
+        <Precedence>1</Precedence>
+        <Delay>1</Delay>
+        <Reliability>1</Reliability>
+        <PeakThroughput>1</PeakThroughput>
+        <MeanThroughput>1</MeanThroughput>
+        <MinPrecedence>1</MinPrecedence>
+        <MinDelay>1</MinDelay>
+        <MinReliability>1</MinReliability>
+        <MinPeakThroughput>1</MinPeakThroughput>
+        <MinMeanThroughput>1</MinMeanThroughput>
+        <DataCompression>TRUE</DataCompression>
+        <HeaderCompression>TRUE</HeaderCompression>
+        <GprsUseEdge>FALSE</GprsUseEdge>
+        <AnonymousAccess>TRUE</AnonymousAccess>
+    </DefaultGPRS>
+</DefaultGPRSTable>
+
+<ProxyTable>
+    <Proxy operation="add">
+        <Name>ProxyTable1</Name>
+        <ISPRef>DialOutISP.TEST Network </ISPRef>
+        <UseProxyServer>TRUE</UseProxyServer>
+        <ProtocolName>http</ProtocolName>
+        <ProxyServerName>www.dummyproxy.com</ProxyServerName>
+        <PortNumber>80</PortNumber>
+        <Exceptions>www.dummyproxy.com/exception</Exceptions>
+    </Proxy>
+</ProxyTable>
+
+<LocationTable>
+    <Location operation="template">
+        <Name>Default Location</Name>
+        <Mobile>TRUE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+        <IntlPrefixCode>+</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+    </Location>
+    <Location operation="add">
+        <Name>Office</Name>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>171</AreaCode>
+        <DialOutCode>9,</DialOutCode>
+    </Location>
+        <Location operation="add">
+        <Name>Office temp</Name>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>171</AreaCode>
+    </Location>
+    <Location operation="add">
+        <Name>Office Direct Dial</Name>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>171</AreaCode>
+    </Location>
+    <Location operation="add">
+        <Name>Mobile</Name>
+        <Mobile>TRUE</Mobile>
+        <UsePulseDial>FALSE</UsePulseDial>
+        <WaitForDialTone>FALSE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+        <IntlPrefixCode>+</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+    </Location>
+    <Location operation="add">
+        <Name>Home</Name>
+        <Mobile>FALSE</Mobile>
+        <UsePulseDial>TRUE</UsePulseDial>
+        <WaitForDialTone>TRUE</WaitForDialTone>
+        <PauseAfterDialout>0</PauseAfterDialout>
+        <IntlPrefixCode>00</IntlPrefixCode>
+        <NatPrefixCode>0</NatPrefixCode>
+        <NatCode>44</NatCode>
+        <AreaCode>181</AreaCode>
+    </Location>
+</LocationTable>
+
+<SecureSocketTable>
+    <SecureSocket operation="add">
+        <Name>SecureSocketTable1</Name>
+        <ProtocolName>ssl3.0</ProtocolName>
+        <ProtoLibrary>ssladaptor.dll</ProtoLibrary>
+    </SecureSocket>
+    <SecureSocket operation="add">
+        <Name>SecureSocketTable2</Name>
+        <ProtocolName>tls1.0</ProtocolName>
+        <ProtoLibrary>ssladaptor.dll</ProtoLibrary>
+    </SecureSocket>
+</SecureSocketTable>
+
+<BTDeviceTable>
+</BTDeviceTable>
+
+<BTPersistTable>
+</BTPersistTable>
+
+<BTSecurityTable>
+</BTSecurityTable>
+
+<BTDefaultTable>
+</BTDefaultTable>
+
+<WAPAccessPointTable>
+    <WAPAccessPoint operation="template">
+        <Name>Default Dial In ISP</Name>
+        <CurrentBearer>WAPIPBearer</CurrentBearer>
+    </WAPAccessPoint>
+    <WAPAccessPoint operation="add">
+        <Name>Dummy1 WAP Settings</Name>
+        <CurrentBearer>WAPIPBearer</CurrentBearer>
+        <StartPage>www.wapstart.com</StartPage>
+    </WAPAccessPoint>    
+    <WAPAccessPoint operation="add">
+        <Name>Dummy WAP Settings</Name>
+        <CurrentBearer>WAPIPBearer</CurrentBearer>
+        <StartPage>www.wapstart.com</StartPage>
+    </WAPAccessPoint>
+</WAPAccessPointTable>
+
+<WAPIPBearerTable>
+    <WAPIPBearer operation="template">
+        <Name>WAPIPBearerTable1</Name>
+        <AccessPoint>WAPAccessPoint.-1</AccessPoint>
+        <WSPOption>CONNECTIONLESS</WSPOption>
+        <Security>FALSE</Security>
+        <IAPRef>IAP.-1</IAPRef>
+        <ProxyPortNumber>0</ProxyPortNumber>
+    </WAPIPBearer>
+    <WAPIPBearer operation="add">
+        <Name>WAPIPBearerTable2</Name>
+        <AccessPoint>WAPAccessPoint.Dummy WAP Settings</AccessPoint>
+        <GatewayAddress>www.wapgateway.com</GatewayAddress>
+        <WSPOption>CONNECTIONORIENTED</WSPOption>
+        <Security>FALSE</Security>
+        <IAPRef>IAP.Pipex CSD IR</IAPRef>
+        <ProxyPortNumber>1</ProxyPortNumber>
+    </WAPIPBearer>
+</WAPIPBearerTable>
+
+<WAPSMSBearerTable>
+    <WAPSMSBearer operation="template">
+        <Name>WAPSMSBearerTable1</Name>
+        <AccessPoint>WAPAccessPoint.-1</AccessPoint>
+        <WSPOption>CONNECTIONLESS</WSPOption>
+        <Security>FALSE</Security>
+    </WAPSMSBearer>
+    <WAPSMSBearer operation="add">
+        <Name>WAPSMSBearerTable2</Name>
+        <AccessPoint>WAPAccessPoint.Dummy WAP Settings</AccessPoint>
+        <GatewayAddress>+447785016005</GatewayAddress>
+        <WSPOption>CONNECTIONORIENTED</WSPOption>
+        <Security>FALSE</Security>
+        <ServiceCentreAddress>+442071234567</ServiceCentreAddress>
+    </WAPSMSBearer>
+</WAPSMSBearerTable>
+
+<VirtualBearerTable>
+</VirtualBearerTable>
+
+<VpnServiceTable>
+</VpnServiceTable>
+
+
+</CommDB:Config>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wapstack/wapmessageapi/te_wapstack/testdata/WapStackSuite_Config.ini	Tue May 18 17:12:08 2010 +0100
@@ -0,0 +1,1 @@
+RadioBearer= CDMA
\ No newline at end of file
Binary file wapstack/wapmessageapi/te_wapstack/testdata/pushpdu.bin has changed