Skip to Content

XSA sap-job-scheduler: buildBasicAuthHeader is not a function

Hello all,
I am using the sap-job-scheduler Node module in one XSA Application. However, despite all the tries, the Scheduler module always trigger a strange error "this._buildBasicAuthHeader is not a function".

Assuming that the standard module is syntactically correct, what could be the reason of this error?

I also tried to follow along the SHINE Application, and I am doing exactly the same thing:

First, take the connection option from the xs service:

        var services = xsenv.getServices({ jobscheduler: { tag: "jobscheduler" } }).jobscheduler;
        return {
            timeout: 15000,
            user: services.user,
            password: services.password,
            baseURL: services.url

Then, try to create a new job:

		var scheduleAdmin = jobScheduler.Scheduler(options);
		var scJob = {
			job: newJob

But unfortunately, everything dumps right away at jobScheduler.Scheduler(options): inside, it tries to create the Base64 authorization string and it fails saying that there's no function (which is there indeed):

  this._requestDefaults = request.defaults({
    json: true,
    timeout: this._timeout,
    headers : {
      'Authorization' : 'Basic ' + this._buildBasicAuthHeader(options)

Anyone got the same issue?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 21, 2017 at 01:34 PM was probably very late in the night.
    I checked again this morning, and all I was missing is the "new" keyword...a new object needs to be created :)

    Problem non existing.

    Add comment
    10|10000 characters needed characters exceeded