How to read SOAP fault response from WSD API sendtwowayrequest in c++

Roshni 21 Reputation points
2025-08-07T05:38:02.9633333+00:00

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)
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.