Posting XML To HTTPS

3 Ansichten (letzte 30 Tage)
Christopher Eirich
Christopher Eirich am 19 Mär. 2015
Beantwortet: Guillaume am 19 Mär. 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?

Antworten (1)

Guillaume
Guillaume am 19 Mär. 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

Kategorien

Mehr zu Call Web Services from MATLAB Using HTTP finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by