简体   繁体   English

从沙盒切换到生产时,AWS Turk NotifyWorker方法无法与.NET SDK配合使用

[英]AWS Turk NotifyWorker method not working with .NET SDK when switching from Sandbox to Production

I created a small app in .NET C# that allows me to send emails to workers using their Worker ID. 我在.NET C#中创建了一个小型应用程序,该应用程序使我可以使用工作人员ID向工作人员发送电子邮件。 I sent an email to my own personal Worker ID and it worked fine when I have my service endpoint set as https://mechanicalturk.sandbox.amazonaws.com?Service=AWSMechanicalTurkRequester in the App.config file. 我已将电子邮件发送到我自己的个人Worker ID,当我在App.config文件中将服务端点设置为https://mechanicalturk.sandbox.amazonaws.com?Service=AWSMechanicalTurkRequester时,它可以正常工作。

However when I switch the service endpoint to https://mechanicalturk.amazonaws.com?Service=AWSMechanicalTurkRequester the email never arrives. 但是,当我将服务端点切换到https://mechanicalturk.amazonaws.com?Service=AWSMechanicalTurkRequester时 ,电子邮件永远不会到达。

It also doesnt seem like the NotifyWorker method has any response method in the SDK like it does in the normal URI request in the form of an XML response, so its getting pretty infuriating to debug. 似乎NotifyWorker方法在SDK中没有像XML响应形式的普通URI请求中那样具有任何响应方法,因此调试起来非常恼人。

Does anyone have any ideas why when I switch the service endpoint, the message never arrives? 有谁知道为什么当我切换服务端点时消息永远不会到达?

(Requested Edit) Here is the code that runs the main function: (请求编辑)这是运行主要功能的代码:

public class WorkerArgs
    {
        public string FileName { get; set; }
        public bool Mass { get; set; }
        public string WorkerID { get; set; }
        public string Message { get; set; }
        public string Subject { get; set; }
        public WorkerArgs(string fileName, bool mass, string message, string subject)
        {
            this.FileName = fileName;
            this.Mass = mass;
            this.Message = message;
            this.Subject = subject;
        }
        public WorkerArgs(bool mass, string workerId, string message, string subject)
        {
            this.Mass = mass;
            this.WorkerID = workerId;
            this.Message = message;
            this.Subject = subject;
        }
    }
private void bwRun_DoWork(object sender, DoWorkEventArgs e)
    {
        WorkerArgs args = (WorkerArgs)e.Argument;
        if (args.Mass)
        {
            List<string> workers = CSVProcessor.GetUniqueWorkers(args.FileName);
            for (int i = 0; i < workers.Count(); i += 100) {
                MessageSender.SendMessage(args.Subject, args.Message, workers.Skip(i).Take(100).ToList());
            }
        }
        else
        {
            MessageSender.SendMessage(args.Subject, args.Message,new List<string>(new string[] { args.WorkerID }));
        }

    }

class CSVProcessor
{
    public static List<string> GetUniqueWorkers(string fileName)
    {
        //WorkerCollection workers = new WorkerCollection();

        List<string> workers = new List<string>();

        using (TextFieldParser tfp = new TextFieldParser(fileName))
        {
            tfp.Delimiters = new string[] { "," };
            tfp.ReadFields();
            while (!tfp.EndOfData)
            {
                string[] values = tfp.ReadFields();
                if (!String.IsNullOrWhiteSpace(values[21])) { workers.Add(values[15]); } //{ workers.addUniqueWorker(values[15]); }

            }
        }

        return workers.Distinct().ToList();
    }
}

class MessageSender
{
    public static void SendMessage(string subject, string messageText, List<string> workerIDs) {
        SimpleClient client = new SimpleClient();
        client.NotifyWorkers(subject, messageText, workerIDs);
    }

}

Figured out the issue. 找出问题。 Amazon Turks only allows you to NotifyWorkers for workers who have completed HITs for you. Amazon Turks仅允许您为已为您完成HIT的工作人员通知人。 As the people I have been messaging have not completed HITs for me and the only person that was successful was my own worker ID in the sandbox (which is where I had completed some of my own HITs), that is the reason of the lack of messages arriving. 由于我一直在与之聊天的人还没有为我完成HIT,并且唯一成功的人是我自己的工号(在我的沙箱中,这是我完成一些HIT的位置),这就是缺少消息到达。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从演示切换到生产时,认证失败 - getting authentication failed when switching from demo to production 如何从 AWS.NET SDK 获取 AWSCredentials? - How to get AWSCredentials from AWS NET SDK? Azure Notificationhub-PN发送在沙盒中工作,但不在生产中 - Azure Notificationhub - PN send working in sandbox but not in production AWS CloudFormation .NET SDK - AWS CloudFormation .NET SDK 尝试列出存储桶时拒绝对.net AWS SDK的访问 - Access denied for .net AWS SDK when trying to list buckets 例如,在将环境从开发切换到生产时如何从 WSDL 参考更改 - How to change from WSDL reference when switching environments from dev to production, for example 从Asp.net中的方法调用时弹出窗口不起作用 - Pop Up not working when calling from method in Asp.net 使用 .NET AWS 开发工具包时,GetBucketAcl API 调用是否正常/预期? - Is a GetBucketAcl API call normal/expected when using the .NET AWS SDK? 从Http上载AWS .NET SDK分段文件 - AWS .NET SDK Multipart File Upload from Http 使用 Google Admin SDK、vb.net 和服务帐户进行 Google 用户管理,用于开发而非生产 - Google User Administration with Google Admin SDK, vb.net and service account working in development but not production
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM