필터 지우기
필터 지우기

Using Web Services with MATLAB Cookie issue

조회 수: 4 (최근 30일)
Fernando
Fernando 2012년 2월 16일
편집: Matt J 2013년 10월 15일
Hi,
I am trying to use the web service http://www.cadec-online.com/API.asmx, but the service uses cookies for authentication and sessions.
Matlab documentation does not say anything about cookies.
Is there anyway to tell Matlab to use cookies?
I am able to use this service in c# really easy:
API.API api = new API.API();
api.CookieContainer = new System.Net.CookieContainer();
api.LogIn("user", "pass");
String[][] ls = api.Laminae();
foreach (String[] l in ls)
{
Console.WriteLine(l[0] + " " + l[1]);
}
api.Logout();
Console.ReadLine();
Note the api.CookieContainer = new System.Net.CookieContainer();, this is the way to tell c# to accept cookies. Is there a way to do that in Matlab?
Best

채택된 답변

Fernando
Fernando 2012년 2월 17일
I found the solution.
ASP.NET was not sending the cookie because the browser capabilities object for the java user agent Mozilla/5.0 (Java 1.6.0_17; Windows 7 6.1 amd64; en_US) ICEbrowser/v6_0_2 returns false in the Cookies field.
I created a new java.broser file and put it in the App_Browsers directory. I redeployed the application and it worked! ASP.Net sends the cookie to Matlab now.
What I had to do next is to modify the Matlab Soap function so it would receive and resend the cookie everytime. I posted the solution to that in http://www.cadec-online.com/Help/API.aspx#Matlab
I will report this issue to Matlab now.
  댓글 수: 1
Fernando
Fernando 2012년 2월 17일
Issue reported http://www.mathworks.com/support/service_requests/Service_Request_Detail.do?row_id=1-GQMEDO

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 2월 16일
  댓글 수: 1
Fernando
Fernando 2012년 2월 16일
Not sure how this is useful, but thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Call Web Services from MATLAB Using HTTP에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by