00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00027 #ifndef _RTXSOAP_H_
00028 #define _RTXSOAP_H_
00029
00030 #include "rtxsrc/rtxCommon.h"
00031 #include "rtxsrc/rtxSocket.h"
00032
00033 #define HTTP_VERSION "1.1"
00034
00035 typedef enum { OSSOAPV1, OSSOAPV2 } OSSoapVersion;
00036
00037 typedef struct OSSOAPCONN {
00038 OSCTXT* pctxt;
00039 OSRTSOCKET socket;
00040 OSSoapVersion soapVersion;
00041 const char* endpoint;
00042 char* host;
00043 int port;
00044 const char* path;
00045 const char* soapAction;
00046 OSBOOL keepAlive;
00047 OSBOOL chunked;
00048 OSOCTET spare[2];
00049 size_t contentLength;
00050 int responseStatusCode;
00051 OSUINT32 recvTimeoutSecs;
00052 } OSSOAPCONN;
00053
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif
00057
00067 EXTERNRT int rtxSoapInitConn
00068 (OSSOAPCONN* pSoapConn, OSCTXT* pctxt, OSSoapVersion soapv, const char* url);
00069
00078 EXTERNRT int rtxSoapAcceptConn
00079 (OSRTSOCKET listenSocket, OSSOAPCONN* pSoapConn);
00080
00089 EXTERNRT int rtxSoapConnect (OSSOAPCONN* pSoapConn);
00090
00100 EXTERNRT int rtxSoapRecvHttp (OSSOAPCONN* pSoapConn);
00101
00115 EXTERNRT int rtxSoapRecvHttpContent
00116 (OSSOAPCONN* pSoapConn, OSOCTET** ppbuf);
00117
00118 EXTERNRT int rtxSoapRecvHttpLine
00119 (OSSOAPCONN* pSoapConn, char* lbuf, size_t lbufsiz);
00120
00129 EXTERNRT int rtxSoapSendHttpResponse
00130 (OSSOAPCONN* pSoapConn, const OSUTF8CHAR* soapMsg);
00131
00142 EXTERNRT int rtxSoapSendHttp
00143 (OSSOAPCONN* pSoapConn, const OSUTF8CHAR* soapMsg);
00144
00157 EXTERNRT int rtxSoapSetReadTimeout (OSSOAPCONN* pSoapConn, OSUINT32 nsecs);
00158
00159 EXTERNRT int rtxHttpParseHdr
00160 (OSSOAPCONN* pSoapConn, const char* key, const char* value);
00161
00162
00163 EXTERNRT int rtxHttpPost (OSSOAPCONN* pSoapConn, size_t count);
00164
00165
00166 EXTERNRT int rtxHttpPostHdr
00167 (OSSOAPCONN* pSoapConn, const char* key, const char* value);
00168
00169 EXTERNRT int rtxHttpTagCmp (const char *s, const char *t);
00170
00171 #ifdef __cplusplus
00172 }
00173 #endif
00174
00175 #endif