Posting XML To HTTPS

1 view (last 30 days)
Christopher Eirich
Christopher Eirich on 19 Mar 2015
Answered: Guillaume on 19 Mar 2015
Good afternoon,
I am looking to query a private web server by uploading an XML request and reading the XML response. In VBA I use code similar to this:
Dim oWinhttp As WinHttpRequest
Set oWinhttp = New WinHttpRequest
Dim result As Variant
With oWinhttp
Call .SetTimeouts(300000, 300000, 300000, 300000)
Call .Open("POST", "https://xml.service.com/comm/xml/submit")
Call .SetCredentials("username", "password", 0)
Call .SetRequestHeader("POST", "/comm/xml/submit HTTP/1.1")
Call .SetRequestHeader("HOST", "xmltrn.xml.com")
Call .SetRequestHeader("Content-Type", "text/xml")
Call .SetRequestHeader("Content-Length", Len(sXML))
Call .SetRequestHeader("SOAPAction", "/comm/xml/submit")
Call .Send(sXML)
'Wait for the response asynchronously.
Call .WaitForResponse
result = .ResponseText
Where sXML contains the XML file to be submitted.
Is there any way to perform this operation easily from MatLab?

Answers (1)

Guillaume
Guillaume on 19 Mar 2015
If you're on the latest version of matlab (2015a), then I believe webwrite will do exactly the same.
In older versions of matlab, I don't believe there's anything, but you could always delegate to java or .Net

Products

Community Treasure Hunt

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

Start Hunting!