IProvEngine::SubmitTrustedRequest
Submits a synchronous Key Architecture Elements to a Key Architecture Elements of Microsoft Provisioning Framework (MPF) to execute one or more Key Architecture Elements using the request XML from a trusted user credential.
By default, only members of the Key Architecture Elements Administrators, MPFAdmins, and MPFTrustedUsers are allowed to call this method.
Arguments
Input argument | Description |
---|---|
bstrRequest |
XML data, procedure, and context nodes for the request. |
Output argument | Description |
---|---|
bstrResponse |
XML response node returned for the request. |
Remarks
Syntax
C++
HRESULT SubmitTrustedRequest (
BSTR bstrRequest,
BSTR * bstrResponse
);
Performance Counters
Counter Object: Microsoft Provisioning Client
Counter Instance: Trusted Requests
Average Request Latency |
Average time for this client to execute a provisioning request. Each call to IProvEngine::SubmitRequest contributes to the average latency of up to the last 100 requests. |
Request Rate |
Incoming request rate for this client. Each call to IProvEngine::SubmitRequest contributes to the average request rate of transactions per second. |
Requests Executing |
Number of concurrently executing requests at this client. This counter identifies the total number of concurrent calls to IProvEngine::SubmitRequest. |
Total Requests |
Number of requests this client has processed. Each call to IProvEngine::SubmitRequest increments this counter. |
Total Requests Failed |
Total number of failed requests that this client initiated. Each call to IProvEngine::SubmitRequest that returns a failed HRESULT increments this counter. |
Sample Code
Sample Input Code
Example
C++
LPCWSTR wszRequest = L"<request>\n" +
L" <data>\n" +
L" <organizations>\n" +
L" <organization name=\"tailspintoys.com\"/>\n" +
L" </organizations>\n" +
L" </data>\n" +
L" <context>\n" +
L" <clientContext clientTransactionId=\"53367B03-63D3-44ae-B8AD-C1E57E876E6C\"/>\n" +
L" </context>\n" +
L" <procedure>\n" +
L" <execute namespace=\"Test Namespace\" procedure=\"Write Request\">\n" +
L" <forEach name=\"organization\" root=\"data\"\n" +
L" path=\"organizations/organization\"/>\n" +
L" <before source=\"organization\" destination=\"executeData\"/>\n" +
L" </execute>" +
L" </procedure>" +
L"</request>";
IProvEngine * pProvEngine = NULL;
BSTR bstrRequest = ::SysAllocString(wszRequest);
BSTR bstrRetValue = NULL;
HRESULT hr = E_OUTOFMEMORY;
if(bstrRequest)
{
// Create engine client:
hr = CoCreateInstance(CLSID_ProvEngineClient, NULL, CLSCTX_ALL, IID_IProvEngine, (void**)(&pProvEngine));
if(hr == S_OK)
{
hr = pProvEngine->SubmitTrustedRequest(bstrRequest, &bstrRetValue);
pProvEngine->Release();
}
}
// Get the error description in the case of error
if(FAILED(hr))
{
IErrorInfo* pErrInfo = NULL;
if(::GetErrorInfo(0, &pErrInfo) == S_OK && pErrInfo)
{
pErrInfo->GetDescription(&bstrRetValue);
pErrInfo->Release();
}
}
// Show the results
MessageBoxW(NULL, bstrRetValue ? bstrRetValue : L"Unknown error occured", L"Trusted request results", MB_OK);
// Clean up
::SysFreeString(bstrRequest);
::SysFreeString(bstrRetValue);
Sample Output Code
Zero-Indicates success.
Non zero-Represents an error. For a list of error codes, see MPF Errors.
Applies To
Computer Management Provider API