Odd response body to XML post to Campaign Endpoint

32 views
Skip to first unread message

Jacob Peebles

unread,
Oct 22, 2019, 3:21:25 PM10/22/19
to AdWords API and Google Ads API Forum
Hello!

First, I am posting this on behalf of one of our developers who is not able to post the issue right now. So apologies in advance if it is lacking some details (we can add later when he is back online). 

The issue we are seeing is as follows:

We have the following issue when posting to this endpoint:


We are using our google credentials and used oauth2.

Request body:


<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<name>Test</name>
<status></status>
<startDate></startDate>
<budget>
<budgetId>0</budgetId>
</budget>
<adServingOptimizationStatus></adServingOptimizationStatus>
</Body>
</Body>
</Envelope>

Response body:


soap:Fault<faultcode>soap:Client</faultcode><faultstring>Message part {http://schemas.xmlsoap.org/soap/envelope/}Body was not recognized. (Does it exist in service WSDL?)</faultstring></soap:Fault>

Any pointers on why we are getting this response to our XML?

Thanks!

Jake

Google Ads API Forum Advisor Prod

unread,
Oct 22, 2019, 3:38:21 PM10/22/19
to ja...@getitllc.com, adwor...@googlegroups.com
Hello Jacob,

Could you please elaborate more on how they are making the request(using any tool or client library)? Share the screenshot of the error using reply privately to the author option. If they are using our client library a valid response will come back from the server for sure.

Regards,
Sai Teja, Google Ads API Team

ref:_00D1U1174p._5001UKO9Gn:ref

Dmitry Omelyusik

unread,
Oct 23, 2019, 10:18:00 AM10/23/19
to AdWords API and Google Ads API Forum
We use go and we don't have any client library.
We just create http client using oauth2 authentication with google credentials.
Then we make xml object described above.
Then we send it to the campaign service in the adwords.
And we get response described above.

Google Ads API Forum Advisor Prod

unread,
Oct 23, 2019, 1:05:42 PM10/23/19
to adwor...@googlegroups.com
Hello Dimitry,

In such case it might that your request is not built properly. RequestHeader must be there in your API request. Below is my sample request for CampaignService.get() API call for your reference. Please give it a try and let me know if you have any further questions. 

[23 Oct 2019 12:58:34,232-soapXmlLogger:DEBUG:main] SOAP request:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809" soapenv:mustUnderstand="0">
            <ns1:clientCustomerId>876-052-7478</ns1:clientCustomerId>
            <ns1:developerToken>REDACTED</ns1:developerToken>
            <ns1:userAgent>GoogleAdsSupport (AwApi-Java, AdWords-Axis/4.6.0, Common-Java/4.6.0, Axis/1.4, Java/1.8.0_212, maven, SelectorBuilder, SelectorField)</ns1:userAgent>
            <ns1:validateOnly>false</ns1:validateOnly>
            <ns1:partialFailure>false</ns1:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
        <get xmlns="https://adwords.google.com/api/adwords/cm/v201809">
            <serviceSelector>
                <fields>Id</fields>
                <fields>Name</fields>
                <ordering>
                    <field>Name</field>
                    <sortOrder>ASCENDING</sortOrder>
                </ordering>
                <paging>
                    <startIndex>0</startIndex>
                    <numberResults>100</numberResults>
                </paging>
            </serviceSelector>
        </get>
    </soapenv:Body>
</soapenv:Envelope>
Reply all
Reply to author
Forward
0 new messages