I am trying to use node-soap to communicate with Amazon Mechanical Turk. I initialize the soap client with this wsdl but when I try calling client.<SomeOperation>(...)
for any of the operations listed in the Mechanical turk API, I found that the responses I was getting did not contain results from the API call. The API documentation says that the response should contain a "Result element", but instead I found that I was getting useless results that looked like this:
<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>
Upon further investigation, I found that the problem is in what node-soap sends when I try to use it to make API requests. When I try to call, say, RegisterHITType
, rather than sending a <RegisterHITType>
element, it seems to send some sort of <Help>
element instead, which looks like this:
<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>
Why does it send this instead of the expected API request? Is this a result of a glitch, or am I misunderstanding how to use node-soap? Is there a way to work around this, or do I need to look into using the Mechanical Turk API through some other means?