📄 soapmapr.cpp
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft shared
// source or premium shared source license agreement under which you licensed
// this source code. If you did not accept the terms of the license agreement,
// you are not authorized to use this source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the SOURCE.RTF on your install media or the root of your tools installation.
// THE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
//+----------------------------------------------------------------------------
//
//
// File: soapmapr.cpp
//
// Contents:
//
// implementation file
//
// ISoapMapper Interface implemenation
//
// Created
//
//-----------------------------------------------------------------------------
#include "headers.h"
#include "wsdlserv.h"
#include "wsdloper.h"
#include "soapmapr.h"
#include "typemapr.h"
BEGIN_INTERFACE_MAP(CSoapMapper)
ADD_IUNKNOWN(CSoapMapper, ISoapMapper)
ADD_INTERFACE(CSoapMapper, ISoapMapper)
END_INTERFACE_MAP(CSoapMapper)
/////////////////////////////////////////////////////////////////////////////
// helper class to keep the state in variants inside the list
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: DWORD CKeyedVariant::GetKey(void)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
DWORD CKeyedVariant::GetKey(void)
{
return(m_dwCookie);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CKeyedVariant::SetValue(VARIANT* tValue)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CKeyedVariant::SetValue(VARIANT* tValue)
{
return m_tValue.Assign(tValue, TRUE);
return S_OK;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CKeyedVariant::SetValue(VARIANT tValue)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CKeyedVariant::SetValue(VARIANT tValue)
{
return m_tValue.Assign(&tValue, TRUE);
return S_OK;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: VARIANT* CKeyedVariant::GetValue(void)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
VARIANT* CKeyedVariant::GetValue(void)
{
return(&(m_tValue));
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: CSoapMapper::CSoapMapper()
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
CSoapMapper::CSoapMapper()
{
m_lCallIndex = DISPID_UNKNOWN;
m_vtType = 0;
m_lCallIndex = -1;
m_lparameterOrder=-1;
m_basedOnType = false;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: CSoapMapper::~CSoapMapper()
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
CSoapMapper::~CSoapMapper()
{
TRACEL((3, "Mapper %S shutdown\n",getVarName()));
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: CSoapMapper::ShutDown(void)
//
// parameters:
//
// description:
// called from the operation when it's destroyed. Forces a release on the soaptypemapper,
// to avoid circular references.
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
void CSoapMapper::Shutdown(void)
{
m_pOwner.Clear();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapMapper::get_elementName(BSTR *pbstrElementName)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CSoapMapper::get_elementName(BSTR *pbstrElementName)
{
return _WSDLUtilReturnAutomationBSTR(pbstrElementName, getVarName());
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapMapper::get_variantType(LONG *pvtType)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CSoapMapper::get_variantType(long *pvtType)
{
if (!pvtType)
{
return E_INVALIDARG;
}
*pvtType = m_vtType;
return S_OK;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapMapper::get_callIndex(LONG *plCallIndex)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CSoapMapper::get_callIndex(LONG *plCallIndex)
{
HRESULT hr = S_OK;
if (!plCallIndex)
{
hr = E_INVALIDARG;
goto Cleanup;
}
*plCallIndex = m_lCallIndex;
Cleanup:
ASSERT(hr==S_OK);
return (hr);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapMapper::get_parameterOrder(LONG *plparaOrder)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CSoapMapper::get_parameterOrder(LONG *plparaOrder)
{
HRESULT hr = S_OK;
if (!plparaOrder)
{
hr = E_INVALIDARG;
goto Cleanup;
}
*plparaOrder= m_lparameterOrder;
Cleanup:
ASSERT(hr==S_OK);
return (hr);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapMapper::get_partName(BSTR *pbstrPartName)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CSoapMapper::get_partName(BSTR *pbstrPartName)
{
return _WSDLUtilReturnAutomationBSTR(pbstrPartName, m_bstrPartName);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapMapper::get_messageName(BSTR *pbstrmessageName)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CSoapMapper::get_messageName(BSTR *pbstrmessageName)
{
ASSERT(m_pOwner!=0);
if (m_pOwner==0)
{
return(E_FAIL);
}
return m_pOwner->get_messageName(pbstrmessageName, m_enInput!=smOutput);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapMapper::get_elementType(BSTR *pbstrElementType)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CSoapMapper::get_elementType(BSTR *pbstrElementType)
{
return _WSDLUtilReturnAutomationBSTR(pbstrElementType , m_bstrSchemaElement);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapMapper::get_isInput(smIsInputEnum *psmInput)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CSoapMapper::get_isInput(smIsInputEnum *psmInput)
{
HRESULT hr = S_OK;
*psmInput = m_enInput;
return (hr);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -