I use matlab to invoke a web service on my local intranet to retrieve some data I need. This works perfectly on my 32 bit Windows XP machine on R2009a. I just got a new Windows 7 machine and have installed 64 bit R2010b on it. The same code that works well for me on my older machine seems to run into some issues invoking the same web service.
My knwoledge of SOAP and web services is patchy at best so I would really appreciate any ideas about what causes this and how to fix it. The workflow below works on my older machine. the GetDataSources method is generated by createClassFromWsdl and just calls createSoapMessage and then callSoapService. I do not beleive the problem is in the format of the error message returned by the web service but in the fact that it has authentication issues with the SOAP call in the first place. Thank you in advance.
%--- BEGIN CODE ----
>>createClassFromWsdl(<WSDL location>);
>>s = Service % Serivice is the class name
>>GetDataSources(s) % Invoking a web service call
[Fatal Error] strict.dtd:1:2: The markup declarations contained or pointed to by the document type declaration must be well-formed.
??? Error using ==> parseSoapResponse at 32 The server's response was not valid XML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>You are not authorized to view this page</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<STYLE type="text/css">
BODY { font: 8pt/12pt verdana }
H1 { font: 13pt/15pt verdana }
H2 { font: 8pt/12pt verdana }
A:link { color: red }
A:visited { color: maroon }
</STYLE>
</HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>
<h1>You are not authorized to view this page</h1>
You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept.
<hr>
<p>Please try the following:</p>
<ul>
<li>Contact the Web site administrator if you believe you should be able to view this directory or page.</li>
<li>Click the Refresh button to try again with different credentials.</li>
</ul>
<h2>HTTP Error 401.2 - Unauthorized: Access is denied due to server configuration.<br>Internet Information Services (IIS)</h2>
<hr>
<p>Technical Information (for support personnel)</p>
<ul>
<li>Go to Microsoft Product Support Services and perform a title search for the words <b>HTTP</b> and <b>401</b>.</li>
<li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),
and search for topics titled <b>About Security</b>, <b>Authentication</b>, and <b>About Custom Error Messages</b>.</li>
</ul>
</TD></TR></TABLE></BODY></HTML>
%--- END CODE ----
|
|
0
|
|
|
|
Reply
|
Shishir
|
11/23/2010 4:03:04 PM |
|
For any interested parties I stumbled upon a solution - it appears that there is a bug in the way callSoapService.m opens a connection. I used the code used by urlread that still works to fix it.
In callSoapService.m
%%%BEGIN CODE%%%
% Create the connection where we're going to send the file.
url = URL(endpoint);
% PROXY CODE BEGIN %
% Be sure the proxy settings are set.
com.mathworks.mlwidgets.html.HTMLPrefs.setProxySettings
% Get the proxy information using MathWorks facilities for unified proxy % prefence settings.
mwtcp = com.mathworks.net.transport.MWTransportClientPropertiesFactory.create();
proxy = mwtcp.getProxy();
% Open a connection to the URL.
if isempty(proxy)
httpConn = url.openConnection;
else
httpConn = url.openConnection(proxy); end % PROXY CODE END %
%%%END CODE%%%
does not work. I needed to replace it to call to the function to generate httpConn.
I copied
C:\Program Files\MATLAB\R2010b\toolbox\matlab\iofun\private\urlreadwrite.m
To urlreadwrite1.m
And replaced the code in callSoapService.m with
%%%BEGIN CODE%%%
% Create the connection where we're going to send the file.
httpConn = urlreadwrite1(mfilename,endpoint);
% PROXY CODE END %
|
|
0
|
|
|
|
Reply
|
Shishir
|
11/29/2010 10:13:04 PM
|
|
What is the first argument 'mfilename'?
|
|
0
|
|
|
|
Reply
|
pat.deman (3)
|
10/9/2011 5:17:30 PM
|
|