Sample SOAP request XML for getCompaniesByStatement operation

602 views
Skip to first unread message

gopavaram...@gmail.com

unread,
Jul 16, 2013, 2:31:19 AM7/16/13
to google-doubleclick...@googlegroups.com
Hi,

Could anyone help me to get the sample example SOAP request for getCompaniesByStatement operation ASAP?

Thanks,
Kiran G

Vincent Tsao (DFP API Team)

unread,
Jul 16, 2013, 10:49:17 AM7/16/13
to google-doubleclick...@googlegroups.com
Hi Kiran:

We strongly recommend you use one of our client libraries to make it easier to access the API instead of generating the SOAP manually:

If you do need to generate the raw SOAP yourself, please see documentation here:

You can also use one of the client libraries to make a call and then examine the SOAP (all of them offer SOAP logging). For instance, the Java client library has an example here:

Thanks,
Vincent Tsao, DFP API Team

gopavaram...@gmail.com

unread,
Jul 17, 2013, 2:51:54 AM7/17/13
to google-doubleclick...@googlegroups.com
Hi Vincent,

Thanks for your response.
I've already tried with the raw SOAP request as shown below and able to get the response.

<soapenv:Body>
      <v20:getCompaniesByStatement>
         <v20:filterStatement>
                  <v20:query>WHERE id = 'XXXXXXXX'</v20:query>
         </v20:filterStatement>
      </v20:getCompaniesByStatement>
   </soapenv:Body>

But I need the query to be modified in the form of key value pair as shown below format of request body. 

<soapenv:Body>
      <v20:getCompaniesByStatement>
         <v20:filterStatement>
            <v20:query>?????</v20:query>
            <v20:values>
               <v20:key>?????</v20:key>
               <v20:value>
                  <v20:Value.Type>?????</v20:Value.Type>
               </v20:value>
            </v20:values>
         </v20:filterStatement>
      </v20:getCompaniesByStatement>
   </soapenv:Body>


Appreciate your help to fill the ???? with proper syntax in above request body. Please let me know if you need more details.

Thanks,
Kiran G

Vincent Tsao (DFP API Team)

unread,
Jul 17, 2013, 8:58:42 PM7/17/13
to google-doubleclick...@googlegroups.com
Hi Kiran:

Here's an example using bind variables:

        <getCompaniesByStatement xmlns="https://www.google.com/apis/ads/publisher/v201306">
            <filterStatement>
                <query>WHERE id = :id ORDER BY id ASC LIMIT 1000</query>
                <values>
                    <key>id</key>
                    <value xmlns:ns2="https://www.google.com/apis/ads/publisher/v201306" xsi:type="ns2:NumberValue">
                        <ns2:value>12345678</ns2:value>
                    </value>
                </values>
            </filterStatement>
        </getCompaniesByStatement>

Once again, I strongly recommend using one of our client libraries instead of generating the SOAP request manually. If you cannot use them because your production environment does not allow it, then at least I would recommend using them locally and making calls with our examples to see what the SOAP requests look like if you're having trouble with them. All of our client libraries provide SOAP logging.

Thanks,
Vincent Tsao, DFP API Team


gopavaram...@gmail.com

unread,
Jul 19, 2013, 12:16:51 AM7/19/13
to google-doubleclick...@googlegroups.com
Hi Vincent,

I'm using the SOAP UI for testing the service request. This approach is only for testing purpose.
Thanks for your help, the problem was solved.

Thanks,
Kiran G
Reply all
Reply to author
Forward
0 new messages