Azzera filtri
Azzera filtri

Problem with xmlread() and https

8 visualizzazioni (ultimi 30 giorni)
Ioannis Antonopoulos
Ioannis Antonopoulos il 23 Giu 2016
Modificato: Robert il 31 Ott 2018
I want to parse a xml with using xmlread from a url which uses https protocol. I get the following problem : Server is not responding, it might not support the current protocol. Missing ServerHello. What can I do to fix this? I am using Matlab R2010a (64 bit) and I have Windows 7 (64 bit). Thnak you in advance.

Risposte (1)

Robert il 31 Ott 2018
Modificato: Robert il 31 Ott 2018
This could work if you have write access to the file: In command window, type
edit callSoapService
Then in the m-file, search for line
url = URL(endpoint);
Replace it with:
url = URL([], endpoint,
Save and try again.
If that doesn't work, you could get the XML text in a string and parse that using undocumented MATLAB . Put the XML in a string by using the http protocol and webread:
% Use http protocol instead of https.
myUrl = regexprep(myUrl, 'https', 'http');
% Read the file into a string.
xmlString = webread(myUrl);
% From undocumented MATLAB:
% The following avoids the need for file I/O:
inputObject =; % or: org.xml.sax.InputSource(
% Parse the input data directly using xmlread's core functionality
parserFactory = javaMethod('newInstance','javax.xml.parsers.DocumentBuilderFactory');
p = javaMethod('newDocumentBuilder',parserFactory);
xmlTreeObject = p.parse(inputObject);
% Use xmlread's semi-documented inputObject input feature
xmlTreeObject = xmlread(inputObject);
% Fallback to standard xmlread usage, using a temporary XML file:
% Store the XML data in a temp *.xml file
filename = [tempname '.xml'];
fid = fopen(filename,'Wt');
% Read the file into an XML model object
xmlTreeObject = xmlread(filename);
% Delete the temp file

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by