Hi, I have a problem with the memory. When you use a webservice and the response is a PDF file 7 Mb, I try to store the response in a string, and the app goes into error. Is there a way to save it in a variable, the XML response from the webserver?
Public Sub GetString2(Encoding As String) As String
Dim tr As TextReader
tr.Initialize2(File.OpenInput(HttpUtils2Service.TempFolder, taskId), Encoding)
Dim res As String
res = tr.ReadAll <--- CRASH POINT (Out of Memory)
tr.Close
Return res
End Sub
WEBSERVER RESPONSE
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetReportResponse xmlns="http://*********/">
<GetReportResult>base64Binary</GetReportResult> <--- 7 MB
<Errore>string</Errore>
<Paziente>string</Paziente>
<CodReferto>string</CodReferto>
<Feedback>boolean</Feedback>
</GetReportResponse>
</soap:Body>
</soap:Envelope>
Public Sub GetString2(Encoding As String) As String
Dim tr As TextReader
tr.Initialize2(File.OpenInput(HttpUtils2Service.TempFolder, taskId), Encoding)
Dim res As String
res = tr.ReadAll <--- CRASH POINT (Out of Memory)
tr.Close
Return res
End Sub
WEBSERVER RESPONSE
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetReportResponse xmlns="http://*********/">
<GetReportResult>base64Binary</GetReportResult> <--- 7 MB
<Errore>string</Errore>
<Paziente>string</Paziente>
<CodReferto>string</CodReferto>
<Feedback>boolean</Feedback>
</GetReportResponse>
</soap:Body>
</soap:Envelope>