Question

I was hoping one of you could help me with the use of AWS Kinesis. I have been pouring over the documentation and I am still unable to post a "blob" of data to a Kinesis stream.

In the API the standard POST request is as follows.

POST / HTTP/1.1
Host: kinesis.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;
date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Kinesis_20131202.PutRecord
{
"StreamName": "exampleStreamName",
"Data": "XzxkYXRhPl8x",
"PartitionKey": "partitionKey"
}

Using "Postman" a google chrome app to make Http requests and filling in the appropriate information for the above fields I cannot for the life of me figure out how to make a successful data post to a stream. I was unable to do this successfully so i went on to do use the .NET SDK for visual studio.

I made a quick command line c# console application I am still having some issues.

My code: http://pastebin.com/cyJeC0vU

The error message, System.Xml.XmlException was unhandled, appears on line 61 of the code: http://pastebin.com/HEG7DmMw

Has anyone had a successful experience using AWS Kinesis. I would love to pick your brain / repay you somehow for a bit of tutoring.

Thanks again for all of your help!

Était-ce utile?

La solution

The error you're getting indicates that the response from the service was not able to be parsed. There is a clue in that the SDK switched from the JSON parser to the XML parser because the response looked like XML. This usually indicates that you are behind a proxy which requires authentication, and the proxy is giving you an HTML error message.

You can verify this by firing up a protocol analyzer like Fiddler and watching the request traffic. If your proxy requires credentials, here is some documentation about using the AWS SDK for .NET with proxies:

Configuring Credentials for Your AWS SDK for .NET Application

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top