erezlevi Posted June 6, 2009 Share Posted June 6, 2009 hi, this is the script: expandcollapse popup#include <File.au3> Dim $oMyError $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") dim $SOAPClient $SOAPClient = ObjCreate("MSSOAP.SOAPClient") $R=$SOAPClient.mssoapinit("http://www.webservicex.net/country.asmx?wsdl") if @error then ConsoleWrite( $SOAPClient.faultString) ConsoleWrite( $SOAPClient.detail) Endif ;ConsoleWrite($SOAPClient.GetCurrencyCode()) $M = $SOAPClient.GetCurrencyCode() $J=FileOpen ("c:\erez-test-soap.txt",2) FileWrite ($J,$M) FileClose ($J) $K=FileOpen ("c:\erez-test-soap1.txt",2) FileWrite ($K,$R) FileClose ($K) ShellExecute ("notepad.exe","c:\erez-test-soap.txt") ShellExecute ("notepad.exe","c:\erez-test-soap1.txt") ;FileDelete ("c:\erez-test-soap.txt") if @error then ConsoleWrite($SOAPClient.faultString) ConsoleWrite($SOAPClient.detail) 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 as you see I am trying to get $R=$SOAPClient.mssoapinit("http://www.webservicex.net/country.asmx?wsdl") into $R the WSDL xml data. but it does not work $R is empty, although the second function does work and $M have the data return. I need the wsdl xml data and don't want to use TCPrecv function, can anyone help ? someone named ptrex wrote the original maybe you can help me please? Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 8, 2009 Share Posted June 8, 2009 hi, this is the script: CODE#include <File.au3> Dim $oMyError $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") dim $SOAPClient $SOAPClient = ObjCreate("MSSOAP.SOAPClient") $R=$SOAPClient.mssoapinit("http://www.webservicex.net/country.asmx?wsdl") if @error then ConsoleWrite( $SOAPClient.faultString) ConsoleWrite( $SOAPClient.detail) Endif ;ConsoleWrite($SOAPClient.GetCurrencyCode()) $M = $SOAPClient.GetCurrencyCode() $J=FileOpen ("c:\erez-test-soap.txt",2) FileWrite ($J,$M) FileClose ($J) $K=FileOpen ("c:\erez-test-soap1.txt",2) FileWrite ($K,$R) FileClose ($K) ShellExecute ("notepad.exe","c:\erez-test-soap.txt") ShellExecute ("notepad.exe","c:\erez-test-soap1.txt") ;FileDelete ("c:\erez-test-soap.txt") if @error then ConsoleWrite($SOAPClient.faultString) ConsoleWrite($SOAPClient.detail) 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 as you see I am trying to get $R=$SOAPClient.mssoapinit("http://www.webservicex.net/country.asmx?wsdl") into $R the WSDL xml data. but it does not work $R is empty, although the second function does work and $M have the data return. I need the wsdl xml data and don't want to use TCPrecv function, can anyone help ? someone named ptrex wrote the original maybe you can help me please? Until you get an answer from somebody who knows what he's talking about, you can have my 30sec Google answer: The .mssoapinit() method doesn't return the XML, only success/fail in an HRESULT. So $R = 0 is just a success indication, isn't it? I could (easily) be wrong, and maybe you'll get a better answer from somebody else. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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