Missing SoapHeader

182 views
Skip to first unread message

bradle...@autotrader.com

unread,
Jun 15, 2016, 4:50:45 PM6/15/16
to Google's DoubleClick for Publishers API Forum
Though we are using the DFP API (v201605) calls to CustomTargetingService.createCustomTargetingValues are missing the soap header.  

Request:
<?xml version="1.0" encoding="UTF-8"?><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:Body>
        <createCustomTargetingValues xmlns="https://www.google.com/apis/ads/publisher/v201605">
            <values>
                <customTargetingKeyId>462279</customTargetingKeyId>
                <name>63544189</name>
                <matchType>EXACT</matchType>
            </values>
        </createCustomTargetingValues>
    </soapenv:Body>
</soapenv:Envelope>

Response:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Server</faultcode>
            <faultstring>Missing SoapHeader while invoking public abstract java.util.List com.google.ads.publisher.api.service.customtargeting.CustomTargetingService.createCustomTargetingValues(java.util.List) throws com.google.ads.api.services.common.error.ApiException with params [[com.google.ads.publisher.api.service.customtargeting.v201605.jaxbgen.CustomTargetingValue@2d407cb1]].</faultstring>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>

I don't recall us having this issue before we upgraded from v201511.

Vincent Racaza (DFP API Team)

unread,
Jun 15, 2016, 10:31:50 PM6/15/16
to Google's DoubleClick for Publishers API Forum
Hi,

There are no changes in the creation of custom targeting values from API version v201511 to v201605. From your soap request body, the parameters are also correct. Could you check if the soap request header is generated? I can only see your soap request body above. Please check other API services also if they are generating soap request header.

<soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://www.google.com/apis/ads/publisher/v201605" soapenv:mustUnderstand="0">
            <ns1:networkCode>XXXX</ns1:networkCode>
            <ns1:applicationName>My DFP Project (DfpApi-Java, Dfp-Axis/2.14.0, Common-Java/2.14.0, Axis/1.4, Java/1.7.0-google-v6, jars)</ns1:applicationName>
        </ns1:RequestHeader>
</soapenv:Header>

Thanks,
Vincent Racaza, DFP API Team

bradle...@autotrader.com

unread,
Jun 15, 2016, 10:39:08 PM6/15/16
to Google's DoubleClick for Publishers API Forum
No, the soap request header is not generated.  It does get generated for the other requests, like order and lineItem.

Vincent Racaza (DFP API Team)

unread,
Jun 15, 2016, 10:59:46 PM6/15/16
to Google's DoubleClick for Publishers API Forum
Hi,

Since it does not generate the soap request header for other requests, so does it mean to say that you encountered the same error on those other requests (getting order or line item)?

Thanks,
Vincent Racaza, DFP API Team

bradle...@autotrader.com

unread,
Jun 15, 2016, 11:13:18 PM6/15/16
to Google's DoubleClick for Publishers API Forum
The header does get generated for other requests.  I have only encountered this error when getting and creating CustomTargetingValues.

bradle...@autotrader.com

unread,
Jun 15, 2016, 11:25:09 PM6/15/16
to Google's DoubleClick for Publishers API Forum
Also, the header is generated sometimes for createCustomTargetingValues, and sometimes not.  We are reusing the CustomTargetingServiceInterface instance for multiple calls, as mentioned in best practices.  Is that a problem?

Here is a createCustomTargetingValues request where the header gets generated:

<?xml version="1.0" encoding="UTF-8"?><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://www.google.com/apis/ads/publisher/v201605" soapenv:mustUnderstand="0">
            <ns1:networkCode>18353239</ns1:networkCode>
            <ns1:applicationName>Autotrader (DfpApi-Java, Dfp-Axis/2.15.0, Common-Java/2.15.0, Axis/1.4, Java/1.8.0_72, maven)</ns1:applicationName>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
        <createCustomTargetingValues xmlns="https://www.google.com/apis/ads/publisher/v201605">
            <values>
                <customTargetingKeyId>462279</customTargetingKeyId>
                <name>1391099</name>

Tesfamichael Hailegeorgis(DFP API Team)

unread,
Jun 16, 2016, 11:39:38 AM6/16/16
to Google's DoubleClick for Publishers API Forum
Hi,

Thanks for the additional information.

So, when you are reusing an existing service client/stub, the request headers are not generated but, when you are not reusing the service client/stub the request headers are generated, right? If so, this is behaving as intended as explained in the best practice document. 

Feel free to ask if you have any follow-up question on this.

Thanks,
Tesfamichael Hailegeorgis, DFP API Team

bradle...@autotrader.com

unread,
Jun 16, 2016, 11:56:31 AM6/16/16
to Google's DoubleClick for Publishers API Forum
No. We are always reusing the service clients.  Also, none of the other service clients, like the one for order, have this issue.  The document you linked to advises us to reuse the clients, but you're advising us not to?

Tesfamichael Hailegeorgis(DFP API Team)

unread,
Jun 16, 2016, 2:27:53 PM6/16/16
to Google's DoubleClick for Publishers API Forum
No, I am not advising not to use it. It is a best practice and hence I am advising to use it as it is meant to improve performance.

This seems different from what I was thinking about, sorry.

Just to clarify, were you multithreading while creating the custom targeting values? Can you please send the complete Java code that gives you this error(showing no request header)? Feel free to use the' Reply privately to author' option to send the code in a private message to me.

 I am asking this information as I haven't been able to reproduce this issue using the same API version in my test network.

Thanks,
Tesfamichael Hailegeorgis, DFP API Team
Reply all
Reply to author
Forward
0 new messages