Hi There,
I want to use HTTP on power automate to post a request and get a response from a system.
I'm using Excel VBA macro all this time to POST and get a response from one of the BMC ITSM System.
The POST request is in the TEXT/XML format and the response I get is in TEXT/XML.
Can someone please advise/help me as to how can I use the same values from the VBA code and put it on HTTP connector (Power automate) ???
Below is the VBA code using POST and the request body in TEXT/XML format.
VBA CODE (POST Method)
Sub GetTickets()
Dim myHTTP As New MSXML2.XMLHTTP60
Dim myDom As New MSXML2.DOMDocument60
Dim myXML As String
Dim myServer As String
''myDom.LoadXML (myXML)
myDom.Load "C:\Users\pingalir\Downloads\Saopui\GetTicket.xml"
myServer = "https://XXXXX.####.com/arsys/services/ARService?server=onbmc-s&webService=HPD_IncidentInterface_WS"
myHTTP.Open "POST", myServer, False
myHTTP.setRequestHeader "SoapAction", "HPD_IncidentInterface_WS"
myHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
myHTTP.send (myDom.XML)
MsgBox myHTTP.responseText
End Sub
Below is the myDom Load file has the body of the request :
<?xml version="1.0"?>
-<soapenv:Envelope xmlns:urn="urn:HPD_IncidentInterface_WS" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
-<soapenv:Header>
-<urn:AuthenticationInfo>
<urn:userName>UserNameXXX</urn:userName>
<urn:password>PasswordXXX</urn:password>
</urn:AuthenticationInfo>
</soapenv:Header>
-<soapenv:Body>
-<urn:HelpDesk_Query_Service>
<urn:Incident_Number>INC00001234567</urn:Incident_Number>
</urn:HelpDesk_Query_Service>
</soapenv:Body>
</soapenv:Envelope>