Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
neto_s
Posts: 2
Joined: Tue Apr 11, 2017 4:22 am

user-agent problem

Tue Apr 11, 2017 4:31 am

hello :)

I asked for a user-agent last week and I have already been noticed that I can use my user-agent

my user-agent works fine in the debugger (http://www.opensubtitles.org/addons/xml-rpc/debugger/) and the test user-agent works fine there too

but in my script both user-agents don't work

I get "414 Unknown User Agent"

Code: Select all

Dim $objHTTP Dim $strEnvelope Dim $strReturn Dim $objReturn Dim $dblTax Dim $strQuery Dim $value ; Initialize COM error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $objHTTP = ObjCreate("Microsoft.XMLHTTP") $objReturn = ObjCreate("Msxml2.DOMdocument.3.0") $strEnvelope = '<?xml version="1.0"?>' & _ "<methodCall>" & _ "<methodName>LogIn</methodName>" & _ "<param>" & _ "<value><string></string></value>" & _ "</param>" & _ "<param>" & _ "<value><string></string></value>" & _ "</param>" & _ "<param>" & _ "<value><string>en</string></value>" & _ "</param>" & _ "<param>" & _ "<value><string>OSTestUserAgentTemp</string></value>" & _ "</param>" & _ "</methodCall>" ; Set up to post to our local server $objHTTP.open ("post", "http://api.opensubtitles.org/xml-rpc", False) ConsoleWrite("Content of the envelope : "& @CR & $strEnvelope & @CR & @CR) ; Make the call $objHTTP.send ($strEnvelope) ; Get the return envelope $strReturn = $objHTTP.responseText ; ConsoleWrite("Debug : "& $strReturn & @CR & @CR) ; Load the return envelope into a DOM $objReturn.loadXML ($strReturn) ConsoleWrite("Return of the SOAP Msg : " & @CR & $objReturn.XML & @CR & @CR) 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) ; to check for after this function returns Endfunc

Code: Select all

Content of the envelope : <?xml version="1.0"?><methodCall> <methodName>LogIn</methodName> <param><value><string></string></value></param> <param><value><string></string></value></param> <param><value><string>en</string></value></param> <param><value><string>OSTestUserAgentTemp</string></value></param> </methodCall> Return of the SOAP Msg : <?xml version="1.0"?> <methodResponse><params><param><value><struct> <member><name>token</name><value><string>rD1ciXPSBOmeqY6uwy8s--4SJ44</string></value></member> <member><name>status</name><value><string>414 Unknown User Agent</string></value></member> <member><name>seconds</name><value><double>0.008</double></value></member></struct></value></param></params></methodResponse>

User avatar
oss
Site Admin
Posts: 5878
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: user-agent problem

Tue Apr 11, 2017 1:20 pm

sending PM

neto_s
Posts: 2
Joined: Tue Apr 11, 2017 4:22 am

Re: user-agent problem

Sat Nov 09, 2019 9:22 pm

the problem is when i was creating the evenlop i didnt put the params inside a <params> tag then i got invalid user error

wrong:

<?xml version="1.0"?><methodCall>
<methodName>LogIn</methodName>
<param><value><string></string></value></param>
<param><value><string></string></value></param>
<param><value><string>en</string></value></param>
<param><value><string>OSTestUserAgentTemp</string></value></param>
</methodCall>

right:

<?xml version="1.0"?><methodCall>
<methodName>LogIn</methodName>
<params>
<param><value><string></string></value></param>
<param><value><string></string></value></param>
<param><value><string>en</string></value></param>
<param><value><string>OSTestUserAgentTemp</string></value></param>
</params>
</methodCall>

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 18 guests