Android Question OkHttpUtils2 error

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi
unluckily I use B4A after some years, and I got a new problem on an "old" working program. This program uses OkHttpUtil2 library to send a string to an asmx service. I have printed the two arguments of the:
job1.PostString(Url,R.ToString)
where the error occurs. The parameters are:
http://www.galileo2000.it/AcmMate/AcmMate.asmx/Work
and
Request=O=88|P='r','3',0.7853887,2.0582553,2.004,0|
The webservice, tested separately, works.
The B4A log error reports the lines:
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
"Error occurred on line: 58 (HttpUtils2Service)".
java.lang.IllegalArgumentException: argument 1 should have type anywheresoftware.b4a.phone.Phone$IntentWrapper, got anywheresoftware.b4a.objects.IntentWrapper

The problem is that this code was working and I don't figure out why the "first parameter", i.e. the Url, is now not legal. (By the way I am not Java programmer..)
Thanks is advance for any hint.
 

DonManfred

Expert
Licensed User
Longtime User
What about YOU start with posting the CODE you use? This may be more suiteable than any GUESS we can do ;-)
 
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Of course. But it is a complex program, connecting bluetooth devices, getting data. etc. Not so easy to install and use. Moreover I get exactly that error, and I have put exactly the working calls. (Even could be used to hack my site ..). Now, much probably, I must extract only the involved instructions and post a simplified version. Before doing this, I was hoping to avoid this additional .. sorry .
 
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Moreover, the program has old structure, not with b4X pages etc. Making a new test program takes hours.. Thanks anyway..
 
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Following the only possible way, I did a simplified version of the program, hardcoding the post parameters, and it Worked. The obvious conclusion is that in the original there was something that is wrong. Examinating the libraries that were included, I found an HTTP and a Phone. I don't know what HTTP does and I brutally took it away, as long the Phone one, which was just used for an apparently useless declaration in Process Globals:
'Private pw As PhoneWakeState
I commented out the instruction and took away also the Phone library.
The error disappeared. I don't know whether my analysis is useful, but this is what happens. My problem seems to be solved and I have not the skills and the time to further investigate.
Thanks for reading.
 
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi. Thanks for the hint. No I didn't. To be sincere, being in a hurry, I am rather worry. This job is rather important, and having unexpected problems of this type is not the best of life. I will follow your advice, anyway, but in separate folders. Have a nice day.
 
Upvote 0
Top