1. marc vandeven
  2. PowerServer Mobile (Obsolete)
  3. Wednesday, 17 January 2018 16:28 PM UTC

Hello,

I ask you because i have a problem when i call the function PostUrl of inet, the function return all the time -1.

I call the function in mobile application (android) and appeonserver is on .net IIS.

This is my code :

inet l_inet

internetresult l_internetresult

String s_request, s_param, s_header

Integer i_return

s_request = "https://maps.googleapis.com/maps/api/distancematrix/xml?departure_time=now&traffic_model=best_guess&mode=driving&units=metric&origins=49.443232,1.099971&destinations=48.9851655,2.2466938|49.132338,2.35499|49.026079,2.1041515|49.4279628,1.0888234|48.8897208,2.1731804&key=AIzaSyDknKjYvKMQ8vw-Nw3HY5buwPjNG-EwPgQ"

l_inet = CREATE inet

l_internetresult = CREATE l_internetresult

s_param = Blob("",EncodingAnsi!)

s_headers = "Content-Type: application/x-www-form-urlencoded~nContent-Length: " + String( Len(s_param)) + "~n~n"

i_return = l_inet.PostURL (s_request, s_param, s_headers, 0, l_internetresult)

Somebody can try if he get the same (i_return = -1)

Regards

 

Appeon Support Team Accepted Answer Pending Moderation
  1. Thursday, 18 January 2018 01:13 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 1

Hi,

Please try if case below could work around your issue.
http://support.appeon.com/appeon/RESTfulWebService_mobile.zip

Regards,
ZhaoKai

Comment
  1. marc vandeven
  2. Thursday, 18 January 2018 10:09 AM UTC
Hello,



 



Thank's for your solution, but it's the same



If i try in mobile, your function f_posturl_mobile return nothing, and if into your function your write this :



integer i_return

i_return = iinet_base.PostURL  (as_url, lblb_args, ls_headers, 80, iir_msgbox)

i_return get -1, it's the same of me.



I do myself a workarround, i put the url into the control eon_mobile_webviewex and i use the function 



uo_web.of_startloading(s_request)



After into the event oe_loadend() i do this



of_runjavascript( "document.documentElement.innerHTML", s_return)



to get the result come from the url.



You have to put Sleep(1) before call the function of_runjavascript​ to wait sometime because the event oe_loadend is executed immediatly after the function of_startloading() and if you don't do the sleep(1), you get nothing into the eon_mobile_webviewex object.



I now, this is a patch, bit he work !!!

  1. Helpful
There are no comments made yet.
Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 17 January 2018 22:32 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 2

Hi Marc,

 

This may be cause because of an invalid API Key from Google. Have you checked the validity of the API Key?

 

 

Regards,

Comment
  1. marc vandeven
  2. Thursday, 18 January 2018 09:55 AM UTC
no my api api key is valid

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.