Jump to content

RafaelMaciel

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by RafaelMaciel

  1. Hi guys, First, you are stupendous. This object are wonderfull. I'm start use AutoitObject and Koda at one script, and the situation is: The next code works perfect and the window opens normaly. -------------------------------------------------------------------------- ;Includes das telas #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Func _Telas_Analista_main() #Region ### START Koda GUI section ### $AnalistaFormMain = GUICreate("Analista", 224, 438, 10, 10, BitOR($WS_SYSMENU, $WS_BORDER, $WS_CAPTION)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() ConsoleWrite("!...Tela travada'" & @CRLF) Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc _Telas_Analista_main() -------------------------------------------------------------------------------------------------------------------------------------------------------- but, the next code are the up code with AutoitObject, and this, when I execute, his open the window but this stop!! -------------------------------------------------------------------------------------------------------------------------------------------------------- #comments-start AutoIt Version: 0.1 Author: Rafael Scolari Maciel Objetivo: Gestão da execução das rotinas de analise #comments-end #include "AutoitObject.au3" #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _AutoItObject_StartUp() Global $C_Analista = _Analista_create();global detentora do objeto ANALISTA Func _Analista_create() Local $oClassObject = _AutoItObject_Class() $oClassObject.Create() $oClassObject.AddMethod("formMain", "_Analista_main") $oClassObject.AddDestructor("_DestructorForAnalista") Return $oClassObject.Object EndFunc Func _Analista_main($oSelf) #Region ### START Koda GUI section ### $AnalistaFormMain = GUICreate("Analista", 224, 438, 10, 10, BitOR($WS_SYSMENU, $WS_BORDER, $WS_CAPTION)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() ConsoleWrite("!...Tela travada'" & @CRLF) Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc Func _DestructorForAnalista($oSelf) ConsoleWrite("!...destructing... 'Analista'" & @CRLF) EndFunc $C_Analista.formMain -------------------------------------------------------------------------------------------------------------------------------------------------------- At another post, Martin makes a great code to show this situation: ;Includes das telas #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "C:\Program Files\Autoit3\include\AutoitObject.au3" Dim $doexit _AutoItObject_StartUp() extern2("Window 1") ;create window without using objects Global $C_Analista = _Analista_create();global detentora do objeto ANALISTA $C_Analista.formMain $C_Analista = 0;destroy th eobject _AutoItObject_Shutdown();don't forget this line although the examples do Func _Analista_create() Local $oClassObject = _AutoItObject_Class() $oClassObject.Create() $oClassObject.AddMethod("formMain", "_Analista_main") $oClassObject.AddDestructor("_DestructorForAnalista") Return $oClassObject.Object EndFunc ;==>_Analista_create Func _Analista_main($oSelf) extern2("window from object") EndFunc func extern2($title) AutoItSetOption("guioneventmode",1) $doexit = 0 #region ### START Koda GUI section ### $AnalistaFormMain = GUICreate($title, 224, 438, 10, 10);, BitOR($WS_SYSMENU, $WS_BORDER, $WS_CAPTION)) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### ConsoleWrite("step 4" & @LF) GUISetOnEvent($GUI_EVENT_CLOSE, "CloseGui") While $doexit = 0 sleep(30) WEnd EndFunc ;==>_Analista_main Func CloseGui() ConsoleWrite("close gui?" & @LF) $doexit = 1 EndFunc Func _DestructorForAnalista($oSelf) ConsoleWrite("!...destructing... 'Analista'" & @CRLF) EndFunc ;==>_DestructorForAnalista () More infos: From the Windows Event Viewer the AutoIt register two events, first: Fault bucket , type 0 Event Name: AppHangB1 Response: Not available Cab Id: 0 Problem signature: P1: AutoIt3.exe P2: 3.3.8.1 P3: 4f25baec P4: 1435 P5: 0 P6: P7: P8: P9: P10: Attached files: These files may be available here: C:\Users\<<<<<>>>>>>\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppHang_AutoIt3.exe_8aa79b99642e5abe8fef93464a12724dbc1d31c_406e79d5 Analysis symbol: Rechecking for solution: 0 Report Id: cffc3b89-e378-11e2-83c1-0024e8b38737 Report Status: 0 Error event: The program autoit3.exe version 3.3.8.1 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Action Center control panel. Process ID: 5ca8 Start Time: 01ce77858450d018 Termination Time: 14 Application Path: C:\Program Files (x86)\AutoIt3\autoit3.exe Report Id: cffc3b89-e378-11e2-83c1-0024e8b38737 Please, someone can help me?
  2. Thanks Martin, I will use your code to show better this situation at the new post. Very thanks!
  3. Hi peaple, I'm start use AutoitObject and Koda at onde script, and the situation is: The next code works perfect and the window opens normaly. -------------------------------------------------------------------------- ;Includes das telas #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Func _Telas_Analista_main() #Region ### START Koda GUI section ### Form=E:Rami SistemasProdutoTelasAnalistaFormMain.kxf $AnalistaFormMain = GUICreate("Analista", 224, 438, 10, 10, BitOR($WS_SYSMENU, $WS_BORDER, $WS_CAPTION)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() ConsoleWrite("!...Tela travada'" & @CRLF) Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc _Telas_Analista_main() -------------------------------------------------------------------------------------------------------------------------------------------------------- but, the next code are the up code with AutoitObject, and this, when I execute, his open the window but this stop!! -------------------------------------------------------------------------------------------------------------------------------------------------------- #comments-start AutoIt Version: 0.1 Author: Rafael Scolari Maciel Objetivo: Gestão da execução das rotinas de analise #comments-end #include "AutoitObject.au3" #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _AutoItObject_StartUp() Global $C_Analista = _Analista_create();global detentora do objeto ANALISTA Func _Analista_create() Local $oClassObject = _AutoItObject_Class() $oClassObject.Create() $oClassObject.AddMethod("formMain", "_Analista_main") $oClassObject.AddDestructor("_DestructorForAnalista") Return $oClassObject.Object EndFunc Func _Analista_main($oSelf) #Region ### START Koda GUI section ### Form=E:Rami SistemasProdutoTelasAnalistaFormMain.kxf $AnalistaFormMain = GUICreate("Analista", 224, 438, 10, 10, BitOR($WS_SYSMENU, $WS_BORDER, $WS_CAPTION)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() ConsoleWrite("!...Tela travada'" & @CRLF) Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc Func _DestructorForAnalista($oSelf) ConsoleWrite("!...destructing... 'Analista'" & @CRLF) EndFunc $C_Analista.formMain -------------------------------------------------------------------------------------------------------------------------------------------------------- Please, someone can help me?
  4. Hi Adventurer, Can you help me? I try use your code to do a simple test with webservice and don't work. Func WS2() Global $sAddress = "http://localhost/WebService/" $sPostData = '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' & _ 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' & _ 'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' & _ 'xmlns:urn="urn:ramiws">' & _ '<soapenv:Header/>' & _ '<soapenv:Body>' & _ '<urn:getTexto soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' & _ '<nome_do_cidadao type="xsd:string">Rafa</nome_do_cidadao>' & _ '</urn:getTexto>' & _ '</soapenv:Body>' & _ '</soapenv:Envelope>' Global $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5") Global $hConnect = _WinHttpConnect($hOpen, $sAddress) Global $hRequest = _WinHttpOpenRequest($hConnect, _ "POST", _ "/server.php", _ Default, _ Default, _ 'Content-Type: text/xml') _WinHttpSendRequest($hRequest, -1, $sPostData) _WinHttpReceiveResponse($hRequest) Global $sHeader, $sReturned If _WinHttpQueryDataAvailable($hRequest) Then $sHeader = _WinHttpQueryHeaders($hRequest) MsgBox(64, "Header", $sHeader) Do $sReturned &= _WinHttpReadData($hRequest) Until @error ConsoleWrite($sReturned) Else ConsoleWriteError("!No data available." & @CRLF) MsgBox(48, "Failure", "Func WS2() Global $sAddress = "http://localhost/WebService/" $sPostData = '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' & _ 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' & _ 'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' & _ 'xmlns:urn="urn:ramiws">' & _ '<soapenv:Header/>' & _ '<soapenv:Body>' & _ '<urn:getTexto soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' & _ '<nome_do_cidadao type="xsd:string">Rafa</nome_do_cidadao>' & _ '</urn:getTexto>' & _ '</soapenv:Body>' & _ '</soapenv:Envelope>' Global $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5") Global $hConnect = _WinHttpConnect($hOpen, $sAddress) Global $hRequest = _WinHttpOpenRequest($hConnect, _ "POST", _ "/server.php", _ Default, _ Default, _ 'Content-Type: text/xml') _WinHttpSendRequest($hRequest, -1, $sPostData) _WinHttpReceiveResponse($hRequest) Global $sHeader, $sReturned If _WinHttpQueryDataAvailable($hRequest) Then $sHeader = _WinHttpQueryHeaders($hRequest) MsgBox(64, "Header", $sHeader) Do $sReturned &= _WinHttpReadData($hRequest) Until @error ConsoleWrite($sReturned) Else ConsoleWriteError("!No data available." & @CRLF) MsgBox(48, "Failure", "No data available.") EndIf _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) EndFunc;.") EndIf _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) EndFunc; WebService [color=#000000][font=monospace][size=3]<definitions[/size][/font][/color][color=#000000][font=monospace][size=3] xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"[/size][/font][/color][color=#000000][font=monospace][size=3] xmlns:xsd="http://www.w3.org/2001/XMLSchema"[/size][/font][/color][color=#000000][font=monospace][size=3] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"[/size][/font][/color][color=#000000][font=monospace][size=3]xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"[/size][/font][/color][color=#000000][font=monospace][size=3] xmlns:tns="urn:ramiws"[/size][/font][/color][color=#000000][font=monospace][size=3] xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"[/size][/font][/color][color=#000000][font=monospace][size=3]xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"[/size][/font][/color][color=#000000][font=monospace][size=3] xmlns="http://schemas.xmlsoap.org/wsdl/"[/size][/font][/color][color=#000000][font=monospace][size=3] targetNamespace="urn:ramiws"[/size][/font][/color][color=#000000][font=monospace][size=3]>[/size][/font][/color] [color=#000000][font=monospace][size=3][indent=1] <types> [indent=1] <xsd:schema targetNamespace="urn:ramiws"> [indent=1] <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>[/indent] </xsd:schema>[/indent] </types> <message name="getTextoRequest"> [indent=1] <part name="nome_do_cidadao" type="xsd:string"/>[/indent] </message> <message name="getTextoResponse"> [indent=1] <part name="return" type="xsd:string"/>[/indent] </message> <portType name="RamiWSPortType"> [indent=1] <operation name="getTexto"> [indent=1] <documentation>Retorna teste disponível</documentation> <input message="tns:getTextoRequest"/> <output message="tns:getTextoResponse"/>[/indent] </operation>[/indent] </portType> <binding name="RamiWSBinding" type="tns:RamiWSPortType"> [indent=1] <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="getTexto"> [indent=1] <soap:operation soapAction="urn:ramiws/getTexto" style="rpc"/> <input> [indent=1] <soap:body use="encoded" namespace="urn:ramiws/getTexto" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>[/indent] </input> <output> [indent=1] <soap:body use="encoded" namespace="urn:ramiws/getTexto" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>[/indent] </output>[/indent] </operation>[/indent] </binding> <service name="RamiWS"> [indent=1] <port name="RamiWSPort" binding="tns:RamiWSBinding"> [indent=1] <soap:address location="http://localhost/WebService/server.php"/>[/indent] </port>[/indent] </service>[/size][/font][/color][/indent] [color=#000000][font=monospace][size=3]</definitions>[/size][/font][/color] The response i received from AutoIt is "No data available". Thanks for anyone can help!!
  5. Hi Adventurer, I try use your code to do a personal test and don't work. Code: Func WS2() Global $sAddress = "http://localhost/WebService/" $sPostData = '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' & _ 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' & _ 'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' & _ 'xmlns:urn="urn:ramiws">' & _ '<soapenv:Header/>' & _ '<soapenv:Body>' & _ '<urn:getTexto soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' & _ '<nome_do_cidadao type="xsd:string">Rafa</nome_do_cidadao>' & _ '</urn:getTexto>' & _ '</soapenv:Body>' & _ '</soapenv:Envelope>' Global $hOpen = _WinHttpOpen("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5") Global $hConnect = _WinHttpConnect($hOpen, $sAddress) Global $hRequest = _WinHttpOpenRequest($hConnect, _ "POST", _ "/server.php", _ Default, _ Default, _ 'Content-Type: text/xml') _WinHttpSendRequest($hRequest, -1, $sPostData) _WinHttpReceiveResponse($hRequest) Global $sHeader, $sReturned If _WinHttpQueryDataAvailable($hRequest) Then $sHeader = _WinHttpQueryHeaders($hRequest) MsgBox(64, "Header", $sHeader) Do $sReturned &= _WinHttpReadData($hRequest) Until @error ConsoleWrite($sReturned) Else ConsoleWriteError("!No data available." & @CRLF) MsgBox(48, "Failure", "No data available.") EndIf _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) EndFunc; WebService WSDL
×
×
  • Create New...