1

I have a request I'm making to the Bing Ads API that looks like this:

var _campaignManagementService = new ServiceClient<ICampaignManagementService>(
    _authorizationData,
    apiEnvironment
);

var getCampaignRequest = new GetCampaignsByIdsRequest
{
    AccountId = <the-accountid-is-here>,
    CampaignIds = new List<long>() { <the-campaignid-is-here> }
};

var getCampaignResponse = (await _campaignManagementService.CallAsync((s, r) => s.GetCampaignsByIdsAsync(r), getCampaignRequest));

When I run this, an exception is thrown on the last line that reports:

"Invalid client data. Check the SOAP fault details for more information."

Unfortunately, using the API, I'm not seeing the details of the actual response. Is there a way to get at this info? (Short of rewriting the whole thing without using the API?)

Beska
  • 12,445
  • 14
  • 77
  • 112
  • What's the *actual full* exception text returned by `Exception.ToString()`? In WCF/SOAP calls errors result in `FaultException<>`s that contain the fault details. – Panagiotis Kanavos Sep 15 '22 at 13:36

1 Answers1

0

Edit:

Thanks to Panagiotis Kanavos I found the solution i think. This is for a different api (reporting) but it should look the same.

The exception has an InnerException that is of type System.ServiceModel.FaultException<Microsoft.BingAds.V13.Reporting.AdApiFaultDetail> or something similar. This has the Detail property with additional information:

enter image description here

Original post:

Can't seem to be able to easily inspect the SOAP request. But you can sniff the request with Fiddler classic The classic version is free.

enter image description here

sommmen
  • 6,570
  • 2
  • 30
  • 51