Hi Eric,
I am using the following class
import com.google.api.adwords.v13.AccountInterface;
import com.google.api.adwords.v13.AccountServiceLocator;
import org.apache.axis.client.Stub;
/**
* This code sample retrieves the login email address for each account
managed
* by the effective user.
*/
public class GetClientAccounts {
// Provide AdWords login information.
private static final String email = "[email protected]";
private static final String password = "ranjit123";
//private static final String clientEmail =
"[email protected]";
private static final String useragent =
"my application";
private static final String developerToken =
"[email protected]++usd";
private static final String namespace =
"https://sandbox.google.com/api/adwords/v12";
public static void main(String[] args) {
try {
// Set up service connection.
AccountInterface service =
new AccountServiceLocator().getAccountService();
// Define SOAP headers.
((Stub) service).setHeader(namespace, "email", email);
((Stub) service).setHeader(namespace, "password", password);
((Stub) service).setHeader(namespace, "useragent", useragent);
((Stub) service).setHeader(namespace, "developerToken",
developerToken);
// ((Stub) service).setHeader(
// namespace, "applicationToken", applicationToken);
// BEGIN AccountService.getClientAccounts: v13
// Get client accounts.
String[] loginEmails = service.getClientAccounts();
// END AccountService.getClientAccounts: v13
// Display login emails.
if (loginEmails != null) {
for (String login : loginEmails) {
System.out.println("Login email is \"" + login + "\".");
}
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
but i am getting the following error :
{https://adwords.google.com/api/adwords/v13}fault:
<ns1:code>1</ns1:code>
<ns1:message>The request did not contain a header named 'email'.</
ns1:message>
The request did not contain a header named 'email'.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
--
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en.