Posting XML To HTTPS

4 vues (au cours des 30 derniers jours)
Christopher Eirich
Christopher Eirich le 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?

Réponses (1)

Guillaume
Guillaume le 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

Catégories

En savoir plus sur Call Web Services from MATLAB Using HTTP dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by