I am facing a problem with Sandbox.. calls to the sandbox throws the
error that \\" The request did not contain a header named 'email. \\".
I have appended the main program that i m using to make the API calls
to Sandbox.

I m not sure about the "namespace" that i have to use, as while
debugging i see the adwords namespace "adwords.google.com" hard-coded
in each of the calls in the source-code, thats provided along-with the
client library.

I suppose these should point to "sandbox.google.com" as i wish to make
calls to Sandbox. Or is there is some other client library for sandbox
calls.

These are the code samples i found confusing in the source code.
-----------------------
1. private java.lang.String AccountService_address = "https://
adwords.google.com/api/adwords/v12/AccountService";

2. _call.setOperationName(new javax.xml.namespace.QName("https://
adwords.google.com/api/adwords/v12", "getAccountInfo"));
------------------------

public class AdwordClient {
    // Provide AdWords login information.
    private static final String email = "[EMAIL PROTECTED]";
    private static final String password = "password";
    private static final String useragent = "ANY VALUE";
    private static final String clientEmail = "client_1"+email;
    private static final String developerToken = email+"++INR";
    private static final String applicationToken = email+"++INR";
    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, "clientEmail",
clientEmail);
            ((Stub) service).setHeader(namespace, "useragent",
useragent);
            ((Stub) service).setHeader(namespace, "developerToken",
developerToken);
            ((Stub) service).setHeader(namespace, "applicationToken",
applicationToken);

            // Get account info.
            AccountInfo accountInfo = service.getAccountInfo();

            // Display account info.
            System.out.println("Account name is \""
                    + accountInfo.getDescriptiveName() + "\", id is
\""
                    + accountInfo.getCustomerId() + "\", and currency
code is \""
                    + accountInfo.getCurrencyCode() + "\".");


        } catch (Exception e) {
            e.printStackTrace();
        }
    }

===========================
Please clarify my doubts.

Thanks in Advance,
Sachin






--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to