Error running AdWords API with Google App Engine

187 views
Skip to first unread message

Anders H

unread,
Nov 27, 2013, 4:29:18 AM11/27/13
to adwor...@googlegroups.com
I am working on an App Engine Java project that tries to get a list of clients from a MCC Test Account. The project is using the Java Client Library.

The application is working when running locally on the devserver, but when running on appspot the statement:

page = managedCustomerService.get(selector);
 
throws the following exception:
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.net.SocketException: Permission denied: Attempt to access a blocked recipient without permission. (mapped-IPv4)

As I was in doubt which forum was best to ask this kind of question that includes both AdWords API and App Engine, I have already posted further details in the App Engine forum: http://stackoverflow.com/questions/20192725/java-socket-exception-when-running-google-adwords-api-on-google-app-engine

Could this be an error with the AdWords API / App Engine support or am I missing something?

Thanks,
Anders





Takeshi Hagikura (AdWords API Team)

unread,
Nov 29, 2013, 1:18:25 AM11/29/13
to adwor...@googlegroups.com
Hi Anders,

Due to the security protection for appengine, currently SOAP calls by axis are not allowed. 
You should be able to make a call with the jaxws modules
Can you please try that?

Best,
- Takeshi, AdWords API Team

Anders H

unread,
Dec 3, 2013, 6:58:20 AM12/3/13
to adwor...@googlegroups.com
Hi Takeshi,

Thank you for your suggestion. I will have at look at it and write back with my results when I have finished testing.

Are there any up to date Java demo applications available for using AdWords API on App Engine? I was thinking of something like this Python demo:
https://developers.google.com/adwords/api/docs/demo-apps?hl=da#awapi_app_engine_python

Thanks,
Anders

Takeshi Hagikura (AdWords API Team)

unread,
Dec 3, 2013, 11:38:44 PM12/3/13
to adwor...@googlegroups.com
Hi Andres,

Unfortunately there isn't a demo app for appengine using the Java client library. 

Best,
- Takeshi, 

Anders Hansen

unread,
Dec 4, 2013, 8:30:13 AM12/4/13
to adwordsapiad...@google.com, adwor...@googlegroups.com
Hi Takeshi,

I am quite new to both AdWords API and axis / jaxws, but as I understand it jaxws has a subset of the functionality of axis. Will this give me any problems with the functionality of the AdWords API compared to using axis and can I still use the adwords-axis-examples from the Java Client Library as a starting point for my learning in this area?

One problem I have found so far after having experimented  with the "GetAccountHierarchy" example (using jaxws instead of axis) is that there is no setFields method in the jaxws Selector class, so hopefully there is another way to select fields:
   
    // Axis example
    Selector selector = new Selector();
    selector.setFields(new String[]{"Login", "CustomerId",  "Name"});

I would really like to use Google App Engine for my project to get the advantages of low maintenance and scalability, but as there is so little information to find on the Internet about using AdWords API on App Engine, I am quite uncertain whether the integration of the two products have reached a maturity level suitable for production or if it is safer to go with setting up my own server. Can you please help me with your opinion about which way to go?

Thanks,
Anders


2013/12/4 Takeshi Hagikura (AdWords API Team) <adwordsapiad...@google.com>

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/SGw36bi5nDU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Takeshi Hagikura (AdWords API Team)

unread,
Dec 5, 2013, 1:31:50 AM12/5/13
to adwor...@googlegroups.com, adwordsapiad...@google.com
Hi Andres,

I'd use appengine (aside from I'm working at Google). I don't have to set up my own server and there is a starter pack option (I'm not the contact person for it though)
The Java library should work on appengine (as mentioned in the blog post, it's still experimental though). 
Basically it should work as the similar way as axis does.

As for this part,
   // Axis example
    Selector selector = new Selector();
    selector.setFields(new String[]{"Login", "CustomerId",  "Name"});

You need to write it like this using jax-ws. The Selector in jax-ws doens't have setFields method.
    Selector selector = new Selector();

    selector.getFields().addAll(Lists.newArrayList(
        "Login",
        "CustomerId",
        "Name"));

Also, if you are not stick to Java, you have a python option that has a demo app as you know.

Best,
- Takeshi, AdWords API Team

Anders Hansen

unread,
Dec 5, 2013, 5:01:15 PM12/5/13
to Takeshi Hagikura ad, adwor...@googlegroups.com
Hi Takeshi,

Thanks for your feedback. Based on this I will continue my AdWords API learing on App Engine, but I think I will prefer Java over Python for several reasons, one of which is that I don't have to learn a new programming language, another is my concern for performance.

Is there any roadmap for the Java AdWords API on appengine, including when it will no longer be experimental?

Thanks,
Anders



2013/12/5 Takeshi Hagikura (AdWords API Team) <adwordsapiad...@google.com>

Amr Abdel-wahab

unread,
Dec 23, 2013, 10:55:20 AM12/23/13
to adwor...@googlegroups.com
Takeshi I keep failing to run the python demo, can you send me an updated version of it and a good documentation on how to run it

Takeshi Hagikura (AdWords API Team)

unread,
Dec 25, 2013, 2:41:25 AM12/25/13
to adwor...@googlegroups.com
Hi Amr,

The questions seems to be a different topic. 
Can you please start another thread?

Best,
- Takeshi, AdWords API Team
Reply all
Reply to author
Forward
0 new messages