|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // $Header$ |
|
15 // CHTTPFamilys.h |
|
16 // The header file introducing the collection of HTTP command classes |
|
17 // of the Integration Harness framework. |
|
18 // by: mjdavey, mjd systems solutions ltd. www.mjdss.com |
|
19 // on: aug 2002, |
|
20 // |
|
21 // |
|
22 |
|
23 #ifndef __CHTTPFAMILY_H__ |
|
24 #define __CHTTPFAMILY_H__ |
|
25 |
|
26 //----------------------------------------------------------------------------- |
|
27 |
|
28 #include "MWspEventCallback.h" |
|
29 |
|
30 #include "TEngine.h" |
|
31 |
|
32 //---------------------------------------------------------------------------- |
|
33 // specifics to this module |
|
34 |
|
35 #include <http.h> |
|
36 #include <etel.h> |
|
37 #include <es_sock.h> |
|
38 #include <http/mhttpauthenticationcallback.h> |
|
39 #include <http/mhttpsessioneventcallback.h> |
|
40 |
|
41 // add initial event type values (must not==THTTPEventType) |
|
42 const TInt KEventAny = 10000; |
|
43 |
|
44 // general timeout value |
|
45 const TInt KEventTimeoutValue = 1000; |
|
46 |
|
47 // content type buffer size |
|
48 const TInt KMaxContentTypeSize = 64; |
|
49 const TInt KMaxContentLengthSize = 8; |
|
50 const TInt KMaxAcceptLengthSize = KMaxContentTypeSize; |
|
51 const TInt KMaxAcceptCharSetSize = 32; |
|
52 const TInt KMaxAcceptEncodingSize = 24; |
|
53 const TInt KMaxUserAgentSize = 24; |
|
54 |
|
55 //---------------------------------------------------------------------------- |
|
56 // HTTP Integration Command identifiers. |
|
57 |
|
58 enum THA_HTTP_INTEGRATION |
|
59 { |
|
60 THA_KHTTP_Connect = 100, |
|
61 THA_KHTTP_Disconnect, |
|
62 THA_KHTTP_Transaction, |
|
63 THA_KHTTP_EndTransaction, |
|
64 THA_KHTTP_ShowTransaction, |
|
65 |
|
66 // add new identifers above this line |
|
67 THA_KHTTPMax |
|
68 }; |
|
69 |
|
70 //----------------------------------------------------------------------------- |
|
71 // Framework command phrases |
|
72 |
|
73 _LIT(THA_KErrInvalidConnect, "Error: command format is CONNECT <framework> <name> [%S]\r\n"); |
|
74 |
|
75 _LIT(THA_TxtCmdConnect, "CONNECT"); |
|
76 _LIT(THA_TxtCmdConnectHelp, "CONNECT <Framework> <Name>. Framework=HTTP/WSP"); |
|
77 _LIT(THA_KErrCnxionExists, "Error: Name [%S] is already defined for Connection or Transaction\r\n"); |
|
78 _LIT(THA_KErrConnectionNotExists, "Error: connection [%S] is not defined or active\r\n"); |
|
79 _LIT(THA_KErrMethodNotExists, "Error: transaction method [%S] is not defined or recognized\r\n"); |
|
80 _LIT(THA_KErrNoContentTypeDefined, "Error: No Content Type specified in ContentType define\r\n"); |
|
81 |
|
82 _LIT(THA_KTxtFrameworkHTTP, "HTTP" ); |
|
83 _LIT(THA_KTxtFrameworkWSP, "WSP" ); |
|
84 _LIT(THA_KErrFrameworkErr, "Error: framework [%S] is not recognized or supported. Use HTTP or WSP.\r\n"); |
|
85 _LIT(THA_KErrConnectionErr, "Error: connection [%S] is not defined or found\r\n"); |
|
86 |
|
87 _LIT(THA_KErrInvalidTransaction, "Error: transaction [%S] is not defined\r\n"); |
|
88 _LIT(THA_TxtCmdDisconnect, "DISCONNECT"); |
|
89 _LIT(THA_TxtCmdDisconnectHelp, "DISCONNECT <Name>. Close session named <Name>"); |
|
90 |
|
91 _LIT(THA_TxtCmdTransaction, "TRANSACTION"); |
|
92 _LIT(THA_TxtCmdTransactionHelp, "TRANSACTION <trans name> <sess name> <method> <uri>"); |
|
93 |
|
94 _LIT(THA_TxtCmdEndTrans, "ENDTRANS"); |
|
95 _LIT(THA_TxtCmdEndTransHelp, "ENDTRANS <trans name>. Closes transaction named <trans name>"); |
|
96 |
|
97 _LIT(THA_TxtCmdShowTrans, "SHOWTRANS"); |
|
98 _LIT(THA_TxtCmdShowTransHelp, "SHOWTRANS. Displays all open transactions."); |
|
99 |
|
100 _LIT(THA_TxtCmdTransactionGET, "GET"); |
|
101 _LIT(THA_TxtCmdTransactionPOST, "POST"); |
|
102 _LIT(THA_TxtCmdTransactionPUT, "PUT"); |
|
103 _LIT(THA_TxtCmdTransactionHEAD, "HEAD"); |
|
104 _LIT(THA_TxtCmdTransactionTRACE, "TRACE"); |
|
105 _LIT(THA_TxtCmdTransactionOPTIONS, "OPTIONS"); |
|
106 _LIT(THA_TxtCmdTransactionDELETE, "DELETE"); |
|
107 |
|
108 // default standard headers... |
|
109 |
|
110 _LIT8(KUserAgent, "HTTPIntegrationTest (1.0)"); |
|
111 _LIT8(KAccept, "*/*"); |
|
112 |
|
113 |
|
114 //----------------------------------------------------------------------------- |
|
115 |
|
116 #endif // __CHTTPFAMILY_H__ |
|
117 |
|
118 //----------------------------------------------------------------------------- |
|
119 // End of File |
|
120 //----------------------------------------------------------------------------- |
|
121 |