How to read SOAP fault response from WSD API sendtwowayrequest in c++
Roshni
21
Reputation points
Hello community,
I am working with WIA mini driver, after sending a request with SendTwoWayRequest, MFP responses with SOAP FAULT response, which could be seen in wireshark but no data is returned in context.results also GetFaultInfo doesn't return any fault information.
Is this limitation of WSD API ? Please let me know how to retrieve SOAP fault response
hr = ep->SendTwoWayRequest
(&request
, &Operations_ScannerServiceType[0]
, &context
);
if (SUCCEEDED(hr))
{
if ( WAIT_FAILED == ::WaitForSingleObject(context.eventHandle, INFINITE) )
{
DWORD dw = ::GetLastError();
hr = HRESULT_FROM_WIN32(dw);
}
}
if (SUCCEEDED(hr))
{
if (SUCCEEDED(context.hr))
{
if( NULL != context.results )
{
RESPONSEBODY_ScannerServiceType_CreateScanJob* response = reinterpret_cast<RESPONSEBODY_ScannerServiceType_CreateScanJob*>(context.results);
WSDDetachLinkedMemory( (void*) response->body );
*bodyOut = response->body;
WSDFreeLinkedMemory( context.results );
context.results = NULL;
}
else
{
hr = E_FAIL;
}
}
else
{
hr = context.hr;
if( context.results )
{
ep->ProcessFault( (const WSD_SOAP_FAULT*)context.results );
}
else
{
// Control comes here after FAULT response
}
Windows development | Windows Driver Kit (WDK)
Sign in to answer