Android Question Question HttpUtils2

MarcoRome

Expert
Licensed User
Longtime User
I have a question.

Code: Copy
Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
        XMLRPC1.Initialize("XMLRPC1")
    End If
'Preleva Token
XMLRPC1.initXMLRPCClient("http://muovi.roma.it/ws/xml/autenticazione/1")
Dim vedi As String = XMLRPC1.objectCall2("autenticazione.Accedi","QCOT7MBQwaC8dQI3BcVEC58kTCeriOOi","")
Log(vedi) ' I have correct result here



This mode work. Can i use HttpUtils to get the same result ???

I try this:

Code: Copy
  job1.Initialize("JOB1", Me)
  Dim autentificazione As String = "http://muovi.roma.it/ws/xml/autenticazione/1"
  job1.Download2(autentificazione, Array As String("QCOT7MBQwaC8dQI3BcVEC58kTCeriOOi", ""))
  Log("JobName = " & job1.JobName & ", Success = " & job1.Success)
  Log(job1.GetString)

but success = false
and error is:
java.io.FileNotFoundException: /: open failed: EISDIR (Is a directory)

Thank you all
 
You can use HttpUtils2 to create any request you need. However you do need to understand the request structure and how HttpUtils2 works.

I'm not familiar with XMLRPC library.

You can use a tool such as Fiddler or Wireshark to monitor the request as it being sent from the desktop. It will be then easier to replicate it with HttpUtils2.

See HttpUtils2 tutorial to understand how it works. The code above is wrong.
 
Upvote 0
Thank you Erel for your quick response.
The question is simple i have this address: "http://muovi.roma.it/ws/xml/autenticazione/1"
To this end it is necessary to invoke the method "autenticazione.Accedi", passing two parameters
"QCOT7MBQwaC8dQI3BcVEC58kTCeriOOi" and "".

I dont understand as call method.
There is a collegue who has already had this kind of experience ?

Anyway the B4A is fantastic tools :) like very much
Thank you again
 
Upvote 0
i try with this code:

Code: Copy
requestSoapXML1 = "<?xml version='1.0'?>" & _
"<methodCall>" & _
"<methodName>autenticazione.Accedi</methodName>" & _
"<params>" & _
  "<param>" & _
        "<value>QCOT7MBQwaC8dQI3BcVEC58kTCeriOOi</value>" & _
        "<value>''</value>" & _
    "</param>" & _
  "</params>" & _
"</methodCall>"   

  job1.Initialize("JOB1", Me)
  job1.PostString ("http://muovi.roma.it/ws/xml/autenticazione/1", requestSoapXML1)
  Log("JobName = " & job1.JobName & ", Success = " & job1.Success)
  Log(job1.GetString)
  Taken = job1.GetString

But job1.Success comeback False
 
Upvote 0
Back
Top