Android Question Need a hand with web service

Pablo Torres

Active Member
Licensed User
Longtime User
I'm trying to implement a web service, simple
this is the code:

B4X:
#Region  Project Attributes 
    #ApplicationLabel: ABG W CON JOBDONE Y soap12
    #VersionCode: 1
    #VersionName: 
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes 
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
   
    Dim job1 As HttpJob

End Sub

Sub Globals
   
    Dim URL As String
  Dim XML As String
    Dim usr As String
    Dim pwd As String  
    Dim strResult As String 
   
End Sub

Sub Activity_Create(FirstTime As Boolean)

    Activity.LoadLayout("lyoWeather")
   
    URL = "http://www.saliracomer.com/ws/ws_sac.asmx"
    usr = *******
    pwd = ******
   
  ConsumirServiciSOAP
     
End Sub

Sub ConsumirServiciSOAP()
         
    XML = XML & "<soap:Envelope xmlns:soap='http://www.w3.org/2003/05/soap-envelope' xmlns:web='http://saliracomer.com/ws'>"
    XML = XML & "<soap:Header/>"
    XML = XML & "<soap:Body>"
    XML = XML & "<web:ws_Departamentos>"
    XML = XML & "<web:usr>" & usr & "</web:usr>"
    XML = XML & "<web:pwd>" & pwd & "</web:pwd>"
    XML = XML & "</web:ws_Departamentos>"
    XML = XML & "</soap:Body>"
    XML = XML & "</soap:Envelope>"
    XML = XML.Replace("'", Chr(34))
               
  job1.Initialize("JOBSOAP", Me)
  job1.PostString (URL, XML)
    job1.GetRequest.SetContentType("APPLICATION/soap+xml")
             
End Sub

Sub JobDone (JOB As HttpJob)
   
        If JOB.Success Then

            strResult = JOB.GetString
            Log(strResult)
           
        Else
        Msgbox( JOB.errormessage , "Error")
    End If
    JOB.Release
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub

[\code]

It get me the error "INTERNAL SERVER ERROR"

can anyone help me?
Thanks
 

Pablo Torres

Active Member
Licensed User
Longtime User
Hi Erel,

I don't know what "Smart strings" means and also don't know what is a soapaction header
I'm New to that terms
Can you show me an example?
Thanks
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Pablo Torres

Active Member
Licensed User
Longtime User
Are you Joking with me, right?
I like you, you are always trying to help ... but remember, that does not give you the right to tell me what should I do and what should not do
 
Upvote 0
Top