Skip to Content
0

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

Jun 21, 2017 at 01:34 AM

57

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Roberto Pagni
Jun 21, 2017 at 01:34 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded