Error 400 The request verb is ivalid

Im using default milestone LogInDotNeaSoap example from SDK 2018R3.

I can connect to server and obtain token, but second part of code(connect) always give me Error 400. The request verb is invalid.

I tried using different methods from here http://doc.developer.milestonesys.com/html/reference/protocols/imageserver_request_response.html#a13 , but still same error

How can you solve it? Or maybe its my server configuration, that needs to be modified.

I upload image so you can see out put.

Thank you.

Username and password cannot be empty, try to fill in “dummy”.

I will have to have a renewed look at this sample, a quick question; did you modify the sample or is this an observation with an unmodified LoginDotNetSop sample?

Hi @Bo Ellegård Andersen (Milestone Systems)​ i modify, but i just add logs and ensure it uses SSl token approach.

I think i found the problem.

Basicaly if you choose Enterprise the code will not work because of request to PORT 80, but when i change code to use Corporate port 7563 it worked as a charm.

But proper error code for invalid version token or something like that would help a lot.

I even were managed to make it work with node JS.

here is the snipped just incase some one want that.

const http = require('http');
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
let post_data = `<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xpr="http://videoos.net/2/XProtectCSRecorderCommand"><soap:Header/><soap:Body><xpr:InputGetState><xpr:token>TOKEN#da9d752b-290f-47de-9217-b5307966afa4#windev1809eval//ServerConnector#</xpr:token><xpr:deviceId>595302B4-5253-4BF8-AC06-E9A76EDBD039</xpr:deviceId></xpr:InputGetState></soap:Body></soap:Envelope>`
// An object of options to indicate where to post to
let post_options = {
    host: 'windev1809eval',
    port: '7563',
    path: '/recordercommandservice/recordercommandservice.asmx',
    method: 'POST',
    headers: {
        'Content-Type': 'application/soap+xml;charset=UTF-8;action="http://videoos.net/2/XProtectCSRecorderCommand/InputGetState"',
        'Content-Length': Buffer.byteLength(post_data)
    }
};
// Set up the request
var post_req = http.request(post_options, function(res) {
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log('Response: ' + chunk);
    });
});
// post the data
post_req.write(post_data);
post_req.end();
 
//and on response i got this
<?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://www.w3.org/2003/05/soap-envelope"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="e
n">Device 595302b4-5253-4bf8-ac06-e9a76edbd039 not found.</soap:Text></soap:Reason><detail><ErrorNumber>40000</ErrorNumber></detail></soap:Fault></soap:Body></soap:Env
elope>

Thank you for you’re help. Hope this helps someone in future. I close this issue.

I am confused. You should not choose Enterprise=e-code if your XProtect server is Corporate=c-code. Do you care to explain?

More importantly I would like to congratulate you on solving the issue and thank you for sharing your solution!

Well yeah it were my mistake to not check the difference in C and E solutions.

Thank you for your help . It means a lot.

That’s fair, perhaps others will learn from this thread. Again thanks for sharing.