Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7545275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:53:08+00:00 2026-05-30T08:53:08+00:00

I am trying to use a Web Service in Matlab but I have a

  • 0

I am trying to use a Web Service in Matlab but I have a problem.

The webservice sends a cookie for authentication which matlab ignores.
The matlab function callSoapService uses this java code:

url = URL(endpoint);
if isempty(proxy)
    httpConn = url.openConnection;
else
    httpConn = url.openConnection(proxy);
end
httpConn.setRequestProperty('Content-Type','text/xml; charset=utf-8');
httpConn.setRequestProperty('SOAPAction',soapAction);
httpConn.setRequestMethod('POST');
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
outputStream = httpConn.getOutputStream;
outputStream.write(b);
outputStream.close;
inputStream = httpConn.getInputStream;
byteArrayOutputStream = java.io.ByteArrayOutputStream;
isc = InterruptibleStreamCopier.getInterruptibleStreamCopier;
isc.copyStream(inputStream,byteArrayOutputStream);
inputStream.close;
byteArrayOutputStream.close;
resp = byteArrayOutputStream.toString('UTF-8');

If I write httpConn.getHeaderFields() it returns an empty list, instead of the headers with the cookie. Any idea?
In the java documentation it says you should call httpConn.connect() and Matlab does not do that, I added that line somewhere in the code just to try, but it didnt work lol

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:53:10+00:00Added an answer on May 30, 2026 at 8:53 am

    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.browser file and put it in the App_Browsers directory. I redeployed the application and it worked! ASP.Net sends the cookie to Matlab.

    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 reported this issue to matlab: http://www.mathworks.com/support/service_requests/Service_Request_Detail.do?row_id=1-GQMEDO

    http://msdn.microsoft.com/en-us/library/system.web.httpbrowsercapabilities.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Reducisaurus Web Service to minify CSS and Javascript but I've
I've been trying to use a Web Service which has the WSDL file below.
I am trying to use wsdl2objc with this soap web service. But when am
I was trying to use secure web service URL in my WP7 Application but
We have an android application that we're trying to use for web-service communication. We
I'm trying to use log4j to handle the logs for a web-service which is
I am trying to use a third party web service which is exposed through
I'm trying to use a web service REST API for which I need to
I'm trying to use the API of a web service provider. They don't have
I am trying to use SharePoint Web service to retrieve list changes but there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.