-1

簡単な Aditi Scheduler チュートリアルに従おうとしていますが、エラーが発生しています。これが私のコードです。

私は何を間違っていますか?

エラー: 入力は有効な Base-64 文字列ではありません。これは、base 64 以外の文字、3 つ以上の埋め込み文字、または埋め込み文字に無効な文字が含まれているためです。

[TestMethod]
public void ScheduledSMS()
{

    var tenantId = "xxxxxxxxxxxmyid";
    var secretKey = "xxxxxxxxxxxmykey";


    var scheduledTasks = new ScheduledTasks(tenantId, secretKey);

    // create a task
    var task = new TaskModel
    {
        Name = "My first Scheduler job",
        JobType = JobType.Webhook,

        // use predefined CommonCronExpressions or build your own CRON expressions here http://cronmaker.com/
        CronExpression = CommonCronExpressions.EveryMinute,

        // use builders to set job properties for webhooks and azure queue 
        Params = ParamBuilderFactory
                    .WebHookBuilder("http://localhost:1901/SMS/SendText")
                    .Build()
    };

    var operationId = scheduledTasks.CreateTask(task);   <------ Error happens here..

    // all operations in the api follow fire and forget approach, once an operation like create/update/delete
    // is requested it returns an operationId(Guid) which can be used to fetch the operation status

    // operation status can be fetched in two ways:

    // method 1: (without polling) returns the status without polling
    var operationStatus = scheduledTasks.GetOperationStatus(operationId);

    // method 2: (with polling) polls until the operation status changes to success/error or a timeout occurs 
    // var operationStatus = scheduledTasks.GetOperationStatus(operationId, true);

    // get the task
    TaskModel newTask = null;
    if (operationStatus.Status == StatusCode.Success)
    {
        dynamic resultData = operationStatus.Data;
        var newTaskId = resultData["Id"];
        newTask = scheduledTasks.GetTask(Guid.Parse(newTaskId));
    }


}
4

2 に答える 2

0

WebHookBuilder に渡す URL の「localhost」に問題があるのではないでしょうか?

于 2013-10-16T13:17:20.480 に答える
0

これは数か月前のものですが、tenantId と secretKey が逆になっていることに気付くまで、これと同じ問題がありました (ばかげていますが、簡単な間違いです)。それらを交換したら、うまくいきました。

于 2014-01-22T01:28:04.450 に答える