Android Question Post with HttpUtils2

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi.
I have a WebService (asmx) that I would like to call with B4A App. I am missing something on the calling string. In fact while the direct call works fine, when I insert it in a PostString, I cannot obtain the answer from the service. The project is very simple and I attach it.
The direct call to the browser is:

http://www.galileo2000.it/acmmate/AcmMate.asmx/Work?Request=O=100

I have used a:

PostString("http://www.galileo2000.it/acmmate/AcmMate.asmx/Work","Request=O=100")

The project is copied from the example on UttpUtils, and is self explanatory.
Thanks in advance
 

Attachments

  • TestPost.zip
    6.9 KB · Views: 212

DonManfred

Expert
Licensed User
Longtime User
The url you want to call is http://www.acmmate.com/Galileo2000/AcmMate.asmx/Work with httpjob. If i open this url in a browser i get a resource not found error.

The httpjob itself it working (and shows the same error i get in my browser)

 
Last edited:
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Hi. Thanks, but you have to open the Url with the complete string, reported in my first message. (and it works, just try clicking it) It is an asmx service.
I reproduce it:

http://www.galileo2000.it/acmmate/AcmMate.asmx/Work?Request=O=100

the answer is (the visible part, I mean):

<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://tempuri.org/">#!OK!#</string>

Now the question is to correctly divide that call to use the PostString..
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim job2 As HttpJob
    Dim Url As String : Url="http://www.galileo2000.it/acmmate/AcmMate.asmx/Work?"
End Sub
' Direct call in browser is : http://www.galileo2000.it/acmmate/AcmMate.asmx/Work?Request=O=100
Sub Activity_Create(FirstTime As Boolean)
   'Send a POST request
   Dim Req="Request=O=100"
   job2.Initialize("Job2", Me)
   job2.PostString(Url,Req)
End Sub
 
Upvote 0

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
Probably I did some confusion. Sorry... Thanks for your time.. Now it works. I don't know why I swapped the site name (actually I have a site with that name, so probably i copied the wrong string..) Sorry again.. Thanks.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…