// WMSOAPReqDeserializer.h: interface for the WMSOAPReqDeserializer class.
//
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 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.
//
//////////////////////////////////////////////////////////////////////
//
// WMSOAPReqDeserializer class - a SOAP message deserializer.
// Populates WMSOAPMessage object with binary representation of message.
// Both "encoded" (SOAP encoding only) or "literal" usage supported.
// 
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_WMSOAPREQDESERIALIZER_H__123BD811_4294_4F1F_9B5A_4D9E446773B7__INCLUDED_)
#define AFX_WMSOAPREQDESERIALIZER_H__123BD811_4294_4F1F_9B5A_4D9E446773B7__INCLUDED_

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

#include <comdef.h>
#include "SOAPEventHandler.h"
#include "WMSOAPDeserializer.h"

class WMSOAPReqDeserializer : public WMSOAPDeserializer
{
public:
	WMSOAPReqDeserializer();
	virtual ~WMSOAPReqDeserializer();

	bool Deserialize(WMSOAPMessage& Msg, Iwmwsdlclient2 *pIWSDLClient);
	bool ProcessRPCRequestEnc(WMSOAPMessage& Msg, Iwmwsdlclient2 *pIWSDLClient);
	bool ProcessRPCRequestLit(WMSOAPMessage& Msg, Iwmwsdlclient2 *pIWSDLClient);
	bool ProcessRPCGetRequest(WMSOAPMessage& Msg, Iwmwsdlclient2 *pIWSDLClient);

    WMSOAPEnvelopeHandler<WMSOAPHeaderHandler, WMSOAPRequestBodyHandler>& GetEnvelopeHandler();
	WMSOAPHeaderHandler& GetHeaderHandler();
	WMSOAPRequestBodyHandler& GetBodyHandler();

protected:
	bool DeserializeHeader(WMSOAPMessage& Msg, Iwmwsdlclient2 *pIWSDLClient);
	bool DeserializeBody(WMSOAPMessage& Msg, Iwmwsdlclient2 *pIWSDLClient);

	const vector<WMSOAPHeaderElemHandler *>& GetHeaderEntries();

	WMSOAPRequestHandler *GetRequestHandler();
	const vector<WMSOAPParamHandler *>& GetMethodParameters();
	WMSOAPParamHandler *GetMultiRefElem(WMSOAPParamHandler *pParam);
	// the top-level SOAP event handler
	WMSOAPMessageHandler< WMSOAPEnvelopeHandler
			<WMSOAPHeaderHandler, WMSOAPRequestBodyHandler> > m_MsgHandler;
};

#endif // !defined(AFX_WMSOAPREQDESERIALIZER_H__123BD811_4294_4F1F_9B5A_4D9E446773B7__INCLUDED_)
