Sub GetImg(ByVal strUrl As String, ByVal XmlBody As String) Dim objDom As Object Dim objXmlHttp As Object Dim strRet As String Dim aRes() As Byte, fn As Integer ' Create objects to DOMDocument and XMLHTTP Set objDom = CreateObject("MSXML2.DOMDocument") Set objXmlHttp = CreateObject("MSXML2.XMLHTTP") ' Load XML objDom.async = False objDom.loadXML XmlBody ' Open the webservice objXmlHttp.Open "POST", strUrl, False ' Create headings objXmlHttp.setRequestHeader "Content-Type", "image/jpeg" objXmlHttp.setRequestHeader "Content-Length", Len(XmlBody) ' Send XML command objXmlHttp.send objDom.xml ' Get all response text from webservice strRet = objXmlHttp.responseText ' Get image aRes = objXmlHttp.responseBody fn = FreeFile Open "a.jpg" For Binary As fn Put fn, , aRes Close fn ' Close objects Set objXmlHttp = Nothing Set objDom = Nothing End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)