Android Question Problem while trying to use an .net ASMX

Yayou49

Active Member
Licensed User
Hi,

I have created an asmx project named "Android" in VS2010.
This asmx has a method called "Test", waiting for a parameter named "Nombre"

According to codes found on the forum, I'm trying to use the solution sent by Xicu (https://www.b4x.com/android/forum/t...-consumir-webservice-tipo-asp-net-asmx.45107/)

So in my case, Url for asmx will be http://mysite.com/android.asmx/Test

My Sub is:

B4X:
Sub ConsumirServiciPOST(Nombre As String)
Dim job1 As HttpJob
Dim Parametres As String
Parametres= "Nombre=" & Nombre
job1.Initialize("JOBPOST", Me)
job1.PostString("http://mysite.com/android.asmx/Test",Parametres)
End Sub

But when this sub is called, system reply: "<title>404 - File or directory not found.</title>"

Indeed, if I input the full address in IE (with the method name), I've got the same error message.

So I've tried to set URL as following (without name of method):

B4X:
Sub ConsumirServiciPOST(Nombre As String)
     Dim job1 As HttpJob
     Dim Parametres As String
     Parametres= "Nombre=" & Nombre
     job1.Initialize("JOBPOST", Me)
     job1.PostString("http://mysite.com/android.asmx",Parametres)
End Sub

But I still got another error: "Internal Server Error"

Just one precision, I've tested my asmx in VS2010 and it works fine.....

Does someone have the same problem or a solution for this problem ?
How to set the method in this call ?

In advance, many thanks.

Yayou
 

Yayou49

Active Member
Licensed User
Hi Erel,
You were right !!!
With a good and well formatted SOAP it works fine !!!!
Thx for your help.
 
Upvote 0
Top