Hello to all,
First of all, because this is my first post, i would like to praise the development team of B4A, because it's one of the best products i've used in the recent times.
Now, speaking of work...
I have the necessity to consume a WCF webservice. I've read almost all posts in the forum talking about webservices and i've managed to put out some code that, i thought, would work.
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
I've uploaded a simple test project with those files and this code.
I have two problems:
1 - using obtemempresas.xml when program enters in JobDone, i get always "Bad Request" error. I've created a Visual Studio application and a way to consume the webservice, having Charles Web Debugging Proxy to get the soap messages, so the soap is an exact copy of that (the same thing with Autenticacao.xml)
2-using autenticacao.xml i also get an error, but this time is "Internal Server Error".
Since in here there are much more experienced eyes than mine, i would like to know if anyone can give a hand, that would be very appreciated!!
Keep up with the good work!!
			
			First of all, because this is my first post, i would like to praise the development team of B4A, because it's one of the best products i've used in the recent times.
Now, speaking of work...
I have the necessity to consume a WCF webservice. I've read almost all posts in the forum talking about webservices and i've managed to put out some code that, i thought, would work.
			
				B4X:
			
		
		
		Sub mnuRefresca_Click()
    Dim htJob As HttpJob
    Dim strXML As String = File.ReadString(File.DirAssets, "ObtemEmpresas.xml")
    'Dim strXML As String = File.ReadString(File.DirAssets, "Autenticacao.xml")
    Log(strXML)
    htJob.Initialize("htJob", Me)
    htJob.PostString("http://www.*****.pt:82/ws/Autenticacao/AutenticacaoCliente.svc?wsdl", strXML)
    htJob.GetRequest.SetContentType("text/xml; charset=utf-8")
End Sub
Sub JobDone (Job As HttpJob)
  Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
        'print the result to the logs
        Log(Job.GetString2("UTF8"))
        ToastMessageShow(Job.GetString2("UTF8"),True)
    Else
        Log("Error: " & Job.ErrorMessage)
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End SubI've uploaded a simple test project with those files and this code.
I have two problems:
1 - using obtemempresas.xml when program enters in JobDone, i get always "Bad Request" error. I've created a Visual Studio application and a way to consume the webservice, having Charles Web Debugging Proxy to get the soap messages, so the soap is an exact copy of that (the same thing with Autenticacao.xml)
2-using autenticacao.xml i also get an error, but this time is "Internal Server Error".
Since in here there are much more experienced eyes than mine, i would like to know if anyone can give a hand, that would be very appreciated!!
Keep up with the good work!!
			
				Last edited: 
			
		
	
								
								
									
	
								
							
							 
				 
 
		 
 
		 
 
		 
 
		