Help on using Httputils in detail

coskunor

Member
Licensed User
Longtime User
Hi,

I could not find a user guide to use Httputils for consuming a web service
with two string input parameters and caling a function from four different
functions in the same ..asmx

where shall i put function name and the second string parameter in similar sub listed below (with only one parameter and none function name)

Thank you very much

Best regards


Sub Activity_Create(FirstTime As Boolean)
HttpUtils.CallbackActivity = "Main"
HttpUtils.CallbackJobDoneSub = "JobDone"
HttpUtils.PostString("POST Job1", PostUrl, "Celsius=123")
End Sub
 

coskunor

Member
Licensed User
Longtime User
You can add more parameters like this:
B4X:
HttpUtils.PostString("POST Job1", PostUrl, "Celsius=123&Parameter2=aaa&Parameter3=bbb")

thank you very much,
but how can i call function, because in the web service
there are more than one function;
can i put in PostUrt="http://....asmx/functionname"

where can i reach such detail information from ?

thanks again

regards
 
Upvote 0

coskunor

Member
Licensed User
Longtime User
Yes. You can put any valid url in PostURL.

Hi Erel,

Sorry but i could not reach function in the web service,

in normal way from the browser i can reach web service like;

http://xxxService.asmx?op=functionyyy

but from my code;


PostUrl ="http://xxxpService.asmx?op=functionyyy"


Sub Activity_Create(FirstTime As Boolean)
HttpUtils.CallbackActivity = "Main"
HttpUtils.CallbackJobDoneSub = "JobDone"
HttpUtils.PostString("POST Job1",PostUrl,"p1=deneref.txt&p2=xxxyyyrr99")
End Sub

Sub Activity_Resume
If HttpUtils.Complete = True Then JobDone(HttpUtils.Job)
End Sub


when i run i got Response Error;

Reason="Internal Server Error"
StatusCode=500

thank you and regards,
Refik
 
Upvote 0

DeerBear

Member
Licensed User
Longtime User
Hi Erel,
Sorry but i could not reach function in the web service,
in normal way from the browser i can reach web service like;
http://xxxService.asmx?op=functionyyy
but from my code;

thank you and regards,
Refik

Hi!

I doubt you can use SOAP with HTTPUtils.

However, you could use AXIS(=Java) to implement it and then
maybe import it as a library for B4A.
Not sure how workable this is but it's an idea!

Regards,

A
 
Last edited:
Upvote 0

lagore

Active Member
Licensed User
Longtime User
You can use HttpUtils to send Soap requests, there are some examples on the forum.

Sent from my HTC Desire using Tapatalk 2
 
Upvote 0

coskunor

Member
Licensed User
Longtime User
You can use HttpUtils to send Soap requests, there are some examples on the forum.

Sent from my HTC Desire using Tapatalk 2

Thank you for everybody,

I think could not describe the problem very well,
I was trying to use a web service which contains more than one function;

Question is ;
where can i put that specific function name in,
after which keyword or parameter...

Or shall i use web service contains only one function using Httputils.

regards,
Refik
 
Upvote 0

DeerBear

Member
Licensed User
Longtime User
Thank you for everybody,

I think could not describe the problem very well,
I was trying to use a web service which contains more than one function;

Or shall i use web service contains only one function using Httputils.

regards,
Refik

As it was stated, asmx files are soap webservices.
Someone who's got waaaay more experience with B4A than I do has
clearly stated it's possible - thus that is what you do; check in the
forum, find the relevant threads, and use the code :)

Cheers,

A
 
Upvote 0

lagore

Active Member
Licensed User
Longtime User
I was trying to use a web service which contains more than one function;
Have you an example of the web service, without this it is very hard to help.
 
Upvote 0
Top