https://www.google.co.in/search?q=%3Cfaultstring%3EUnmarshalling+Error%3A+unexpected+element+(uri%3A%22https%3A%2F%2Fadwords.google.com%2Fapi%2Fadwords%2Fcm%2Fv201809%22%2C+local%3A%22RequestHeader%22).+Expected+elements+are+%26lt%3B&rlz=1C1MSIM_enIN

56 views
Skip to first unread message

Logita Kurrey

unread,
Nov 26, 2018, 6:08:30 AM11/26/18
to AdWords API and Google Ads API Forum
I am making a call to get all customerClientID of adwords account.
This is SOAP api i am calling.
<?xml version="1.0"?>
  <soapenv:Header>
    <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">
      <ns1:developerToken>DEVELOPER TOKEN</ns1:developerToken>
      <ns1:userAgent></ns1:userAgent>
      <ns1:validateOnly>false</ns1:validateOnly>
      <ns1:partialFailure>false</ns1:partialFailure>
    </ns1:RequestHeader>
  </soapenv:Header>
  <soapenv:Body>
        <getCustomers xmlns="https://adwords.google.com/api/adwords/mcm/v201809"/>
  </soapenv:Body>
</soapenv:Envelope>


And this is the endpoint


Response which i am getting is:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Unmarshalling Error: unexpected element (uri:"https://adwords.google.com/api/adwords/cm/v201809", local:"RequestHeader"). Expected elements are &lt;{https://adwords.google.com/api/adwords/mcm/v201809}ApiExceptionFault&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}RequestHeader&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}ResponseHeader&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}getCustomers&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}getCustomersResponse&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}getServiceLinks&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}getServiceLinksResponse&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}mutate&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}mutateResponse&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}mutateServiceLinks&gt;,&lt;{https://adwords.google.com/api/adwords/mcm/v201809}mutateServiceLinksResponse&gt; </faultstring> </soap:Fault> </soap:Body> </soap:Envelope>

Cant able to configue.
I got the sample from here and only updated the version.


Teja Makani

unread,
Nov 26, 2018, 12:20:36 PM11/26/18
to AdWords API and Google Ads API Forum
Hello Logita,

After taking a look at the SOAP logs provided, looks like the RequestHeader in your SOAP request is pointing to the cm directory instead of mcm directory. You could try your request again by pointing to the mcm directory, below is the example SOAP request for your reference.

SOAP Request below:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/mcm/v201809" soapenv:mustUnderstand="0">
            <ns2:clientCustomerId xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809">876-052-7478</ns2:clientCustomerId>
            <ns3:developerToken xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201809">REDACTED</ns3:developerToken>
            <ns4:userAgent xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201809">AdWords_API_Support (AwApi-Java, AdWords-Axis/4.1.0, Common-Java/4.1.0, Axis/1.4, Java/1.8.0_161-google-v7, maven)</ns4:userAgent>
            <ns5:validateOnly xmlns:ns5="https://adwords.google.com/api/adwords/cm/v201809">false</ns5:validateOnly>
            <ns6:partialFailure xmlns:ns6="https://adwords.google.com/api/adwords/cm/v201809">false</ns6:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
        <getCustomers xmlns="https://adwords.google.com/api/adwords/mcm/v201809"/>
    </soapenv:Body>
</soapenv:Envelope>

Please let me know if you have any further questions.

Regards,
Sai Teja, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages