HERE Waypoint Sequence API - here-api

Since yesterday 23/01/2019 I started getting the following error when using the HERE Waypoint Sequence API.
Technical error while generating the response. Please contact TCS. Error ID: de4aae0d-da0c-4cfe-b23c-29eb9ede7dd7
I do not have anymore detail, as this is all the response gives me.
I am using the same app_id and app-code as always and this just started happening without warning.
I am using an ajax call using this url: https://wse.cit.api.here.com/2/findsequence.json
The issue is also intermittent and sometimes the response generates results and the other 90% it generates the error. I am at a loss as I cannot find anything on the Here API FAQ site.
Here is a code snippet of the ajax call:
$.ajax({
url: 'https://wse.cit.api.here.com/2/findsequence.json',
type: 'GET',
dataType: 'jsonp',
jsonp: 'jsonCallback',
data: request,
success: function(response) {
if (response.errors.length == 0) {
//use response to build route order html
} else {
$('.packageError').append(response.errors[0]);
}
}
});

The HERE Waypoint Sequence API is using the Matrix Routing Service in the backround for calculating all the routes. The error message points to to a timeout from the Matrix Routing itself. In this case please resend the request. We will update the documentation concerning the error codes shortly.

Related

IIS Web Service Error Occurred - Might be CORS related

I am running into a strange issue with What I believe to be IIS related. I have developed an ASP.NET Web API running on DOTNET4.6. This API receives a json payload in its body when it is called from a different system. It then takes that information and calls the GitHub API at api.github.com with a personal access token in order to create a repository for me.
The outline above might be irrelevant to the situation but here is the problem:
Problem
When running in debug mode, this API works as expected. I can do postman POST request and all operations are completed as expected and I can see my new repo on GitHub.
When publishing the service and moving it to one of our IIS servers. Thing start to get messy and annoying. Doing a POST request results in a json response {"message":"An error has occurred"}. I know for a fact that this happens before my code is even reached and these are not one of my error handling messages. The response is a 500 Internal Server Error.
What I have tried
I tried investigating the source of the issue bu running the request in different ways. IIS logs give me nothing.
I ran the following request in the Chrome Developer console:
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({"timestamp":1589452400243,"webhookEvent":"item_created"});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://myiisserver/Integration/api/GitRepoSetu?clientid=aclientid&clientsecret=aclientsecret", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
unfortunately, this yields the same result and there is no useful information whatsoever. only a 500 internal server an a message stating "An error has occurred"
can anybody point me in the right direction as to where I can look to find an indication of what is actually going on? Previously, I had CORS policy issues and attempted to resolve them by installing the CORS NuGet package and configuring it on my Controller. The cors error were only thrown in the chrome dev console and never in postman. I am at my witts end trying to figure this out.

FCM Subscribe Topic return Invalid Token

The problem is as stated above. If I try to subscribe to a push notification via the url: https://iid.googleapis.com/iid/v1/{token}/rel/topics/{topic}, I always get the following response: {"error":"InvalidToken"}
I have tried using both GET and POST methods but still the same response.
I have checked if the Token is a valid token by using the following url: https://iid.googleapis.com/iid/info/{token} which return the correct data like this:
{
"application": "com.chrome.windows",
"subtype": "wp:http://localhost/#2A58747F-DEF7-4C55-8073-126B2D168-V2",
"authorizedEntity": "856365479457",
"platform": "WEBPUSH"
}
If my token is valid, then why I am getting the error invalid token?
I believe you are hitting a GET request with topic subscribe, try POST with the same parameters.
Or you are hitting incorrect url: Hitting an url without ../rel/.. also produces the same error.
Error
Solution

In meteor.http.get method, How to wait for the page to load like say for 5 seconds

How to wait for the page to load like say for 5 seconds.
In my program the sites wait for browser checks for 5 seconds before showing the content, Hence I want my http.get(url) function to wait for at least 5 seconds.
Without wait it doesn't show any content.
Thanks.
Based upon your comments, I now understand what you are trying to do and have modified this answer.
Unfortunately, there is no way to configure Meteor HTTP (which really uses
request to make the service call) to "wait" after the request has been initiated before obtaining a response. The best thing for you to do is to check out PhantomJS. It is a headless browser that you can use to load and render the page and then access dynamically generated content via javascript.
Check out this answer for a brief PhantomJS example and you can use the gadicohen:phantomjs package to install for meteor.
On a side note, it can still be useful to use the below function to pause execution in Meteor, but of course this is not useful for what you are trying to solve.
Meteor._sleepForMs(5000); // pause execution for 5 seconds
the http package is built upon npm's request package. You can do it as such with the request package directly:
var request = require('request');
var reqOptions = {
url: path,
method: 'GET',
encoding: "utf8",
jar: false,
timeout: null,
body: null,
followRedirect: null,
followAllRedirects: null,
headers: {},
time:true
};
request(reqOptions, function(error, response, body) {
console.log("time: "+response.elapsedTime)
console.log(body.toString()); //res.content returned by http.get
});
require('sleep').sleep(5); //synchronously slowing execution
You might also be able to do the same by setting {time:true} in the npmOptions parameter of the http call and then synchronously

wordpress ajax keeps losing connections

I apologize for my being little more han a newbie in WP and ajax but I need your help. I'm not sure if it's a bug or it's simply me who cannot manage to find a solution.
I've the following situation.
I've a plugin that displays certain data from a remote mysql server. This data need to be updated periodically.
At the moment I've implemented this through AJAX, more or less, like this:
$.ajax({
type : "POST",
url: cktn_ajax_object.ajax_url,
data: params,
dataType: "json",
success: function(response) {
<< Update UI according to response >>
},
error: function(request, status, err) {
console.debug("[AjaxOnTimer Error] status: " + status);
}
});
where $.ajax is calling the relevant php script responsible for retrieving the remote mysql data. The PHP script duration is variable, according to the amount of data it fetches (Let's say, something between a few seconds and four or five minutes).
If I test the whole on my local machine, there is no problem. The ajax call duly and patiently awaits the (slow) response of the local PHP server (which is querying the remote mysql server) and eventually, upon completion, it updates my UI.
On the other hand, when I install my plugin on the production machine things don't work as expected. Just a few seconds after having placed my ajax call to the PHP server, I get the following error in the console of the browser:
Failed to load resource: connection lost. ---> admin-ajax.php
and my script fails leaving me no other clue than the word error in the 'status' parameter of the ajax call.
Apparently the heartbeat.lock-post is interfering with my ajax call.
Any idea of what am I doing wrong?
Add the following to functions.php to turn off heartbeat:
add_action( 'init', 'my_deregister_heartbeat', 1 );
function my_deregister_heartbeat() {
global $pagenow;
if ( 'post.php' != $pagenow && 'post-new.php' != $pagenow )
wp_deregister_script('heartbeat');
}
And restart the apache.
Not sure if your problem is solved. But if someone experience the same problem today, i've solved this using the Heartbeat Control plugin available here: https://wordpress.org/plugins/heartbeat-control/.

Why .NET ASMX web service on secure.site.com can't be called from www.site.com?

We have a web service on https://secure.site.com/service.asmx it works fine from https://secure.site.com/consumer.html
but when we try to use it from https://www.site.com/consumer.html we can't do it. Getting 403 error.
I'ts probably something related to webservice security (because of different subdomains) but I can't figure out what.
How to make https://secure.site.com/service.asmx be accessible from https://www.site.com/consumer.html?
Update:
Calling webserivce using JQuery Ajax.
$.ajax({
type: "POST",
url: "https://secure.site.com/service.asmx/method",
data: {},
dataType: "xml",
success: method_result,
error: AjaxFailed
})
;
Thanks.
I recall working on something like this. I just made a demo app and recall having to add something like the following in one of the htlm pages within a javascript block:
document.domain: "*.site.com"; or "site.com";
details are fuzzy and it maybe for another issues I had, but its something to go on.

Resources