40 #include "NSmlResponseController.h" |
40 #include "NSmlResponseController.h" |
41 #include "nsmlerror.h" |
41 #include "nsmlerror.h" |
42 #include "NSmlURI.h" |
42 #include "NSmlURI.h" |
43 #include "nsmltransport.h" |
43 #include "nsmltransport.h" |
44 #include "nsmlagenttestdefines.h" |
44 #include "nsmlagenttestdefines.h" |
45 #ifdef __NOTRANSPORT |
45 #if defined (__NOTRANSPORT) || defined (_DEBUG) |
46 #include "wbxml2xmlconverter.h" |
46 #include "wbxml2xmlconverter.h" |
|
47 #include <bautils.h> |
47 #endif |
48 #endif |
48 //Rnd_AutoRestart |
49 //Rnd_AutoRestart |
49 #include <es_sock.h> // RConnection RSocket |
50 #include <es_sock.h> // RConnection RSocket |
50 #include <es_enum.h> // TConnectionInfo |
51 #include <es_enum.h> // TConnectionInfo |
51 #include <commdb.h> |
52 #include <commdb.h> |
1681 // --------------------------------------------------------- |
1682 // --------------------------------------------------------- |
1682 void CNSmlAgentBase::SendDataIssueL() |
1683 void CNSmlAgentBase::SendDataIssueL() |
1683 { |
1684 { |
1684 DBG_FILE(_S8("CNSmlAgentBase::SendDataIssueL begins")); |
1685 DBG_FILE(_S8("CNSmlAgentBase::SendDataIssueL begins")); |
1685 TPtrC8 document( iSyncMLCmds->GeneratedDocument() ); |
1686 TPtrC8 document( iSyncMLCmds->GeneratedDocument() ); |
|
1687 |
|
1688 #ifdef _DEBUG |
|
1689 { |
|
1690 CWbxml2XmlConverter* c = CWbxml2XmlConverter::NewLC(); |
|
1691 c->ConvertL( document.Ptr(), document.Length() ); |
|
1692 RFs fs; |
|
1693 fs.Connect(); // create connect to fileserver |
|
1694 CleanupClosePushL( fs ); |
|
1695 if( !BaflUtils::FolderExists( fs, _L("C:\\logs\\Sync\\") ) ) |
|
1696 { |
|
1697 fs.MkDirAll( _L("C:\\logs\\Sync\\") ); |
|
1698 } |
|
1699 _LIT( KLogFile, "C:\\logs\\Sync\\SendDataIssue.txt" ); |
|
1700 RFile logFile; |
|
1701 CleanupClosePushL( logFile ); |
|
1702 |
|
1703 TInt ret = logFile.Open( fs, KLogFile, EFileShareExclusive|EFileWrite ); // open file |
|
1704 if( ret == KErrNotFound ) // if file does not exist, create it |
|
1705 { |
|
1706 logFile.Create( fs, KLogFile, EFileShareExclusive|EFileWrite ); |
|
1707 } |
|
1708 |
|
1709 TInt size = 0; |
|
1710 logFile.Size( size ); |
|
1711 logFile.Write( size, c->Document() ); |
|
1712 _LIT8( KNewLine, "\n\n" ); |
|
1713 logFile.Write( KNewLine ); |
|
1714 CleanupStack::PopAndDestroy( 3, c );//privateFile, fs, c |
|
1715 } |
|
1716 #endif |
1686 #ifdef __NOTRANSPORT |
1717 #ifdef __NOTRANSPORT |
1687 CWbxml2XmlConverter* c = CWbxml2XmlConverter::NewLC(); |
1718 CWbxml2XmlConverter* c = CWbxml2XmlConverter::NewLC(); |
1688 c->ConvertL(document.Ptr(), document.Length()); |
1719 c->ConvertL(document.Ptr(), document.Length()); |
1689 DBG_DUMP((void*)iSyncMLCmds->GeneratedDocument().Ptr(), iSyncMLCmds->GeneratedDocument().Length(), _S8("SendDataL (WBXML)\n") ); |
1720 DBG_DUMP((void*)iSyncMLCmds->GeneratedDocument().Ptr(), iSyncMLCmds->GeneratedDocument().Length(), _S8("SendDataL (WBXML)\n") ); |
1690 DBG_DUMP((void*)c->Document().Ptr(), c->Document().Length(), _S8("SendDataL (XML)") ); |
1721 DBG_DUMP((void*)c->Document().Ptr(), c->Document().Length(), _S8("SendDataL (XML)") ); |
1727 { |
1758 { |
1728 DBG_FILE(_S8("CNSmlAgentBase::ReceiveDataIssueL begins")); |
1759 DBG_FILE(_S8("CNSmlAgentBase::ReceiveDataIssueL begins")); |
1729 #ifndef __NOTRANSPORT |
1760 #ifndef __NOTRANSPORT |
1730 iBufferArea.Set(iSyncMLCmds->BufferAreaForParsingL()); |
1761 iBufferArea.Set(iSyncMLCmds->BufferAreaForParsingL()); |
1731 iTransport->Receive( iBufferArea, iStatus ); |
1762 iTransport->Receive( iBufferArea, iStatus ); |
1732 |
1763 |
|
1764 #ifdef _DEBUG |
|
1765 { |
|
1766 TPtrC8 document( iSyncMLCmds->BufferAreaForDebugDumpL() ); |
|
1767 CWbxml2XmlConverter* c = CWbxml2XmlConverter::NewLC(); |
|
1768 TRAPD( err, c->ConvertL( document.Ptr(), document.Length() ) ); |
|
1769 if ( err == KErrNone ) |
|
1770 { |
|
1771 c->ConvertL( document.Ptr(), document.Length() ); |
|
1772 RFs fs; |
|
1773 fs.Connect(); // create connect to fileserver |
|
1774 CleanupClosePushL( fs ); |
|
1775 if( !BaflUtils::FolderExists( fs, _L("C:\\logs\\Sync\\") ) ) |
|
1776 { |
|
1777 fs.MkDirAll( _L("C:\\logs\\Sync\\") ); |
|
1778 } |
|
1779 _LIT( KLogFile, "C:\\logs\\Sync\\ReceiveDataIssue.txt" ); |
|
1780 RFile logFile; |
|
1781 CleanupClosePushL( logFile ); |
|
1782 |
|
1783 TInt ret = logFile.Open( fs, KLogFile, EFileShareExclusive|EFileWrite ); // open file |
|
1784 if( ret == KErrNotFound ) // if file does not exist, create it |
|
1785 { |
|
1786 logFile.Create( fs, KLogFile, EFileShareExclusive|EFileWrite ); |
|
1787 } |
|
1788 TInt size = 0; |
|
1789 logFile.Size( size ); |
|
1790 logFile.Write( size, c->Document() ); |
|
1791 _LIT8( KNewLine, "\n\n" ); |
|
1792 logFile.Write( KNewLine ); |
|
1793 CleanupStack::PopAndDestroy( 3, c );//logFile, fs, c |
|
1794 } |
|
1795 } |
|
1796 #endif |
|
1797 |
1733 #else |
1798 #else |
1734 //TESTSEQU |
1799 //TESTSEQU |
1735 _LIT(KServerInitFile,"C:\\system\\data\\servinit.wbxml"); |
1800 _LIT(KServerInitFile,"C:\\system\\data\\servinit.wbxml"); |
1736 _LIT(KServerInitFile1,"C:\\system\\data\\servinit1.wbxml"); |
1801 _LIT(KServerInitFile1,"C:\\system\\data\\servinit1.wbxml"); |
1737 _LIT(KServerInitFile2,"C:\\system\\data\\servinit2.wbxml"); |
1802 _LIT(KServerInitFile2,"C:\\system\\data\\servinit2.wbxml"); |