cloud9ine Posted December 15, 2008 Share Posted December 15, 2008 I tried changing the getsinglenode parameters and seems to work. I am now trying to use NDFDgen function from http://www.weather.gov/forecasts/xml/DWMLg...dl/ndfdXML.wsdl . I keep hitting a Type Mismatch error. Any idea how to pass the array of boolean parameters correctly? Link to comment Share on other sites More sharing options...
ptrex Posted December 15, 2008 Author Share Posted December 15, 2008 @cloud9ine this will get you going for the stock nodes. $CollectionNodes = $oXmlDoc.SelectNodes("StockQuotes/Stock") For $oNodes in $CollectionNodes $Symbol = $oNodes.SelectSingleNode("Symbol").text $Last = $oNodes.SelectSingleNode("Last").text $Date = $oNodes.SelectSingleNode("Date").text $Time = $oNodes.SelectSingleNode("Time").text $Change = $oNodes.SelectSingleNode("Change").text $Open = $oNodes.SelectSingleNode("Open").text $High = $oNodes.SelectSingleNode("High").text $Low = $oNodes.SelectSingleNode("Low").text ConsoleWrite($Symbol & @CRLF & $Last & @CRLF & $Date & @CRLF & $Time & @CRLF & $Change & @CRLF & $Open & @CRLF & $High & @CRLF & $Low & @CRLF) Next regarding the weather Web Servive, without code it's hard to guess what's going on. regards 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...
cloud9ine Posted December 15, 2008 Share Posted December 15, 2008 ptrex,Thanks for the help on that. I will use the same format to get my data out as well. Here is some code on the weather that I am doing.CODEDim $oMyError, $xmlFile, $oNode, $strReturn, $objReq$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")$xmlDoc= ObjCreate("Msxml2.DOMdocument.3.0")$SOAPClient = ObjCreate("MSSOAP.SOAPClient")$SOAPClient.mssoapinit ("http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl")$strReturn = $SOAPClient.LatLonListCityNames("1234");The LatLonList function is the simplest from http://www.weather.gov/xml/#use_it which is why I chose it to start.The real function I will try will be ndfdgenbyday which has as its last parameter, an array of boolean variables. I am already getting a Type Mismatch with the above, however I use it. The guide page says the parameter is integer, but the schema defines it as a string. However I try, I still get a type mismatch.Thanks for all the help. Link to comment Share on other sites More sharing options...
ptrex Posted December 16, 2008 Author Share Posted December 16, 2008 @cloud9ineIf you run this code then you get an error relating to the DISPLAY level.Type conversion failure for element displayLevelThis means propably that it needs relating parameters which are not correctly set when launching the code.Try filling in all parameters needed to get the output from the web service.Regardsptrex 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...
cloud9ine Posted December 16, 2008 Share Posted December 16, 2008 Thanks. Here is the sample soap request from the NDFD website CODE<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> − <SOAP-ENV:Body> − <ns9309:LatLonListCityNames> <displayLevel xsi:type="xsd:string">1</displayLevel> </ns9309:LatLonListCityNames> </SOAP-ENV:Body> </SOAP-ENV:Envelope> I am pretty sure displayLevel is the only thing I need to pass but I think I am not passing it right. Is there a way to specify that the parameter I am specifying is the displayLevel? I am sure I did not miss any parameters. Link to comment Share on other sites More sharing options...
tr1px Posted November 12, 2009 Share Posted November 12, 2009 (edited) Some one ask if someone would be nice enough to post how to do this with php so here is an example. > Below is the code for the webservice server written in PHP expandcollapse popup<?php require('fns.system.php'); require('classes/nusoap.php'); // soap classes i use these so i do not need any extra c extensions on my linux server // this function pulls data from a table in mysql // i actually went to yahoo finance and pulled Google Stock History for this // ## google stock history monthly function getSOAPInfo($date) { // date format 2009-01-01 yyyy-mm-dd $db = dblink(); if($sqlResult = mysql_query("SELECT * FROM googlestockhistory WHERE Date = '".$date."'")) { $sqlRows = mysql_numrows($sqlResult); } else { $sqlRows = 0; } if($sqlRows == 0 || $sqlRows != 1) { mysql_close($db); return 0.00; } else { $sqlRow = mysql_fetch_assoc($sqlResult); mysql_close($db); return $sqlRow['Close']; } } // Call the nusoap class and create a soap server $server = new soap_server(); // tell the server what we are called $server->configureWSDL('stockserver', 'urn:stockquote'); $server->register("getSOAPInfo", array('date' => 'xsd:string'), array('return' => 'xsd:decimal'), 'urn:stockquote', 'urn:stockquote#getSOAPInfo'); $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; $server->service($HTTP_RAW_POST_DATA); ?> > Now below here is the client querying the server Dim $xmlDoc, $SOAPClient, $strReturn, $date $date = InputBox("Enter the Date","Use the format 2008-mm-01 replacing the mm.") $SOAPClient = ObjCreate("MSSOAP.SOAPClient") $SOAPClient.mssoapinit("http://yourwebserver.com/webservice.php?wsdl") $strReturn = $SOAPClient.getSOAPInfo($date) MsgBox(0,"Answer", $strReturn) I hope this helps someone. Just customize the code. This should be a good enough foundation for your other apps since it is mine. Edited November 12, 2009 by tr1px Link to comment Share on other sites More sharing options...
ptrex Posted November 26, 2009 Author Share Posted November 26, 2009 (edited) @tr1px Thanks for the example. Since the beginning of this post about SOAP (2007). MS has done a lot of efforts to offer a good webservice framework, which is part of the DotNet framework. This means you don't need anything additional if you have Windows & IIS. Here is a simple example of a webservice, which you can use together with a SOAP client in AU3. Save this in a file called WS_HelloWorld.asmx and copy it to a location on your IIS. <%@ WebService Language="c#" Class="FirstWebService" %> using System; using System.Web; using System.Web.Services; public class FirstWebService { [WebMethod] public string HelloWorld(string lcName) { return "Hello World, " + lcName; } [WebMethod] public decimal AddNumbers(decimal lnNumber1, decimal lnNumber2) { return lnNumber1 + lnNumber2; } /* [WebMethod] public DateTime GetServerTime() { return DateTime.Now; } */ } Next run the client to access the exposed objects over the web. expandcollapse popup; http://www.w3schools.com/webservices/ws_example.asp Dim $oMyError $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Dim $SOAPClient $SOAPClient = ObjCreate("MSSOAP.SOAPClient30") $SOAPClient.mssoapinit("http://localhost/Webservice/WS_HelloWorld.asmx?wsdl") If @error <> 0 then ConsoleWrite( $SOAPClient.faultString & @CRLF) ConsoleWrite( $SOAPClient.faultcode & @CRLF) ConsoleWrite( $SOAPClient.faultactor & @CRLF) ConsoleWrite( $SOAPClient.FaultCodeNamespace & @CRLF) ConsoleWrite( $SOAPClient.detail & @CRLF) Endif ConsoleWrite($SOAPClient.HelloWorld("Regards from AU3") & @CRLF) If @error <> 0 then ConsoleWrite( $SOAPClient.faultString & @CRLF) ConsoleWrite( $SOAPClient.faultcode & @CRLF) ConsoleWrite( $SOAPClient.faultactor & @CRLF) ConsoleWrite( $SOAPClient.FaultCodeNamespace & @CRLF) ConsoleWrite( $SOAPClient.detail & @CRLF) Endif ;This is COM error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc This is all you need, quite simple compared to the SOAP 3.0 Toolkit approach. Rgds, ptrex Edited November 26, 2009 by 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...
bonzo Posted February 10, 2010 Share Posted February 10, 2010 @tr1px Thanks for the example. Since the beginning of this post about SOAP (2007). MS has done a lot of efforts to offer a good webservice framework, which is part of the DotNet framework. This means you don't need anything additional if you have Windows & IIS. @ptrex I'm attempting to connect and get results from the EU VAT web service to check VAT numbers. It's located here: http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl I'm using your great example with SOAPClient30. At least it's not too complex anymore for me But I keep on getting COM errors that the parameters are incorrect. This is what I'm doing: Dim $SOAPClient $SOAPClient = ObjCreate("MSSOAP.SOAPClient30") $SOAPClient.mssoapinit("http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl", "", "", "") ConsoleWrite($SOAPClient.CheckVat('GB', '0000000000')) ;this is the VAT number to be checked whether it's valid I checked the WSDL file and it looks like it asks for 2 string parameters: countryCode and vatNumber Do you have an idea what's wrong? Link to comment Share on other sites More sharing options...
ptrex Posted February 12, 2010 Author Share Posted February 12, 2010 @bonzoThis is the error that comes back when trying your code :Client:Incorrect number of parameters supplied for SOAP request HRESULT=0x80070057: The parameter is incorrect. - Client:Unspecified client error. HRESULT=0x80070057: The parameter is incorrect.I did a quick look on Google and there seem to many people suffering with the same problem using this webservice.So I am not sure how reliable this is ?If you find the solution let us know.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...
bonzo Posted February 13, 2010 Share Posted February 13, 2010 @bonzoThis is the error that comes back when trying your code :I did a quick look on Google and there seem to many people suffering with the same problem using this webservice.So I am not sure how reliable this is ?If you find the solution let us know.Rgds,ptrexI noticed the problems that others have too. It looks like the wsdl is too complex? One function even asks for 21 parameters. But some managed to write a client under asp/php.Thanks for your findings, I'll research further how to tackle this one. Link to comment Share on other sites More sharing options...
janneman Posted June 20, 2010 Share Posted June 20, 2010 I notice that all the SOAP client examples in this thread are based on Microsoft's "soap toolkit". MSSOAP.SOAPClient, MSOSoap.SoapSerializer30, MSOSOAP.SoapReader30, all of that is SOAP toolkit. Which unfortunately has been obsolete for many years now. I have working examples that are not based on the soap toolkit, but they are ugly - adapted from vbscript samples with a hand-built soap envelope. Does anybody have soap client examples not based on SOAP toolkit? Link to comment Share on other sites More sharing options...
ICANSEEYOU7687 Posted May 13, 2011 Share Posted May 13, 2011 I believe I am doing something incorrectly, when I run the client .exe, it says to "input a new value here." The default is 10, and when I hit ok, I recieve, "The Sales Tax is : " and its just blank. I have SOAP.asp in the root of my webserver, and if I try to load it in a browser I simply get "An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error." I believe im just being really dumb, but any help? thanks Link to comment Share on other sites More sharing options...
ptrex Posted May 14, 2011 Author Share Posted May 14, 2011 @ ICANSEEYOU7687 Like said in the previous post, this technology is a dead end. So no use in trying. Best switch over to DotNet for this. 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...
daluu Posted July 11, 2011 Share Posted July 11, 2011 (edited) Hmm...would be nice to have a web service/server done or integrated with AutoIt standalone w/o need of web server stuff (e.g. IIS, ASP, ASP.NET, PHP, etc.). But that likely isn't possible unless there is a COM server version of SOAP, XML-RPC, HTTP, etc. Next best alternative, at least for those who use AutoIt just for GUI automation, would be to use some other platform that has standalone web services/server support (.NET, Perl, Java, Python, Ruby, etc.) and call AutoIt from there (via COM, DLL call, or shell execute). By the way, what I mean by this usage is to drive AutoIt functionality as a server rather than a client. A client makes call to AutoIt server (over web service) to make AutoIt do something. For example, GUI automation, though other people may have other things in mind besides that. Edited July 11, 2011 by daluu Link to comment Share on other sites More sharing options...
vortexed Posted January 13, 2014 Share Posted January 13, 2014 (edited) This is a great topic. i recently created a client/server tool the only thing that was lacking was the server. As i relied on windows file sharing to deliver content from and to the client - there was no server side autoit tool listening for any requests. However this implementation doesn't scale very well. My next milestone would be to do this over SOAP/HTML/XMLHTTP/SUGGESTIONS???. As a prior poster commented it would be nice to do away with the need for server side utilities like PHP/IIS. Perhaps a compiled autoit app that was listening on a TCP port (server side) then have the clients connect to this TCP port? Does anyone have an article that mentions why SOAP is no longer supported? Maybe I read it wrong but I have been hearing about SOAP for a long time! Edited January 13, 2014 by vortexed Link to comment Share on other sites More sharing options...
LWC Posted November 28, 2014 Share Posted November 28, 2014 Does anyone know the code to open up router ports >using SOAP? Link to comment Share on other sites More sharing options...
maniootek Posted November 29, 2014 Share Posted November 29, 2014 (edited) I am trying to connect with my shipping company API to get some information about my shipping. They provide documentation with examples written in PHP. Please take a look into script I got now: <?php $wsKey = '02f7skdzL6IU84PLHPOuiiNa1KAg1KC3'; $params = array( 'wsKey' => $wsKey, 'NumeryPrzesylek' => array('226340656')); $wsdl = "http://kurier.k-ex.pl/api/ws_soap.php?wsdl"; $client = new SoapClient($wsdl); $result = $client->PobierzDaneTrackingowe($params); $status = $result->DaneTrackingoweLista->DaneTrackingowe->Status; echo $status ?> This code connect with API using my unique key ($wsKey) with their server ($wsdl). It will return information about shipping numer 236340646. I want to get same results with AutoIt as I am more familiar with this envoirment than PHP. Anyone has any idea? Edited December 2, 2014 by maniootek Link to comment Share on other sites More sharing options...
maniootek Posted March 27, 2015 Share Posted March 27, 2015 (edited) I tried your code Dim $oMyError, $xmlFile, $oNode, $strReturn, $objReq $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $xmlDoc= ObjCreate("Msxml2.DOMdocument.3.0") $SOAPClient = objcreate("MSSOAP.SOAPClient") $SOAPClient.mssoapinit ("<a href='http://www.webservicex.net/stockquote.asmx?WSDL' class='bbc_url' title='External link' rel='nofollow external'>http://www.webservicex.net/stockquote.asmx?WSDL"</a>) $strReturn = $SOAPClient.GetQuote("MSFT") ConsoleWrite( "MSFT : " & $strReturn & @CRLF & @CRLF) $xmlDoc.loadXML ($strReturn) $oNode = $xmlDoc.selectSingleNode("StockQuotes") ConsoleWrite($oNode.text & @CRLF & @CRLF) ;This is COM error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc and received few errors (see attachments) Any idea what's wrong? Did I miss to install anything? Edited March 27, 2015 by maniootek Link to comment Share on other sites More sharing options...
ptrex Posted March 27, 2015 Author Share Posted March 27, 2015 @maniootek, First of all this is an old post, +5 years old The consequence is that the Web Services technology has evolved quite a lot in the meantime. Regarding your issues. In order to run your example you need the SOAP.CLIENT library installed from MS called SOAP Toolkit 3.0 Which they have depreciated but still works for simple examples. I guess the latest version is here http://www.microsoft.com/en-us/download/details.aspx?id=15489 You need to download and install it first. This worked still for me after so many year expandcollapse popup#AutoIt3Wrapper_UseX64=N #include <Array.au3> Local $oMyError Local $Return1, $Return2, $Return3 Local $Rates[5] = ["EUR","USD","CAD","AUD", "ZAR"] $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $SOAPClient = ObjCreate("MSSOAP.SoapClient30") $SOAPClient.mssoapinit("http://www.webservicex.net/CurrencyConvertor.asmx?wsdl") If @error <> 0 then ConsoleWrite( $SOAPClient.faultString & @CRLF) ConsoleWrite( $SOAPClient.faultcode & @CRLF) ConsoleWrite( $SOAPClient.faultactor & @CRLF) ConsoleWrite( $SOAPClient.FaultCodeNamespace & @CRLF) ConsoleWrite( $SOAPClient.detail & @CRLF) Endif $Return1 = $SOAPClient.ConversionRate($Rates[0],$Rates[1]) $Return2 = $SOAPClient.ConversionRate($Rates[0],$Rates[2]) $Return3 = $SOAPClient.ConversionRate($Rates[0],$Rates[3]) $Return4 = $SOAPClient.ConversionRate($Rates[0],$Rates[4]) If @error <> 0 then ConsoleWrite( $SOAPClient.faultString & @CRLF) ConsoleWrite( $SOAPClient.faultcode & @CRLF) ConsoleWrite( $SOAPClient.faultactor & @CRLF) ConsoleWrite( $SOAPClient.FaultCodeNamespace & @CRLF) ConsoleWrite( $SOAPClient.detail & @CRLF) Endif ConsoleWrite(@CRLF) ConsoleWrite("EUR / USD = " & 1 / $Return1 & @CRLF & @CRLF) ConsoleWrite("EUR / CAD = " & 1 / $Return2 & @CRLF & @CRLF) ConsoleWrite("EUR / AUD = " & 1 / $Return3 & @CRLF & @CRLF) ConsoleWrite("EUR / ZAR = " & 1 / $Return4 & @CRLF & @CRLF) ;This is COM error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc 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...
ptrex Posted March 27, 2015 Author Share Posted March 27, 2015 (edited) @all Better is to switch over the plain XML Soap Envelopes instead. This is a working example : expandcollapse popup#AutoIt3Wrapper_UseX64=N local $objHTTP local $strEnvelope local $strReturn local $objReturn local $strQuery local $strValue $strValue = InputBox("Testing", "Enter your new value here.", 60007) ; Initialize COM error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $objHTTP = ObjCreate("Microsoft.XMLHTTP") $objReturn = ObjCreate("Msxml2.DOMDocument.3.0") ; Create the SOAP Envelope $strEnvelope = '<?xml version="1.0" encoding="utf-8"?>' & _ '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' & _ '<soap:Body>' & _ '<GetInfoByZIP xmlns="http://www.webserviceX.NET">' & _ '<USZip>'&$strValue&'</USZip>' & _ '</GetInfoByZIP>' & _ '</soap:Body>' & _ '</soap:Envelope>' ; Set up to post to the server $objHTTP.open ("post", "http://www.webservicex.net/uszip.asmx?op=GetInfoByZIP", False) ; Set a standard SOAP/ XML header for the content-type $objHTTP.setRequestHeader ("Content-Type", "text/xml") ConsoleWrite("Content of the Soap envelope : "& @CR & $strEnvelope & @CR & @CR) ; Make the SOAP call $objHTTP.send ($strEnvelope) ; Get the return envelope $strReturn = $objHTTP.responseText ConsoleWrite("-----------" & @CRLF) ConsoleWrite ("Debug Response : "& @CR & $strReturn & @CR & @CR) ConsoleWrite("-----------" & @CRLF) ; Load the return envelope into a DOM $objReturn.loadXML ($strReturn) ConsoleWrite("Return of the SOAP Msg : " & @CR & @CR & $objReturn.XML & @CR & @CR) ; Query the return envelope $strQuery = "SOAP:Envelope/SOAP:Body" $objReturn.selectSingleNode($strQuery) $Soap = $objReturn.Text MsgBox(0,"SOAP Response","The Response is : " & $Soap) Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) Endfunc Hope this helps rgds ptrex Edited March 27, 2015 by ptrex mLipok 1 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...
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