Jump to content

Search the Community

Showing results for tags 'webservices'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hello First i want to say that most of my problems i can solve while scripting by looking at the forum or in the help file but im stuck on this specific problem. I have been writing scripts to consume Web services and this works fine when its just plain XML responses. I work on a project now where i need to consume a SOAP response with an Attachment. I can make the plain SOAP call and get a response as well but i dont know how to handle the multipart and binary data. I have tried ADODB.Stream to write the data to a file but this just writes everything. I would be very grateful if someone could point me into the right direction. Please find below the Request and the Response i get at the momen $objHTTP = ObjCreate("Microsoft.XMLHTTP") $objReturn = ObjCreate("Msxml2.DOMDocument.3.0") $oDATA=ObjCreate("ADODB.Stream") $strEnvelope = '<?xml version="1.0" encoding="UTF-8"?>' _ '<soapenv:Envelope' _ 'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"' _ 'xmlns:xsd="http://www.w3.org/2001/XMLSchema"' _ 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' _ '<soapenv:Body>' _ '<ns1:getStorageAccessTicket' _ 'soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"' _ 'xmlns:ns1="NBRStorageService">' _ '<siteId xsi:type="xsd:long">123456</siteId>' _ '<username xsi:type="xsd:string">USERNAME</username>' _ '<password xsi:type="xsd:string">PASSWORD</password>' _ '</ns1:getStorageAccessTicket>' _ '</soapenv:Body>' '</soapenv:Envelope>' _ ; Set up to post to the server $objHTTP.open ("post", "API end point" , False) ; Set a standard SOAP/ XML header for the content-type $objHTTP.setRequestHeader ("Content-Type", "application/xml") ; Set a header for the method to be called $objHTTP.setRequestHeader ("SOAPAction", 'getStorageAccessTicket') ConsoleWrite("Content of the Soap envelope :" & @CR & $strEnvelope & @CR & @CR ) ; Make the SOAP call $objHTTP.send ($strEnvelope) ; Get the return envelope $strReturn = $objHTTP.responsetext With $oDATA .Type=1 .Open .Write($objHTTP.ResponseBody) .SaveToFile(@ScriptDir&'\captcha.arf', 2) .Close EndWith EndFunc RESPONSE: '------=_Part_5_987625235.1444159091234' 'Content-Type: text/xml; charset=UTF-8' 'Content-Transfer-Encoding: binary' 'Content-Id: <DF72463F6FAFE80B930059E761DF7225>' '<?xml version="1.0" encoding="UTF-8"?>' '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' '<soapenv:Body>' '<ns1:downloadNBRStorageFileResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="NBRStorageService">' '<ns1:downloadNBRStorageFileReturn xsi:type="soapenc:Array" soapenc:arrayType="ns1:DataHandler[2]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">' '<item href="cid:FE782065C11E6558C9C8925EBE3D687F"/>' '<item href="cid:3CF0B37E4C5932A3E60EBA5226CFC30A"/>' '</ns1:downloadNBRStorageFileReturn>' '</ns1:downloadNBRStorageFileResponse>' '</soapenv:Body>' '</soapenv:Envelope>' ------=_Part_5_987625235.1444159091234 Content-Type: application/octet-stream Content-Transfer-Encoding: binary Content-Id: <FE782065C11E6558C9C8925EBE3D687F> Attachment.arf 2342371 false ------=_Part_5_987625235.1444159091234 Content-Type: application/octet-stream Content-Transfer-Encoding: binary Content-Id: <3CF0B37E4C5932A3E60EBA5226CFC30A>
×
×
  • Create New...