locked
Error: The size necessary to buffer the XML content exceeded the buffer quota. RRS feed

  • Question

  • I'm updating from v4 to v5.  I have added all the web services, run the svcutil.exe, imported the necessary files and I keep getting the exception "The size necessary to buffer the XML content exceeded the buffer quota" when I'm running this script.  Below is the code and app.config.  Any ideas why I would be getting this error? and possibel solutions.

     

    Keyword[] kw = a.GetKeywordsByAdGrps(Convert.ToInt32(msnOrder.Id));

    foreach (Keyword k in kw)

    {

    k.Id = k.Id;

    if (regContent.IsMatch(msnCamp.Name))

    {

    k.ContentMatchBid = (Convert.ToDouble(r_msn_orders[0]["Bid"]) * 1.0);

    }

    else if (regBroad.IsMatch(msnCamp.Name))

    {

    k.BroadMatchBid = (Convert.ToDouble(r_msn_orders[0]["Bid"]) * 1.0);

    }

    else if (regExact.IsMatch(msnCamp.Name))

    {

    k.ExactMatchBid = (Convert.ToDouble(r_msn_orders[0]["Bid"]) * 1.0);

    }

    else

    {

    k.PhraseMatchBid = (Convert.ToDouble(r_msn_orders[0]["Bid"]) * 1.0);

    }

    logErr("<span style='padding-left: 60px; font-size: 8pt'>Updated Keyword: " + k.Text + " - - - Content: " + k.ContentMatchBid + " Broad: " + k.BroadMatchBid + " Exact: " + k.ExactMatchBid + " Phrase: " + k.PhraseMatchBid + "</span>");

    }

    a.UpdateKeywords(Convert.ToInt32(msnOrder.Id), kw);

    }

     

     

    I pass the adgroup id and keyword[] to this method:

     

    try

    {

    CampaignManagementServiceClient svcCampMgt;

    svcCampMgt = new CampaignManagementServiceClient("BasicHttpBinding_ICampaignManagementService");

    //svcCampMgt = new CampaignManagementServiceClient();

    adCenter.CampaignManagementService.ApplicationToken appToken;

    adCenter.CampaignManagementService.UserCredentials userCreds;

    adCenter.CampaignManagementService.DeveloperToken devToken;

    appToken = new adCenter.CampaignManagementService.ApplicationToken();

    devToken = new adCenter.CampaignManagementService.DeveloperToken();

    userCreds = new adCenter.CampaignManagementService.UserCredentials();

    appToken.Value = appTokenValue;

    devToken.Value = "XXXXXXXX";

    userCreds.Username = "XXXXXXX";

    userCreds.Password = "XXXXXXX";

    UpdateKeywordsRequest updateKWRequest;

    UpdateKeywordsResponse updateKWResponse;

    updateKWRequest = new UpdateKeywordsRequest(appToken, null, devToken, userCreds, AdGrpID, keywords);

    updateKWResponse = svcCampMgt.UpdateKeywords(updateKWRequest);

    logErr(updateKWResponse.ApiCallTrackingData.ToString());

    }

    catch (FaultException<adCenter.CampaignManagementService.ApiFaultDetail> fault)

    {

    adCenter.CampaignManagementService.ApiFaultDetail detail = fault.Detail;

    // Display any service operation error information.

    foreach (adCenter.CampaignManagementService.OperationError opError in detail.OperationErrors)

    {

    logErr(opError.Code.ToString());

    logErr(opError.Message.ToString());

    }

    // Add your additional exception-handling code here.

    }

    catch (Exception e)

    {

    logErr(e.Message.ToString());

    }

     

     

    Its been chopped up.

    <binding name="BasicHttpBinding_ICampaignManagementService" closeTimeout="00:01:00"

    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

    maxBufferSize="655360000" maxBufferPoolSize="524288" maxReceivedMessageSize="655360000"

    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"

    useDefaultWebProxy="true">

    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

    maxBytesPerRead="4096" maxNameTableCharCount="16384" />

    <security mode="Transport">

    <transport clientCredentialType="None" proxyCredentialType="None"

    realm="" />

    <message clientCredentialType="UserName" algorithmSuite="Default" />

    </security>

    </binding>

     

    <behaviors>

    <endpointBehaviors>

    <behavior name="LargeQuotaBehavior">

    <dataContractSerializer maxItemsInObjectGraph="2147483647"/>

    </behavior>

    </endpointBehaviors>

    </behaviors>

     

    <endpoint address="https://adcenterapi.microsoft.com/Api/Advertiser/V5.1/CampaignManagement/CampaignManagementService.svc"

    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICampaignManagementService"

    contract="adCenter.CampaignManagementService.ICampaignManagementService"

    name="BasicHttpBinding_ICampaignManagementService" behaviorConfiguration="LargeQuotaBehavior" />

    Thursday, September 4, 2008 5:44 PM

All replies

  • Thursday, September 4, 2008 6:37 PM
  • I see that you have indeed implemented a behavior. So how many keywords are you attempting? And what has been "chopped up"?

    Jeff Dillon, API Support

     

    Thursday, September 4, 2008 6:41 PM
  • Thats a snipet from my app.config... left out some of the other bindings. A total of 926 keywords on one call.

    Yeah I saw your article on handling the large arrays... thats why I included the app.conig snippet.

     

    Thursday, September 4, 2008 6:51 PM
  • Is there any way where I can just pass 1 keyword at a time for these huge lists that I have?

     

    The problem is our accounts like google adwords, we can make a bid adjustment to the adgroup and it defaults all the keywords at one time.  Here I need to go through all the keywords of the account and adjust every keyword on an individual basis.

     

    Thursday, September 4, 2008 7:28 PM
  •  

    So I have tried a smaller adgroup campaign and I am now receiving:

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

     

    I am using the same credentials as the customermanagement service...

    Thursday, September 4, 2008 7:59 PM
  •   Here is the  request... I can't still see the response...

     

    <?xml version="1.0"?>
    <UpdateKeywordsRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ApplicationToken />
      <CustomerAccountId xsi:nil="true" />
      <DeveloperToken>
        <Value>XXXXXXX</Value>
      </DeveloperToken>
      <UserCredentials>
        <Password>XXXXXX</Password>
        <Username>XXXXXXX</Username>
      </UserCredentials>
      <AdGroupId>18836</AdGroupId>
      <Keywords>
        <Keyword>
          <BroadMatchBid xsi:nil="true" />
          <ContentMatchBid xsi:nil="true" />
          <EditorialStatus xsi:nil="true" />
          <ExactMatchBid>0.38</ExactMatchBid>
          <Id>135475215</Id>
          <PhraseMatchBid xsi:nil="true" />
          <Status xsi:nil="true" />
        </Keyword>
      </Keywords>
    </UpdateKeywordsRequest>

     

     

     

    Friday, September 5, 2008 7:49 PM
  • Use a https sniffer, like Fiddler, which is freely available here

     

    Jeff

    Tuesday, September 16, 2008 6:54 PM