Android Question unexpected end of stream on okhttp3

xmtotti

Member
Licensed User
Hi,when I connect web service has a error :unexpected end of stream on okhttp3.Address@c1d37c3f
how I can resolve thanks
B4X:
Sub zx1_scan_result (scantext As String, scanformat As String)       
    Log ("B4A scan text = " & scantext)
    Log ("B4A scan format = " & scanformat)
    b3_Click
    Sleep(10)
    Dim rtnmsg,epurl As String
    Dim parm As String
    Dim job1 As HttpJob
    Dim str() As String
    job1.Initialize("job1",Me)
    epurl="http://zhzk.xipc.com.cn:8902/EIR.asmx"
    parm="securityKey=D0EA5FC3BA214476A8288271A70291EF&CorpCode=913502007760244992&EIRNo="&scantext
    Log(parm)   
    'job1.PostString(epurl&"/GetEirInfo",parm)   
    job1.PatchString(epurl&"/GetEirInfo",parm)
    Wait For (job1) JobDone(job1 As HttpJob)
    rtnmsg="请重试"
    If job1.Success Then
        rtnmsg=JobDone(job1)
        Log(rtnmsg)
        If rtnmsg.SubString2(0,2)="OK" Then
            str=Regex.split("@",rtnmsg)
            For i=1 To str.Length -1
                Log(str(i))
            Next
        Else
            Msgbox(rtnmsg,"提示")
        End If
    Else
        Msgbox(rtnmsg,"提示")
    End If
End Sub

Sub JobDone (Job As HttpJob) As String
    Dim rtnmsg As String
    Dim str() As String
    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)   
    If Job.Success = True Then
        rtnmsg=app_public.xml_parse(Job.GetString)
        Log(rtnmsg)
        str=Regex.split("@",rtnmsg)
        Job.Release
        Return rtnmsg
    Else
        'Log("Error: " & Job.ErrorMessage)
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
        Job.Release
        Return "请重试"&Job.ErrorMessage
    End If   
End Sub
 

OliverA

Expert
Licensed User
1) The code in post#1 and post#3 is not the some
Post #1:
B4X:
epurl="http://zhzk.xipc.com.cn:8902/EIR.asmx"
'some more code
job1.PatchString(epurl&"/GetEirInfo",parm)
This, you your example creates a URL of
Somehow I don't think this is right (guessing).
Another guess here is that you are trying to access the API of a website, but you have no clue as to what that API requires from you. You used PostString, PatchString, and Head (in post #3) to access the site (my guess, neither PatchString nor Head is correct, nor the URL you are building). You need to provide us with the sites API documentation before your issue can be resolved (right now, you are getting IOException errors due to improper calling of the sites API, again a guess).
Note: Don't post a screenshot of the error message, just post the text. Right-clicking on the error message should give you the "Copy line to clipboard". Use that to post the error message as text in the forum.
 
Top