Classic asp Soap response with xml and attachment
-
Hi, The soap request is sent using set objReturn = Server.CreateObject("Msxml2.DOMDocument") set objHTTP = server.CreateObject("Msxml2.ServerXMLHTTP") objHTTP.setTimeouts lResolve, lConnect, lSend, lReceive objHTTP.open "POST", strURL, False on error resume next objHTTP.setRequestHeader "Content-Type", "text/xml; charset=UTF-8" objHTTP.setRequestHeader "Content-Disposition", "attachment;filename=""PDFTEST.pdf""" objHTTP.send strXML The response I get is per below in binary ------=_Part_97_1242713853.1455190897041 Content-Type: text/xml; charset=utf-8
****XML related document****
------=_Part_97_1242713853.1455190897041
Content-Type: application/pdf
****PDF related document****I could output into text using below function Binary to String function Function BinaryToString(Binary) Dim I, S For I = 1 To LenB(Binary) S = S & Chr(AscB(MidB(Binary, I, 1))) Next BinaryToString = S End Function The request Attachment is read like below: '--- attachments ---' 'Create Datastream object to save the file set DataStream = CreateObject("ADODB.Stream") 'Open Datastream DataStream.Open 'Set type to binary DataStream.Type = 1 'Create bianry datastream of the file DataStream.Write objHTTP.ResponseBody 'strReturnfile DataStream.Position = 0 'Set the File System Object, so we can check to see if it already exists. set FSO = Createobject("Scripting.FileSystemObject") 'If the file already exists, delete it if FSO.FileExists(SaveAsFile) then Fso.DeleteFile SaveAsFile End If set FSO = Nothing 'Write the file to the location on the server DataStream.SaveToFile SaveAsFile 'Close Datastream DataStream.Close 'Delete Datastream object set DataStream = Nothing '--- attachments end---' Now my problem is I need to just read XML using loadXML() Can anyone please help as I have spent few days and really lost. Thanks
-
Hi, The soap request is sent using set objReturn = Server.CreateObject("Msxml2.DOMDocument") set objHTTP = server.CreateObject("Msxml2.ServerXMLHTTP") objHTTP.setTimeouts lResolve, lConnect, lSend, lReceive objHTTP.open "POST", strURL, False on error resume next objHTTP.setRequestHeader "Content-Type", "text/xml; charset=UTF-8" objHTTP.setRequestHeader "Content-Disposition", "attachment;filename=""PDFTEST.pdf""" objHTTP.send strXML The response I get is per below in binary ------=_Part_97_1242713853.1455190897041 Content-Type: text/xml; charset=utf-8
****XML related document****
------=_Part_97_1242713853.1455190897041
Content-Type: application/pdf
****PDF related document****I could output into text using below function Binary to String function Function BinaryToString(Binary) Dim I, S For I = 1 To LenB(Binary) S = S & Chr(AscB(MidB(Binary, I, 1))) Next BinaryToString = S End Function The request Attachment is read like below: '--- attachments ---' 'Create Datastream object to save the file set DataStream = CreateObject("ADODB.Stream") 'Open Datastream DataStream.Open 'Set type to binary DataStream.Type = 1 'Create bianry datastream of the file DataStream.Write objHTTP.ResponseBody 'strReturnfile DataStream.Position = 0 'Set the File System Object, so we can check to see if it already exists. set FSO = Createobject("Scripting.FileSystemObject") 'If the file already exists, delete it if FSO.FileExists(SaveAsFile) then Fso.DeleteFile SaveAsFile End If set FSO = Nothing 'Write the file to the location on the server DataStream.SaveToFile SaveAsFile 'Close Datastream DataStream.Close 'Delete Datastream object set DataStream = Nothing '--- attachments end---' Now my problem is I need to just read XML using loadXML() Can anyone please help as I have spent few days and really lost. Thanks
-
how to know the following website feed url plz tell me any one? jobtodayinfo
-
how to know the following website feed url plz tell me any one? jobtodayinfo Give any one answer...