curl \
--dump-header header.txt \
--header 'SOAPAction: http://sap.com/xi/WebService/soap1.1' \
--header 'Content-Type: text/xml;charset=UTF-8' \
--output response2.html \
--data-binary @requestfile.xml \
--trace trace.txt \
--write-out "%{http_code} %{http_connect} " \
--insecure \
--proxy proxyhost:port \
--user user:password \
https://host:port/context
#--proxy-ntlm \
#--proxy-user "user:password" \
#--cert ./demo.pem:password \
# soap 1.2
#--header 'Content-Type: application/soap+xml;charset=UTF-8' \
# soap 1.1
#--header 'Content-Type: text/xml;charset=UTF-8' \
#--http1.0 \
*** request payload for soap 1.1 ***
set the namespace accordingly
SOAP 1.1 : http://schemas.xmlsoap.org/soap/envelope/
SOAP 1.2 : http://www.w3.org/2003/05/soap-envelope
Exchange for your payload
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
</soap:Header>
<soap:Body>
<UtilitiesDeviceERPSmartMeterReplicationBulkConfirmation>
<MessageHeader>
<CreationDateTime>2012-09-20T12:35:27.969Z</CreationDateTime>
</MessageHeader>
<UtilitiesDeviceERPSmartMeterReplicationConfirmationMessage>
<MessageHeader>
<CreationDateTime>2012-09-20T12:35:27.974Z</CreationDateTime>
</MessageHeader>
<UtilitiesDevice>
<ID>1234</ID>
</UtilitiesDevice>
<Log></Log>
</UtilitiesDeviceERPSmartMeterReplicationConfirmationMessage>
<Log></Log>
</UtilitiesDeviceERPSmartMeterReplicationBulkConfirmation>
</soap:Body>
</soap:Envelope>
And a vbs script you can use until you have curl
option explicit
'' Makes a httpcall binary clean, and sends data from a file
'' Author: Otto Frost
'' Copyright: Otto Frost
Dim url ' url to send to
Dim file ' file to send, UNC path
url = "http://host:port/context"
''You must code special characters such as forward slash (/), hyphen (-), period (.), or colon (:) with escape characters
''(for example, %2F for /, %2D for -, %2E for .,and %3A for :).
''example
url = "http://www.bisgateway.com/brg/services/NRGDecisionSupportDSC"
file = "soap_request20051219.155753.0.xml"
'' headers have to be changed below this line
Dim strm
Set strm = CreateObject("ADODB.Stream")
'Dim IE As SHDocVw.InternetExplorer
Dim g_oIE 'As InternetExplorer ' Global reference to an
' instance of IE
Set g_oIE = CreateObject("InternetExplorer.Application")
g_oIE.Visible = True
'Private Sub cmdSubmit_Click()
Dim edtPostData
''edtPostData.Text = "" ' Initialize an edit box for testing
Dim aByte
''ReDim aByte(0) 'As Byte ' Array of bytes to hold data to post
' Extract the URL encoded data from the UI,
' and pack it into an array of bytes
''cFlavor = "Orange"
''cParamName = "FName="
''cParamFlavor = "Flavor="
''cSeparator = "&"
''cPostData = cParamName & "F1" & cSeparator & cParamFlavor & cFlavor
''PackBytes aByte, cPostData
strm.Type = 1
strm.Open
strm.Type = 1
strm.LoadFromFile file
''strm.WriteText cPostData
strm.Position = 0
strm.Type = 1
aByte = strm.Read
' For testing, rebuild the POST data and stuff
' it into an edit box
''For i = LBound(aByte) To UBound(aByte)
'' edtPostData = edtPostData + Chr(aByte(i))
''Next
Dim vPost 'As Variant
vPost = aByte ' Assign the byte array to a VARIANT
Dim vFlags 'As Variant
Dim vTarget 'As Variant
Dim vHeaders 'As Variant
vHeaders = "Content-Type: application/x-www-form-urlencoded" + Chr(10) + Chr(13)
vHeaders = "content-type: text/plain; charset=UTF-8" + Chr(10) + Chr(13)
vHeaders = "content-type: text/plain;UTF-8" + Chr(10) + Chr(13)
''vHeaders = "content-type:application/octet-stream" + Chr(10) + Chr(13)
vHeaders = "content-type: application/octet-stream" + Chr(10) + Chr(13)
vHeaders = ""
''vHeaders = "SOAPAction: NRGDecisionSupportDSC" & Chr(10) & Chr(13)
vHeaders = vHeaders & "SOAPAction: NRGDecisionSupportDSC" & Chr(10) & Chr(13)
''vHeaders = vHeaders & "SOAPAction: http://www.dnbnordic.com/brg/NRGDecisionSupportDSC/request" & Chr(10) & Chr(13)
vHeaders = vHeaders & "Content-Type: text/xml" & Chr(10) & Chr(13)
''Content-Length: nnnn
''Content-Encoding: gzip
''Content-Type: image/gif
''Content-Type: text/html; charset=ISO-8859-4
''Transfer-Encoding: chunked
' You're done. Now call Navigate
' Note: modify path to server as appropriate
g_oIE.Navigate url, vFlags, vTarget, vPost, vHeaders
' Private Sub Form_Load()
' Create an instance of IE
' Set g_oIE = New InternetExplorer
' g_oIE.Visible = True
' Populate a combobox with some flavor choices
' cboFlavor.List(0) = "Vanilla"
' cboFlavor.List(1) = "Chocolate"
' cboFlavor.List(2) = "Strawberry"
' cboFlavor.ListIndex = 0 ' The default choice
' End Sub
' Utility function to pack the data to post into an array of bytes
'Sub PackBytes(ByteArray() As Byte, ByVal PostData As String)
Sub PackBytes(ByteArray() , ByVal PostData )
iNewBytes = Len(PostData) - 1 ' Get rid of the null termination
If iNewBytes < 0 Then
Exit Sub
End If
ReDim ByteArray(iNewBytes)
For i = 0 To iNewBytes
ch = Mid(PostData, i + 1, 1)
If ch = Space(1) Then
ch = "+"
End If
ByteArray(i) = Asc(ch)
Next
End Sub