QuickBooks NOT working on Google App Engine

后端 未结 2 1559
独厮守ぢ
独厮守ぢ 2021-01-24 18:39

I was trying to connect to quickbooks online from google app engine by just running this simple code:

OAuthCredentials oauthcredentials = new OAuthCredentials(co         


        
相关标签:
2条回答
  • 2021-01-24 19:05

    AppEngine provides only a limited Socket API. In particular, you cannot use most getsockopt/setsockopt calls, which in your case throw the error (setTcpNoDelay(..)).

    QuickBooks SDK seems to be closed-source, so there is no way around it.

    Update:

    As of GAE Java SDK 1.8.1., it's possible to use socket options methods: they are a no-op, but they do not throw exceptions as they used to:

    The Sockets API now allows client code to call get/set options against sockets. Previously, calls raised "Not Implemented" exceptions. When java.net.Socket.get<option>() is called, a mock value is returned, calls to set<option>() will be silently ignored.

    0 讨论(0)
  • 2021-01-24 19:29

    I am SO thankful that you posted this question. I had been banging my head against the wall for days with the same problem, except I am developing my Google App in the Go language, not Java. BUT I MADE IT WORK! I hope that my solution will help you also. Basically, instead of using the sockets service, I am using the URL Fetch service, documented for Java here: https://developers.google.com/appengine/docs/java/urlfetch/

    I am pretty clueless about some of the details in your original post (I have not developed in Java, and am not familiar with the QBServiceFactory nor the OAuthCredentials). So I am not sure how much control you have over how it actually sends the requests to QB. But worst case scenario, I think you may be able to write your own functions to replace the QBServiceFactory (which I have had to do in Go), and if you make sure they use the URL Fetch service instead of sockets, you may have better luck.

    As I said, I am very thankful for your question, because I do not think that I would have stumbled across my answer otherwise, so thank you!

    0 讨论(0)
提交回复
热议问题