1 message in com.googlegroups.adwords-apidoubt regarding the proxy settings in...| From | Sent On | Attachments |
|---|---|---|
| nirru | 25 Oct 2005 23:46 |
| Subject: | doubt regarding the proxy settings in api code.![]() |
|---|---|
| From: | nirru (nirm...@gmail.com) |
| Date: | 10/25/2005 11:46:21 PM |
| List: | com.googlegroups.adwords-api |
hai, I am trying to use google adwords programatically. After integration of the google adwords jar file into my project I have written a program to get the campaign detials. But iam getting the following errors 1. Un known host exception. ( this is becoz iam using the proxy connection. iam not getting where to change the code to do correct proxy settings in the program) 2. If iam using direct IP connection it is connecting properly but it is not returning the campaign detials. The account which iam using contains multiple clients.
import com.google.api.adwords.*; import org.apache.axis.client.Stub; import org.apache.axis.wsdl.*;
/** * This sample client prints out the campaign ids for all campaigns * belonging to the customer issuing the request. */
public class GetCampaignIdsDemo_1 extends Object{ // Uncomment and fill this in with your login information static final String email = "xyz.com"; static final String password = "abc"; static final String useragent = "nirru"; static final String token = "adsfdsfdfdfd"; // here i have given appriopiate token value
String clientemail="uvw.com";
private static final String apiNS = "https://adwords.google.com/api/adwords/v2";
public static void main(String args[]) { try{ CampaignService campaignService = new CampaignServiceServiceLocator().getCampaignService(); // Set the authentication request header ((Stub) campaignService).setHeader(apiNS, "email", email); ((Stub) campaignService).setHeader(apiNS, "password", password); ((Stub) campaignService).setHeader(apiNS, "useragent", useragent); ((Stub) campaignService).setHeader(apiNS, "token", token); ((Stub) campaignService).setHeader(apiNS,"clientEmail",clientemail); Campaign[] myCampaigns = campaignService.getAllAdWordsCampaigns(1); // Print name and id for each campaign // Print name, id, and status for each campaign for(int i = 0; i < myCampaigns.length; i ++ ) { System.out.println("Name: " + myCampaigns[i].getName() + " id: " + myCampaigns[i].getId() + " status: " + myCampaigns[i].getStatus()); }
}catch(Exception e){ e.printStackTrace(); }
}
}
please suggest the solution for my problem. Iam using netbeansIDE.




