GregThompson Posted March 7, 2010 Share Posted March 7, 2010 Does anyone have any current, working examples of using AutoIT and working with SOAP/WSDL? I swear I have read EVERYTHING on these forums and tried various things I've found, even just basic basic basic examples... I can't get ANYTHING to work... ? What am I missing out on, I have a basic understanding of the SOAP, and I've been using AutoIT forever... so it's not for a lack of knowledge and I don't even ask for help all that often... I'm juts stumped. Link to comment Share on other sites More sharing options...
GregThompson Posted March 8, 2010 Author Share Posted March 8, 2010 (edited) Here's an example of what I need to send... currently I'm using the SoapUI program and it works great, but now to get it into AutoIT.. ??? POST http://not.telling.net/UDSM_R11_WebService/mod_gsoap.dll HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "" User-Agent: Jakarta Commons-HttpClient/3.1 Host: not.telling.net Content-Length: 403 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:r11="urn://www.ca.com/Unicenter/DSM/r11"> <soapenv:Header/> <soapenv:Body> <r11:Login> <r11:userName>winnt://nope/whatever</r11:userName> <r11:password>riiiiiight</r11:password> <r11:manager>not-telling</r11:manager> </r11:Login> </soapenv:Body> </soapenv:Envelope> Edited March 8, 2010 by GregThompson Link to comment Share on other sites More sharing options...
GregThompson Posted March 8, 2010 Author Share Posted March 8, 2010 I've looked into the XMLDomWrapper... is that even a viable solution to soap post/get and the whole thing? Link to comment Share on other sites More sharing options...
doudou Posted March 8, 2010 Share Posted March 8, 2010 Download and install MS SOAP Toolkit (google it up). Then try this: Dim $SOAPClient $SOAPClient = ObjCreate("MSSOAP.SOAPClient") $SOAPClient.mssoapinit("http://www.webservicex.net/country.asmx?wsdl") If @error then ConsoleWrite($SOAPClient.faultString) ConsoleWrite($SOAPClient.detail) Endif Dim $cl = $SOAPClient.GetCountries() $cl = StringReplace($cl, "<" , "<") $cl = StringReplace($cl, ">" , ">") Dim $f = FileOpen ("soap-response.xml", 2) FileWrite($f, $cl) FileClose($f) Read toolkit documentation for further details. UDFS & Apps: Spoiler DDEML.au3 - DDE Client + ServerLocalization.au3 - localize your scriptsTLI.au3 - type information on COM objects (TLBINF emulation)TLBAutoEnum.au3 - auto-import of COM constants (enums)AU3Automation - export AU3 scripts via COM interfacesTypeLibInspector - OleView was yesterday Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE Link to comment Share on other sites More sharing options...
ptrex Posted March 9, 2010 Share Posted March 9, 2010 @GregThompson This example in the first post is what you are looking for. http://www.autoitscript.com/forum/index.php?showtopic=45904&st=0#entry342453 @Doudou Your exmaple does not work, because it does not take care to the values returned. Rgds, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
doudou Posted March 9, 2010 Share Posted March 9, 2010 @GregThompsonThis example in the first post is what you are looking for.http://www.autoitscript.com/forum/index.php?showtopic=45904&st=0#entry342453Yeah, why simple if you can do complicated?!Manually establishing SOAP session by fiddling with XML is the last thing you should do, if there is a library for exactly this purpose.@DoudouYour exmaple does not work, because it does not take care to the values returned.Ah? What are you talking about? The sample may lack error handling but it is WORKING and a good start. Have you tried it out at all? Do so before bashing other people who try to help. Ascer 1 UDFS & Apps: Spoiler DDEML.au3 - DDE Client + ServerLocalization.au3 - localize your scriptsTLI.au3 - type information on COM objects (TLBINF emulation)TLBAutoEnum.au3 - auto-import of COM constants (enums)AU3Automation - export AU3 scripts via COM interfacesTypeLibInspector - OleView was yesterday Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE Link to comment Share on other sites More sharing options...
adamchapman Posted December 7, 2013 Share Posted December 7, 2013 @ptrex, Everytime I run the two lines of code below: $SOAPClient = objcreate("MSSOAP.SOAPClient") $SOAPClient.mssoapinit('https://api.betfair.com/global/v3/BFGlobalService.wsdl') I receive an error on the 2nd line: ==> Variable must be of type "Object". I guess the object The SOAP toolkit I downloaded and installed is from http://www.microsoft.com/en-gb/download/details.aspx?id=7043 . I wonder if this is the same version you are using, and if you had to add anything to your classpath in order to get this to run from autoit? I'm running WIndows 7 Home Premium, service pack 1 if that clarifies anything. I you have any ideas to get this running I'd be very grateful Adam Link to comment Share on other sites More sharing options...
water Posted December 7, 2013 Share Posted December 7, 2013 Add a COM error handler for detailed error information. An example can be found in the help file for ObjEvent. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
adamchapman Posted December 7, 2013 Share Posted December 7, 2013 Thanks for the fast response water. I read that the object with version 3.0 of MSSOAP should be called "MSSOAP.SoapClient30", so updated my code and added an error handler: $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") $SOAPClient = ObjCreate("MSSOAP.SoapClient30") $SOAPClient.mssoapinit('http://localhost/Webservice/WS_HelloWorld.asmx?wsdl') #forceref $oErrorHandler, $oIEEvents ; User's COM error function. Will be called if COM error occurs Func _ErrFunc($oError) ; Do anything here. ConsoleWrite("err.number is: " & @TAB & $oError.number & @CRLF & _ "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ "err.description is: " & @TAB & $oError.description & @CRLF & _ "err.source is: " & @TAB & $oError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ "err.retcode is: " & @TAB & $oError.retcode & @CRLF & @CRLF) EndFunc ;==>_ErrFunc the error returned is: err.number is: -2147221005 err.windescription: Invalid class string err.description is: err.source is: err.helpfile is: err.helpcontext is: 15832000 err.lastdllerror is: 1008 err.scriptline is: 5 err.retcode is: 15834960 err.number is: 169 err.windescription: Variable must be of type 'Object'. err.description is: err.source is: err.helpfile is: err.helpcontext is: 15832000 err.lastdllerror is: 0 err.scriptline is: 8 err.retcode is: 15834960 Thanks for taking a look Adam Link to comment Share on other sites More sharing options...
Danp2 Posted December 7, 2013 Share Posted December 7, 2013 I would double check and make sure that your call to ObjCreate was successful before proceeding further. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
adamchapman Posted December 7, 2013 Share Posted December 7, 2013 - The call to "ObjCreate" returned zero, so was unsuccessful Link to comment Share on other sites More sharing options...
water Posted December 7, 2013 Share Posted December 7, 2013 Either installsation of the soap toolkit was not succesfull or the mname of the object is wrong. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
maniootek Posted March 27, 2015 Share Posted March 27, 2015 which SOAP Toolkit should I install to make it works? "SOAP Toolkit for Visual Studio 6.0" from: http://www.microsoft.com/en-gb/download/details.aspx?id=7043 or "SOAP Toolkit 3.0 Software Update" from: http://www.microsoft.com/en-us/download/details.aspx?id=10747 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now