cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member231229
Participant
0 Kudos

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?

Cheers,

Roberto.

Accepted Solutions (1)

Accepted Solutions (1)

former_member231229
Participant
0 Kudos

...it 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.

Answers (0)