// DIMERequestSock.h: interface for the WMDIMERequestSock class.
//
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002 Robert Cunnings. All rights reserved.
//
// You may copy, modify, distribute or publish this code free of charge.
//
// NO WARRANTY: This software is provided AS IS, without warranty of any kind.
//
//////////////////////////////////////////////////////////////////////
//
// DIMERequestSock class - a class for HTTP protocol support. 
// Uses DIME packaging, in accordance with Internet-Draft "WS-Attachments"
// (draft-nielsen-dime-soap-01 June 17, 2002).
// 
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DIMERequestSock_H__A4874457_5BEE_4417_A79E_284BFE2D2586__INCLUDED_)
#define AFX_DIMERequestSock_H__A4874457_5BEE_4417_A79E_284BFE2D2586__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "..\soap_source\httpwinsocket.h"

class DIMEParser;

class WMDIMERequestSock : public WMHTTPRequestSock  
{
public:
	WMDIMERequestSock(int nPort = 80, DWORD dwTimeOut = 300000, DIMEParser *pParser = NULL);
	virtual ~WMDIMERequestSock();

	bool SendHTTPRequest(  int nPort,
						   const string& strMethod,
						   const string& strHost,
						   const string& strRequestURI,
						   const string& strQuery,
						   const string& strHeaders,
						   DIMEParser *pParser);
	bool SendHTTPRequest(  int nPort,
						   const string& strMethod,
						   const string& strHost,
						   const string& strRequestURI,
						   const string& strQuery,
						   const string& strHeaders,
						   const string& strBody,
						   DIMEParser *pParser);
private:

	// overrides
	bool OnSockRead();
	bool OnSockWrite();
	void OnSockClose();

	DIMEParser		*m_pDIMEParser;
	bool			m_bHeaderSent;
	bool			m_bIsDIMERequest;
	bool			m_bIsDIMEResponse;
};

#endif // !defined(AFX_DIMERequestSock_H__A4874457_5BEE_4417_A79E_284BFE2D2586__INCLUDED_)
