// soap12testhdrdocObj.h : Declaration of the Csoap12testhdrdocObj

#pragma once
#include "resource.h"       // main symbols

#include "soap12testhdrdoc.h"
#include <string>
using namespace std;

interface Iwmsoapmsg2;

// Csoap12testhdrdocObj

class ATL_NO_VTABLE Csoap12testhdrdocObj : 
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<Csoap12testhdrdocObj, &CLSID_soap12testhdrdoc>,
	public IDispatchImpl<Isoap12testhdrdoc, &IID_Isoap12testhdrdoc, &LIBID_soap12testhdrdocLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
{
public:
	Csoap12testhdrdocObj()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_SOAP12TESTHDRDOCOBJ)


BEGIN_COM_MAP(Csoap12testhdrdocObj)
	COM_INTERFACE_ENTRY(Isoap12testhdrdoc)
	COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()


	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		return S_OK;
	}
	
	void FinalRelease() 
	{
	}

public:
	STDMETHOD(OnProcessHeader)(/*[in]*/ VARIANT SOAPMsgInterface, /*[out, retval]*/ VARIANT_BOOL *pResult);
	STDMETHOD(OnTestMUHeaderBlock)(/*[in]*/ BSTR bstrNamespace, /*[in]*/ BSTR bstrLocalName, /*[out, retval]*/ VARIANT_BOOL *pResult);

private:
	bool ProcessRequest(Iwmsoapmsg2 *pIwmsoapmsg);
	bool ProcessResponse(Iwmsoapmsg2 *pIwmsoapmsg);
    bool GetConcatAndFwdArgs(Iwmsoapmsg2 *pIwmsoapmsg);
    bool ProcessBody(Iwmsoapmsg2 *pIwmsoapmsg);

    bool        m_bAbortProcessing;
    bool        m_bEchoOkFound;
    wstring     m_wstrEchoOk;

    bool        m_bConcatAndFwdFound;
    bool        m_bConcatAndFwdArg1Found;
    bool        m_bConcatAndFwdArg2Found;
    wstring     m_wstrArg1;
    wstring     m_wstrArg2;

};

OBJECT_ENTRY_AUTO(__uuidof(soap12testhdrdoc), Csoap12testhdrdocObj)
