Android Question Unexpected url with download - solved

JDS

Active Member
Licensed User
Longtime User
B4X:
Sub CheckPersID(sValue As String)
    Dim requestSoapXML As String
    Dim sChar As String
    Dim Soap As HttpJob

    sChar = "<MWB><F><N>MWB_PERSID</N><P><T>Str</T><V>" & sValue.Trim & "</V></P></F></MWB>"

    requestSoapXML = Global.def_webservice&"/PutScan/JSON?sValue="&sChar
    Log (requestSoapXML)

    HttpUtils.CallbackActivity = "Main_Screen"
    Soap.Initialize("MWB_PERSID",Me)
    Soap.Download(requestSoapXML)
    wait for (Soap) JobDone(Soap As HttpJob)
    Return
End Sub

When using the above code I get the error below. When entering the value of requestSoapXML (line with IP-adress below) in Chrome I get no error and the expected values returned. Any thoughts?

B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
********@@****************
** Activity (main) Resume **
*** Service (com) Create ***
** Service (com) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (main_screen) Create, isFirst = true **
** Activity (main_screen) Resume **
192.168.100.124/box_peeters/com.wso/PutScan/JSON?sValue=PE1XQj48Rj48Tj5NV0JfUEVSU0lEPC9OPjxQPjxUPlN0cjwvVD48Vj54Yk9TUjRPbmFNUHEzeFc8L1Y+PC9QPjwvRj48L01XQj4=
com$ResumableSub_CheckPersIDresume (B4A line: 98)
Soap.Download2(requestSoapXML,Array As String("")
java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
    at anywheresoftware.b4a.samples.httputils2.httpjob._escapelink(httpjob.java:151)
    at anywheresoftware.b4a.samples.httputils2.httpjob._download2(httpjob.java:117)
    at b4a.example.com$ResumableSub_CheckPersID.resume(com.java:206)
    at b4a.example.com._checkpersid(com.java:151)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1151)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at anywheresoftware.b4a.Msgbox.waitForMessage(Msgbox.java:231)
    at anywheresoftware.b4a.Msgbox.debugWait(Msgbox.java:190)
    at anywheresoftware.b4a.debug.Debug.wait(Debug.java:216)
    at anywheresoftware.b4a.debug.Debug.reachBP(Debug.java:362)
    at anywheresoftware.b4a.debug.Debug.ShouldStop(Debug.java:235)
    at b4a.example.main_screen._edttxt_textchanged(main_screen.java:521)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
    at anywheresoftware.b4a.objects.EditTextWrapper$1.afterTextChanged(EditTextWrapper.java:83)
    at android.widget.TextView.sendAfterTextChanged(TextView.java:7764)
    at android.widget.TextView.setText(TextView.java:4125)
    at android.widget.TextView.setText(TextView.java:3974)
    at android.widget.EditText.setText(EditText.java:85)
    at android.widget.TextView.setText(TextView.java:3949)
    at anywheresoftware.b4a.objects.TextViewWrapper.setText(TextViewWrapper.java:39)
    at anywheresoftware.b4a.objects.EditTextWrapper.setText(EditTextWrapper.java:226)
    at b4a.example.main_screen._edttxt_textchanged(main_screen.java:529)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
    at anywheresoftware.b4a.objects.EditTextWrapper$1.afterTextChanged(EditTextWrapper.java:83)
    at android.widget.TextView.sendAfterTextChanged(TextView.java:7764)
    at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:9669)
    at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:972)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:516)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:454)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:33)
    at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:685)
    at android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:197)
    at com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:184)
    at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:286)
    at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5254)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
 

DonManfred

Expert
Licensed User
Longtime User
What is the EXACT url you are trying with this command?
Add a log to get the real value.

Make sure you have added http:// or https:// !!!
 
Last edited:
Upvote 0
Top