MATLAB Web Service error

WSDL-based programming interface for the DAVID Bioinformatic Resources

MATLAB Web Service error

Postby Guest » Mon Feb 18, 2013 4:41 am

Dear All,

I am trying to use DAVID API from MATLAB, therefore I have registrated my email on the site. The first problem I ran into was the bad formulation of "DAVIDWebService\DAVIDWebService.m", which retuned an error: "The CLASS function must be called from a class constructor."

I have corrected the M-File changing the code to:

classdef DAVIDWebService
properties
endpoint = 'http://david.abcc.ncifcrf.gov:80/webservice/services/DAVIDWebService.DAVIDWebServiceHttpSoap11Endpoint/';
wsdl = 'http://david.abcc.ncifcrf.gov/webservice/services/DAVIDWebService?wsdl';
end
end

That solved the first problem, so I could call the function for authentication ("authenticate.m"), which returned "true" value indicating that everything is fine, my email is registered. But after these steps, any of the functions I try to call returns:

ans =

Authentication Failed

Could someone help me clear it, what to do next, to make the functions work?

Bests,

Matyas
Guest
 

Re: MATLAB Web Service error

Postby Guest » Mon Feb 18, 2013 7:36 am

First of all, make sure you saved the matlab client code in a directory named '@DAVIDWebService' rather than 'DAVIDWebService' in your current working directory.

second, type a command line 'edit callSoapService' to add the following lines to callSoapService.m:

Line 37:
global cookie;

Line 60~62: (below %Set the appropriate HTTP parameters.)
if (~isempty(cookie))
httpConn.setRequestProperty('Cookie', concat(concat(cookie.Name,'='),cookie.Value))
end

Line108~121: (bellow byteArrayOutputStream.close;)
i=0;
while true
headerField = httpConn.getHeaderField(i);
if (headerField ~= '')
if (strcmp(httpConn.getHeaderFieldKey(i), 'Set-Cookie'))
headerField = headerField.substring(0,headerField.indexOf(';'));
cookie.Name = headerField.substring(0, headerField.indexOf('='));
cookie.Value = headerField.substring(headerField.indexOf('=') + 1, headerField.length());
end
else
break
end
i = i+1;
end

****Save callSoapService.m ******* You may need admin access to this file

Now you can test the following code:

obj = DAVIDWebService;
authenticate(obj,'yourRegisteredEmailAddress@your.org') % replace the email with your registered email address
getConversionTypes(obj)
inputIds = '1000_at,1001_at,1002_f_at,1003_s_at,1004_at,1005_at,1006_at,1007_s_at';
idType = 'AFFYMETRIX_3PRIME_IVT_ID';
listName = 'Correlated genes';
listType = 0;
addList(obj, inputIds, idType, listName, listType)
tableReport =getTableReport(obj)
chartReport=getChartReport(obj,0.1,2);

__________
Guest
 

Re: MATLAB Web Service error

Postby Guest » Tue Feb 19, 2013 10:44 am

Works like a charm, thanks a lot!

M
Guest
 

Re: MATLAB Web Service error

Postby Guest » Thu Dec 04, 2014 9:03 am

I did it follow your proposal, however an Error occur :

Access to an object's fields is only permitted within its methods.

Error in authenticate (line 26)
response = callSoapService( ...
Guest
 

Re: MATLAB Web Service error

Postby Guest » Thu Dec 04, 2014 10:54 am

It may be a connection error to the server. You may try it again and see if it is solved.
Guest
 

Re: MATLAB Web Service error

Postby Guest » Thu Dec 04, 2014 9:12 pm

sorry the error remains the same!

Guest wrote:
> It may be a connection error to the server. You may try it again and see if
> it is solved.
Guest
 

Re: MATLAB Web Service error

Postby Guest » Fri Dec 05, 2014 10:50 am

"Access to an object's fields is only permitted within its methods." --It seems you have syntax an error.
You may go through the demo steps carefully without any modification.
Guest
 


Return to DAVID Web Services

Who is online

Users browsing this forum: No registered users and 1 guest

cron