📄 soapreader.cpp
字号:
#endif
return getFaultXXX (ppElement, g_pwstrFaultcode);
#ifndef CE_NO_EXCEPTIONS
}
catch (...)
{
ASSERTTEXT (FALSE, "CSoapReader::get_FaultCode - Unhandled Exception");
return E_FAIL;
}
#endif
}
////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapReader::get_FaultActor(IXMLDOMElement **ppElement)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////
HRESULT CSoapReader::get_FaultActor( IXMLDOMElement **ppElement )
{
#ifndef CE_NO_EXCEPTIONS
try
{
#endif
return getFaultXXX (ppElement, g_pwstrFaultactor);
#ifndef CE_NO_EXCEPTIONS
}
catch (...)
{
ASSERTTEXT (FALSE, "CSoapReader::get_FaultActor - Unhandled Exception");
return E_FAIL;
}
#endif
}
////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapReader::get_FaultDetail(IXMLDOMElement **ppElement)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////
HRESULT CSoapReader::get_FaultDetail( IXMLDOMElement **ppElement )
{
#ifndef CE_NO_EXCEPTIONS
try
{
#endif
return getFaultXXX (ppElement, g_pwstrDetail);
#ifndef CE_NO_EXCEPTIONS
}
catch(...)
{
ASSERTTEXT (FALSE, "CSoapReader::get_FaultDetail - Unhandled Exception");
return E_FAIL;
}
#endif
}
////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapReader::get_HeaderEntry(BSTR LocalName, BSTR NamespaceURI,
// IXMLDOMElement **ppElement)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////
HRESULT CSoapReader::get_HeaderEntry( BSTR LocalName, BSTR NamespaceURI,
IXMLDOMElement **ppElement)
{
#ifndef CE_NO_EXCEPTIONS
try
#else
__try
#endif
{
#ifdef UNDER_CE
HRESULT hr = ERROR_SUCCESS;
#endif
WCHAR * pSelectionNS;
WCHAR * pXPath;
if (ppElement == NULL)
return E_INVALIDARG;
if (!LocalName)
return E_INVALIDARG;
*ppElement = NULL;
if (NamespaceURI ==NULL)
NamespaceURI = (BSTR)g_pwstrEmpty;
// build the selcection namespace of the form:
// xmlns:CRS=<envelopens>[ xmlns:CRS2=<NamespaceURI>]
if (wcslen(NamespaceURI))
{
#ifdef UNDER_CE
size_t cbSelectionNS = sizeof(WCHAR) * (8 + wcslen(pget_HeaderEntryNS) +wcslen(NamespaceURI));
pSelectionNS = (WCHAR *) _alloca(cbSelectionNS);
hr = StringCbCopy(pSelectionNS, cbSelectionNS, pget_HeaderEntryNS);
if(FAILED(hr))
{
return E_FAIL;
}
hr = StringCbCat(pSelectionNS, cbSelectionNS, NamespaceURI);
if(FAILED(hr))
{
return E_FAIL;
}
hr = StringCbCat(pSelectionNS, cbSelectionNS, L"\"");
if(FAILED(hr))
{
return E_FAIL;
}
#else
pSelectionNS = (WCHAR *) _alloca(sizeof(WCHAR) * (8 + wcslen(pget_HeaderEntryNS) +
wcslen(NamespaceURI) ) );
wcscpy(pSelectionNS, pget_HeaderEntryNS);
wcscat(pSelectionNS, NamespaceURI);
wcscat(pSelectionNS, L"\"");
#endif
}
else
{
#ifdef UNDER_CE
size_t cbSelectionNS = sizeof(WCHAR) * (1 + wcslen(pMySelectionNS));
pSelectionNS = (WCHAR *) _alloca(cbSelectionNS);
hr = StringCbCopy(pSelectionNS, cbSelectionNS, pMySelectionNS);
if(FAILED(hr))
{
return E_FAIL;
}
#else
pSelectionNS = (WCHAR *) _alloca(sizeof(WCHAR) * (1 + wcslen(pMySelectionNS)));
wcscpy(pSelectionNS, pMySelectionNS);
#endif
}
// build the xpath expression of the form
// CSR:Header/[CSR2:]<LocalName>
#ifdef UNDER_CE
size_t cbXPath = sizeof(WCHAR) * (8 + wcslen(pget_HeaderEntry) + wcslen(LocalName));
pXPath = (WCHAR *) _alloca(cbXPath);
if (wcslen(NamespaceURI))
{
hr = StringCbCopy(pXPath, cbXPath, pget_HeaderEntry);
if(FAILED(hr))
{
return E_FAIL;
}
}
else
{
hr = StringCbCopy(pXPath, cbXPath, pget_Header2);
if(FAILED(hr))
{
return E_FAIL;
}
}
hr = StringCbCat(pXPath, cbXPath, LocalName);
if(FAILED(hr))
{
return E_FAIL;
}
#else
pXPath = (WCHAR *) _alloca(sizeof(WCHAR) * (8 + wcslen(pget_HeaderEntry) +
wcslen(LocalName) ) );
if (wcslen(NamespaceURI))
wcscpy(pXPath, pget_HeaderEntry);
else
wcscpy(pXPath, pget_Header2);
wcscat(pXPath, LocalName);
#endif
return ( DOMElementLookup( pSelectionNS,
pXPath,
ppElement ) );
#ifndef CE_NO_EXCEPTIONS
}
catch (...)
{
ASSERTTEXT (FALSE, "CSoapReader::get_HeaderEntry - Unhandled Exception");
return E_FAIL;
}
#else
}
__except(1)
{
ASSERTTEXT (FALSE, "CSoapReader::get_HeaderEntry - Unhandled Exception");
return E_FAIL;
}
#endif
}
////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapReader::get_MustUnderstandHeaderEntries(IXMLDOMNodeList **ppNodeList)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////
HRESULT CSoapReader::get_MustUnderstandHeaderEntries( IXMLDOMNodeList **ppNodeList)
{
#ifndef CE_NO_EXCEPTIONS
try
{
#endif
return ( DOMNodeListLookup( pMySelectionNS,
pget_MustUnderstand,
ppNodeList ) );
#ifndef CE_NO_EXCEPTIONS
}
catch (...)
{
ASSERTTEXT (FALSE, "CSoapReader::get_MustUnderstandHeaderEntries - Unhandled Exception");
return E_FAIL;
}
#endif
}
////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapReader::get_HeaderEntries(IXMLDOMNodeList **ppNodeList)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////
HRESULT CSoapReader::get_HeaderEntries( IXMLDOMNodeList **ppNodeList)
{
#ifndef CE_NO_EXCEPTIONS
try
{
#endif
return ( DOMNodeListLookup( pMySelectionNS,
pget_HeaderEntries,
ppNodeList ) );
#ifndef CE_NO_EXCEPTIONS
}
catch (...)
{
ASSERTTEXT (FALSE, "CSoapReader::get_HeaderEntries - Unhandled Exception");
return E_FAIL;
}
#endif
}
////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapReader::get_BodyEntries(IXMLDOMNodeList **ppNodeList)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////
HRESULT CSoapReader::get_BodyEntries( IXMLDOMNodeList **ppNodeList)
{
#ifndef CE_NO_EXCEPTIONS
try
{
#endif
return ( DOMNodeListLookup( pMySelectionNS,
pget_BodyEntries,
ppNodeList ) );
#ifndef CE_NO_EXCEPTIONS
}
catch (...)
{
ASSERTTEXT (FALSE, "CSoapReader::get_BodyEntries - Unhandled Exception");
return E_FAIL;
}
#endif
}
////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapReader::get_BodyEntry(BSTR LocalName, BSTR NamespaceURI,
// IXMLDOMElement **ppElement)
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////
HRESULT CSoapReader::get_BodyEntry( BSTR LocalName, BSTR NamespaceURI,
IXMLDOMElement **ppElement)
{
#ifndef CE_NO_EXCEPTIONS
try
{
#else
__try
{
#endif
HRESULT hr(S_OK);
WCHAR * pSelectionNS;
WCHAR * pXPath;
if (ppElement == NULL)
return E_INVALIDARG;
if (!LocalName)
return E_INVALIDARG;
if (NamespaceURI ==NULL)
NamespaceURI = (BSTR)g_pwstrEmpty;
// build the selcection namespace of the form:
// xmlns:CRS=<envelopens>[ xmlns:CRS2=<NamespaceURI>]
if (wcslen(NamespaceURI))
{
#ifdef UNDER_CE
size_t cbSelectionNS = sizeof(WCHAR) * (8 + wcslen(pget_HeaderEntryNS) +wcslen(NamespaceURI));
pSelectionNS = (WCHAR *) _alloca(cbSelectionNS);
hr = StringCbCopy(pSelectionNS, cbSelectionNS, pget_HeaderEntryNS);
if(FAILED(hr))
{
goto Cleanup;
}
hr = StringCbCat(pSelectionNS, cbSelectionNS, NamespaceURI);
if(FAILED(hr))
{
goto Cleanup;
}
hr = StringCbCat(pSelectionNS, cbSelectionNS, L"\"");
if(FAILED(hr))
{
goto Cleanup;
}
#else
pSelectionNS = (WCHAR *) _alloca(sizeof(WCHAR) * (8 + wcslen(pget_HeaderEntryNS) +
wcslen(NamespaceURI) ) );
wcscpy(pSelectionNS, pget_HeaderEntryNS);
wcscat(pSelectionNS, NamespaceURI);
wcscat(pSelectionNS, L"\"");
#endif
}
else
{
#ifdef UNDER_CE
size_t cbSelectionNS = sizeof(WCHAR) * (1 + wcslen(pMySelectionNS));
pSelectionNS = (WCHAR *) _alloca(cbSelectionNS);
hr = StringCbCopy(pSelectionNS, cbSelectionNS, pMySelectionNS);
if (FAILED(hr))
{
goto Cleanup;
}
#else
pSelectionNS = (WCHAR *) _alloca(sizeof(WCHAR) * (1 + wcslen(pMySelectionNS)));
wcscpy(pSelectionNS, pMySelectionNS);
#endif
}
// build the xpath expression of the form
// CSR:Body/CSR2:<LocalName>
#ifdef UNDER_CE
size_t cbXPath = sizeof(WCHAR) * (8 + wcslen(pget_BodyEntry) + wcslen(LocalName));
pXPath = (WCHAR *) _alloca(cbXPath);
if (wcslen(NamespaceURI))
{
hr = StringCbCopy(pXPath, cbXPath, pget_BodyEntry);
if(FAILED(hr))
{
goto Cleanup;
}
}
else
{
hr = StringCbCopy(pXPath, cbXPath, pget_BodyEntry2);
if(FAILED(hr))
{
goto Cleanup;
}
}
hr = StringCbCat(pXPath, cbXPath, LocalName);
if(FAILED(hr))
{
goto Cleanup;
}
#else
pXPath = (WCHAR *) _alloca(2 * (8 + wcslen(pget_BodyEntry) +
wcslen(LocalName) ) );
if (wcslen(NamespaceURI))
{
wcscpy(pXPath, pget_BodyEntry);
}
else
{
wcscpy(pXPath, pget_BodyEntry2);
}
wcscat(pXPath, LocalName);
#endif
CHK ( DOMElementLookup( pSelectionNS,
pXPath,
ppElement ) );
Cleanup:
ASSERT (hr == S_OK);
return hr;
#ifndef CE_NO_EXCEPTIONS
}
catch (...)
{
ASSERTTEXT (FALSE, "CSoapReader::get_BodyEntry - Unhandled Exception");
return E_FAIL;
}
#else
}
__except(1)
{
ASSERTTEXT (FALSE, "CSoapReader::get_BodyEntry - Unhandled Exception");
return E_FAIL;
}
#endif
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// function: HRESULT CSoapReader::get_soapAction(BSTR *pbstrSoapAction)
//
//
// parameters:
//
// description:
//
// returns:
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////
HRESULT CSoapReader::get_soapAction(BSTR *pbstrSoapAction)
{
if (!pbstrSoapAction)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -