XPMobileSDK.library.Ajax Error

    We have the below project we would like to implement with Milestone 2018 R2 however we have run into a roadblock. We are attempting to use our exception reporting site to pull video from a specific register biased on the receipt information. We have managed to set up their site to retrieve the data with the use of the Milestone SDK however we are getting an Access Denied when we try to retrieve the video. Currently the test recording server is what is being used access the analytics site so it does not appear to be a network issue. I have checked the security settings on the system and can see no issues there. The below is the result.

Console message: " Sending Connect on Mon Aug 27 2018 16:11:53 GMT-0400 (Eastern Daylight Time)with [object Object] "

Function: XPMobileSDK.library.Ajax

URL: “http://10.242.73.5:8090/XProtectMobile/Communication

method “POST”

postBody “<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?><Communication xmlns:xsi=\“http://www.w3.org/2001/XMLSchema-instance\” xmlns:xsd=\“http://www.w3.org/2001/XMLSchema\”><Command SequenceId=\“1\”>RequestConnect<Param Name=\“PublicKey\” Value=\“ViMddRloYxrVmxqfcY8KeMo/M4iOhs5boINEMoJZZbk4gX/J3S/7B9+W7tDX/teyNRNgDQ9/zrPypZD1tVh2dyMZf5VBdanb4V9EUyLA5d54+CgV0vEDdALTzG7SjSc+xJ1ZXHXHYS9lIqxo+h5tgOQWxjT5GGReua2/ilYWOMsA\” /><Param Name=\“PrimeLength\” Value=\“1024\” /><Param Name=\“EncryptionPadding\” Value=\“ISO10126\” />\r\n\r\n”

responseType “text”

Error returned: “Access is denied.”

Hi Scott,

If I’ve understand your setup correctly, Mobile SDK is loaded from page/site that is not hosted in the MoS itself.

In other words from the site are made cross-origin resources requests.

As the mobile server have implemented (for security reasons) active CORS protection, you site should be included in the “Access-Control-Allow-Origin” header of the server response.

For this to happen you have to manually edit the “VideoOS.MobileServer.Service.exe.config” file of the mobile server.

If could be found in the Mobile server installation folder, which is be default “[C:\Program](file:C:/Program) Files\Milestone\Milestone Mobile Server\”

There search for :

There you have to add your site in the value.

I have to admit that Edge for example doesn’t provide meaningful message on the error that have occurred.

IE for example says: “SEC7120: Origin http://: not found in Access-Control-Allow-Origin header.”

Chrome: “xxx.html:YY Failed to load http://:/XProtectMobile/Communication: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://<other_address>:<other_port>’ is therefore not allowed access.”