Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Classic asp Soap response with xml and attachment

Classic asp Soap response with xml and attachment

Scheduled Pinned Locked Moved Web Development
helpxmlwcfsysadmincareer
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    uglyeyes
    wrote on last edited by
    #1

    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

    U 1 Reply Last reply
    0
    • U uglyeyes

      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

      U Offline
      U Offline
      uglyeyes
      wrote on last edited by
      #2

      anyone?

      U U 3 Replies Last reply
      0
      • U uglyeyes

        anyone?

        U Offline
        U Offline
        User 12291181
        wrote on last edited by
        #3

        how to know the following website feed url plz tell me any one? jobtodayinfo

        1 Reply Last reply
        0
        • U uglyeyes

          anyone?

          U Offline
          U Offline
          User 12291181
          wrote on last edited by
          #4

          how to know the following website feed url plz tell me any one? jobtodayinfo Give any one answer...

          1 Reply Last reply
          0
          • U uglyeyes

            anyone?

            U Offline
            U Offline
            uglyeyes
            wrote on last edited by
            #5

            I had to save the stream to file, do some string manipulation and just resave the file with xml only. it worked!.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups