Specifying a namespace for the Soap:Body

1,098 views
Skip to first unread message

Ian Ker-Seymer

unread,
Jan 12, 2016, 4:29:15 PM1/12/16
to AdWords API Forum
Here is an example request I am making:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="https://adwords.google.com/api/adwords/mcm/v201509" xmlns:cm="https://adwords.google.com/api/adwords/cm/v201509">
<soap:Header>
   
<wsdl:RequestHeader>
       
<developerToken>__ADWORDS_DEVELOPER_TOKEN__</developerToken>
       
<userAgent>Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36</userAgent>
       
<clientCustomerId>.........</clientCustomerId>
   
</wsdl:RequestHeader>
</soap:Header>
<soap:Body>
   
<cm:get xmlns:cm="https://adwords.google.com/api/adwords/mcm/v201509">
   
<cm:serviceSelector>
       
<cm:fields>CustomerId</cm:fields>
       
<cm:fields>Name</cm:fields>
   
</cm:serviceSelector>
</cm:get>
</soap:Body>
</soap:Envelope>


My issue is that I would like the response to not include a namespace in the Soap:Body. Currently, it specifies ns2 and the namespace for all fields in the response body. Is there a way to remove this?

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
   
<ns2:ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/mcm/v201509" xmlns="https://adwords.google.com/api/adwords/cm/v201509">
   
<requestId>000529265311ae480ac50be9070c5507</requestId>
   
<serviceName>ManagedCustomerService</serviceName>
   
<methodName>get</methodName>
   
<operations>1</operations>
   
<responseTime>201</responseTime>
</ns2:ResponseHeader>
</soap:Header>
<soap:Body>
   
<ns2:getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201509" xmlns:ns2="https://adwords.google.com/api/adwords/mcm/v201509">
   
<ns2:rval>
       
<totalNumEntries>2</totalNumEntries>
       
<Page.Type>ManagedCustomerPage</Page.Type>
       
<ns2:entries>
           
<ns2:name>adhawk-testing1</ns2:name>
           
<ns2:customerId>........</ns2:customerId>
       
</ns2:entries>
       
<ns2:entries>
           
<ns2:name>adhawk-test</ns2:name>
           
<ns2:customerId>........</ns2:customerId>
       
</ns2:entries>
       
<ns2:links>
           
<ns2:managerCustomerId>.........</ns2:managerCustomerId>
           
<ns2:clientCustomerId>........</ns2:clientCustomerId>
           
<ns2:isHidden>false</ns2:isHidden>
       
</ns2:links>
   
</ns2:rval>
</ns2:getResponse>
</soap:Body>
</soap:Envelope>



Josh Radcliff (AdWords API Team)

unread,
Jan 12, 2016, 6:35:02 PM1/12/16
to AdWords API Forum
Hi,

There is not an option to remove the namespaces. Since the response contains elements from multiple namespaces, removing the namespaces would make the XML ambiguous and invalid.

Why does the presence of namespaces pose a problem?

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages