Android Question HttpUtils2 : Conversion from string " " to type 'Double' is not valid.

realblue

Member
Licensed User
Longtime User
I am calling a web service to obtain some data and JobDone sub is called with Success = False. When I check the log gives me this error :
B4X:
XML post: <?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><fillDataSetJSON xmlns="http://novafortis.com/"><srctable>GetOrders</srctable><SqlStr>SELECT G.GERCEKADI GARSON,M.BOLUM +' - '+M.ADI MASA,MS.MIKTAR,B.BIRIM,U.ADI URUN,MS.ACIKLAMA,MS.ADISYON,MS.ADISYONDETAY FROM MUTFAKSIPARISLERI MS,KULLANICILAR G,MASALAR_V M,URUNLER U,URUNPORSIYONLARI_V B WHERE MS.GARSON=G.SNO AND MS.MASA=M.SNO AND MS.URUN=U.SNO AND MS.BIRIM=B.SNO AND MS.HAZIRLANDI=0 ORDER BY MASA</SqlStr><ReadSchema>False</ReadSchema></fillDataSetJSON></soap12:Body></soap12:Envelope>


<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---&gt; Conversion from string " " to type 'Double' is not valid. ---&gt; Input string was not in a correct format.</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>


JobName = fillDataSetJSON@GetOrders, Success = false

Here is how I call the Job :

B4X:
Sub CallWebService(url As String, XML As String, opName As String, tablename As String)
        LogColor("XML post: " & XML,Colors.red)
        Dim j As HttpJob
       j.Initialize(opName & "@" & tablename, Me)
       j.PostString(url, XML)
       j.GetRequest.SetContentType("application/soap+xml; charset=utf-8")
    End If
End Sub

As far as I can see there is no error on the posted XML, is it something with the lib or me?

Thanks in advance.
 

Reviewnow

Active Member
Licensed User
Longtime User
To me it looks like your problem lies in the sql statement you are using and the server does not like it,
try your sql statement in a query editor make sure it works then try again
 
Upvote 0

realblue

Member
Licensed User
Longtime User
SQL statement is fine and returns rows. My first suspicion was also on the SQL statement but there is not any where condition which uses either < or > as the error message suggests.
 
Upvote 0

realblue

Member
Licensed User
Longtime User
Btw, I change the sql statement with a much simpler one, result is the same. I think this problem started with v3.80.

B4X:
XML post: <?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body><fillDataSetJSON xmlns="http://novafortis.com/"><srctable>GetOrders</srctable>
<SqlStr>SELECT * FROM MASALAR</SqlStr><ReadSchema>False</ReadSchema></fillDataSetJSON>
</soap12:Body></soap12:Envelope>

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code>
<soap:Reason><soap:Text xml:lang="en">Server was unable to process request. ---&gt; Conversion from string " " to type 'Double' is not valid. ---&gt; Input string was not in a correct format.</soap:Text>
</soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>
 
Upvote 0

Reviewnow

Active Member
Licensed User
Longtime User
The issue is still server side one of your response variables is set to double and your sql row value is null or empty
 
Upvote 0

realblue

Member
Licensed User
Longtime User
I found the problem. It turns out that SQL Server security related problem occurs and returned json string was not well constructed.

Thank you all.
 
Upvote 0
Top