- Create a "weboptions" object with timeout set to 60 seconds.
- Pass this created object as second parameter to the "webread" function
Http Timeout webread not working
24 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello, I'm running into 5 second timeout although I increased it with this webread:
import matlab.io.xml.dom.*
import matlab.io.xml.xpath.*
weboptions('Timeout',60)
data=webread("http://xxx/values.xml");
doc = parseString(Parser,data);
Output:
GetTankLevels
ans =
weboptions with properties:
CharacterEncoding: 'auto'
UserAgent: 'MATLAB 9.13.0.2085925 (R2022b) Update 1'
Timeout: 60
Username: ''
Password: ''
KeyName: ''
KeyValue: ''
ContentType: 'auto'
ContentReader: []
MediaType: 'auto'
RequestMethod: 'auto'
ArrayFormat: 'csv'
HeaderFields: []
CertificateFilename: 'default'
Error using webread
The connection to URL 'http://xxx/values.xml' timed out after 5.000 seconds. The reason is "Connection timeout after 5099 ms". Perhaps the server is not responding or
weboptions.Timeout needs to be set to a higher value.
0 comentarios
Respuestas (1)
VINAYAK LUHA
el 11 de Oct. de 2023
Editada: VINAYAK LUHA
el 11 de Oct. de 2023
Hi Tobias,
I understand that your "webread" request terminates with a timeout error despite explicitly setting the timeout time higher using the "weboptions" function.
Here is a solution to resolve the timeout error:
Further, I've also attached the code snippet for your better understanding:
options =weboptions('Timeout',60)
data=webread("http://xxx/values.xml",options);
I hope you find this solution helpful and the timeout error now stands resolved.
Regards,
Vinayak Luha
0 comentarios
Ver también
Categorías
Más información sobre Web Services en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!