Chris86
Active Members-
Posts
181 -
Joined
-
Last visited
Chris86's Achievements
Prodigy (4/7)
1
Reputation
-
Hello, I'm in the making of a script that needs to post XML data through HTTPS to our ServiceDesk Plus MSP service. I'm running into trouble because I have never made any scripts using HTTP with POST and I cannot see what I'm doing wrong here. Can someone help me or should I find help somewhere else? $URLSDP="" ;REMOVED - cannot publish this. this is the HTTPS url to our ServiceDesk $TechnicianKey="" ;REMOVED $ID="" ; Request ID $sPostData = "OPERATION_NAME=ADD_NOTE&INPUT_DATA=<Operation><Details><Notes><Note><isPublic>false</isPublic><notesText>Text added to the note</notesText></Note></Notes></Details></Operation>&format=XML" $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", $URLSDP & "/sdpapi/request/"& $ID & "/note?TECHNICIAN_KEY="& $TechnicianKey, False) $oHTTP.SetRequestHeader("Content-Type", "xml") $oHTTP.Send($sPostData) $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status ConsoleWrite($oStatusCode & @CRLF) ConsoleWrite($oReceived & @CRLF) If $oStatusCode = 200 Then ;Process the response $oReceived ;ConsoleWrite(@CRLF & "Response" & @CRLF & $oReceived & @CRLF) Else MsgBox(16, "Error " & $oStatusCode, $oReceived, 7) EndIf Response: <operation name="POST"><result><status>Failed</status><message>Invalid operation</message></result></operation>REST API guide. https://www.manageengine.com/products/service-desk-msp/help/adminguide/api/notes-operations.html#add
-
Need help with WM_Notify in Listview and Input
Chris86 replied to Chris86's topic in AutoIt General Help and Support
Thanks But will it have any bad performance hit if i have two events registered? -
Hello I'm making a GUI that needs WM_Notify to work as I want to. Now my WM_Notify is enabling and disabling input and button in my GUI if there is enough characters in the string but I also want it to detect when the user clicks one of the rows in the ListView. Here is the working WM_Notify script im using (>Thanks to Martin is this topic) Func GUI_WM_COMMAND($hWnd, $imsg, $iwParam, $ilParam) Local $setHK = False $nNotifyCode = BitShift($iwParam, 16) $nID = BitAND($iwParam, 0x0000FFFF) $hCtrl = $ilParam If $nNotifyCode = $EN_CHANGE Then Select Case $hCtrl = GUICtrlGetHandle($InputDellOnSiteRepairID) If Stringlen(GUICtrlRead($InputDellOnSiteRepairID)) = 11 Then GUICtrlSetState($InputSak, $GUI_ENABLE) GUICtrlSetState($ButtonFindCase, $GUI_ENABLE) Else GUICtrlSetState($InputSak, $GUI_DISABLE) GUICtrlSetState($ButtonFindCase, $GUI_DISABLE) EndIf ;------------------ Case $hCtrl = GUICtrlGetHandle($InputSak) If Stringlen(GUICtrlRead($InputSak)) = 5 Then GUICtrlSetState($ButtonAdd, $GUI_ENABLE) Else GUICtrlSetState($ButtonAdd, $GUI_DISABLE) EndIf EndSelect EndIf Return $GUI_RUNDEFMSG EndFunc Is there any way i can merge my script with this? Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $tagNMHDR, $event, $hwndFrom, $code $tagNMHDR = DllStructCreate("int;int;int", $lParam);NMHDR (hwndFrom, idFrom, code) If @error Then Return $event = DllStructGetData($tagNMHDR, 3) Select Case $wParam = $ListView Select ; Case $event = $NM_CLICK ; ConsoleWrite("SingleClick" & @LF) Case $event = $NM_DBLCLK $editsqlquery = 1 ;Setup GLOBAL variables rather than calling functions this part need to exit as fast as possible EndSelect EndSelect $tagNMHDR = 0 $event = 0 $lParam = 0 EndFunc ;==>WM_Notify_Events >Source
-
I have a script that needs to be controlled with only two commandline parameters that is ran by a IP-phone software. So i have to be able to control this script with two commandline parameters; the first command gives the script a phone number and the second tells the script that the phone call was hung up. And im going to have some other functions in this script that is controlled by traymenu. Is this possible to have in one script or do i need to have two?
-
Chaim613 reacted to a post in a topic:
Unicode Keyboard v 1.0 - this rocks !
-
_IECreate/Navigate Log in credentials in url?
Chris86 replied to Chris86's topic in AutoIt General Help and Support
It worked but I need to remove all html tags etc. Im not really good at this but for stringregexpreplace pattern, if someone could give me a little hint how to replace a string and everything between those two strings ex: <head> CODE </head> and can I replace serveral strings with only one stringregexpreplace? EX: <head> CODE </head> and <th> CODE </th> and ... and ... -
_IECreate/Navigate Log in credentials in url?
Chris86 replied to Chris86's topic in AutoIt General Help and Support
I got Linksys WRT610N, with DD-WRT installed on it, I have tested this in firefox too, seems to work great there. but in IE its kinda funky.. some times it cant find the address because of the login credentials in the url and sometimes it will but then asks me for username and password(popup) -
Hello, I've been trying to use login credentials in urls with IECreate and IENavigate, but I couldn't get it to work Test 1: #include <IE.au3> $oIE = _IECreate ("http://username:password@192.168.1.1/",0,0,1) _IENavigate($oIE, ) $sText = _IEBodyReadText ($oIE) ConsoleWrite($sText) Result: Windows Login pops up and asks me for username and password Test 2: #include <IE.au3> $oIE = _IECreate ("",0,0,1) _IENavigate($oIE, "http://username:password@192.168.1.1/") $sText = _IEBodyReadText($oIE) ConsoleWrite($sText) Result: Same as first test.. Test 3: #include <INet.au3> _INetGetSource("http://username:password@192.168.1.1/Status_Conntrack.asp") $sText = _IEBodyReadText ($oIE) ConsoleWrite($sText) Same results.. How can I login without needing to have the user to enter the credentials and without interfering the user?
-
Do you still have that script working? mind sharing ? Im trying to record from my mic and send it over udp or tcp
-
Hello, Does Koda FD support Vista aero etc?
-
Compare strings with wildcards and check if it match
Chris86 replied to Chris86's topic in AutoIt General Help and Support
Ok This will help me alot thanks