2012-02-13 6 views
1

Amazon S3 APIを使用してAutoITスクリプトインターフェイスを作成しようとしています。私はSOAPとRESTの両方を試していますが、成功はありません。Amazon S3 APIとのインターフェイスを設定するAutoITスクリプト/ UDF

これは私が(AutoItのフォーラムにPtrexからの変形例)で働いているSOAPコードでは、しかし、私は次の応答を取得: 「soapenv:Client.badRequest欠落SOAPActionヘッダー」

正直に言うと、 、コードはそれほど意味をなさない、私は本当にちょうど周りをちょっと変わっています。

Amazon S3 APIとの適切なインターフェース方法について私が正しい方向に向かうための例や指針は、非常に高く評価されます。

; Initialize COM error handler 
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") 

$objHTTP = ObjCreate("Microsoft.XMLHTTP") 
$objReturn = ObjCreate("Msxml2.DOMDocument.3.0") 

$strEnvelope = '<soap:envelope xmlns:soap="urn:schemas-xmlsoap-org:soap.v1">' & _ 
'<soap:header></soap:header>' & _ 
'<soap:body>' & _ 
'<ListAllMyBuckets xmlns="http://doc.s3.amazonaws.com/2006-03-01">' & _ 
    '<AWSAccessKeyId>MYACCESSKEYID</AWSAccessKeyId>' & _ 
    '<Timestamp>2006-03-01T12:00:00.183Z</Timestamp>' & _ 
    '<Signature>MYSECRETSIGNATURE</Signature>' & _ 
'</ListAllMyBuckets>' & _ 
'</soap:body>' & _ 
'</soap:envelope>' 

; Set up to post to our local server 
$objHTTP.open ("post", "https://s3.amazonaws.com/soap", False) 

; Set a standard SOAP/ XML header for the content-type 
$objHTTP.setRequestHeader ("xmlns:aws", "http://security.amazonaws.com/doc/2007-01-01/") 

Make the SOAP call 
$objHTTP.send ($strEnvelope) 

; Get the return envelope 
$strReturn = $objHTTP.responseText 

; ConsoleWrite("Debug : "& $strReturn & @CR & @CR) 

; Load the return envelope into a DOM 
$objReturn.loadXML ($strReturn) 

ConsoleWrite("Return of the SOAP Msg : " & @CR & $objReturn.XML & @CR & @CR) 

; Query the return envelope 
$strQuery = "SOAP:Envelope/SOAP:Body/ListAllMyBuckets" 

$dblTax = $objReturn.selectSingleNode($strQuery) 
$Soap = $objReturn.Text 

MsgBox(0,"SOAP Response",$Soap) 

答えて

0

これはあなたを助けている場合、私は知らないが、AutoItの部分からすべてがうまくあなたがアマゾンから入手答え作品「soapenvを:Client.badRequest欠落SOAPActionヘッダーは、」それは実際にあなたとworng何かを言うことを意味し要求。 -namely:SOAPActionヘッダーがありません

あなたが得たのは実際には応答でしたが、サーバーからのエラー応答でした。 http://docs.aws.amazon.com/AWSSimpleQueueService/2008-01-01/SQSDeveloperGuide/index.html?MakingRequests_MakingSOAPRequestsArticle.html

:私はここに最も関連の記述を見つけたリクエスト

を書き換えしようとしていることをお勧め

関連する問題