【问题标题】:node-soap only sending "Help" requests to Mechanical Turk?node-soap 只向 Mechanical Turk 发送“帮助”请求?
【发布时间】:2016-05-27 21:36:33
【问题描述】:

我正在尝试使用 node-soap 与 Amazon Mechanical Turk 进行通信。我用this wsdl 初始化了soap 客户端,但是当我尝试为any of the operations listed in the Mechanical turk API 调用client.<SomeOperation>(...) 时,我发现我得到的响应不包含API 调用的结果。 The API documentation says that the response should contain a "Result element",但我发现我得到了看起来像这样的无用结果:

<HelpResponse xmlns="http://requester.mturk.amazonaws.com/doc/2014-08-15">
    <OperationRequest>
        <RequestId>(something)</RequestId>
    </OperationRequest>
    <Information>
        <Request>
            <IsValid>True</IsValid>
        </Request>
        <OperationInformation>
            <Name>Please see our online documentation at http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=28</Name>
        </OperationInformation>
    </Information>
</HelpResponse>

经过进一步调查,我发现问题出在我尝试使用 node-soap 发出 API 请求时发送的内容。当我尝试调用RegisterHITType,而不是发送&lt;RegisterHITType&gt; 元素时,它似乎发送了某种&lt;Help&gt; 元素,如下所示:

<Help xmlns="http://requester.mturk.amazonaws.com/doc/2014-08-15">
    <Title>(something)</Title>
    <Description>(something)</Description>
    <Reward>(something)</Reward>
    <AssignmentDurationInSeconds>(something)</AssignmentDurationInSeconds>
    <AWSAccessKeyId>(something)</AWSAccessKeyId>
    <Timestamp>(something)</Timestamp>
    <Service>AWSMechanicalTurkRequester</Service>
    <Signature>(something)</Signature>
</Help>

为什么它发送这个而不是预期的 API 请求?这是故障的结果,还是我误解了如何使用 node-soap?有没有办法解决这个问题,还是我需要考虑通过其他方式使用 Mechanical Turk API?

【问题讨论】:

    标签: node.js amazon-web-services soap mechanicalturk node-soap


    【解决方案1】:

    我发现 node-soap 可能有错误。

    请尝试使用“soap ui”自行调用网络服务,以确保该网络服务正常工作。 (在这里下载soap-ui https://www.soapui.org

    如果 Web 服务运行良好,则问题出在 node-soap 库上。 您可以通过生成soap请求消息并直接调用服务来解决问题。

    【讨论】:

    • 感谢您的回复。从那以后,我已经转而将其余的 api 用于此特定服务(并且效果很好),所以说实话,我认为我不会花时间尝试使用 soap-ui 来测试它——但感谢帮助
    猜你喜欢
    • 2012-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-25
    • 1970-01-01
    相关资源
    最近更新 更多