Created
March 5, 2015 07:32
-
-
Save quezacoatl/7f55bc833b103aa7f378 to your computer and use it in GitHub Desktop.
AWS SDK 2.0.29 XML parsing issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
#gem 'nokogiri' | |
gem 'aws-sdk', '~> 2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
aws-sdk (2.0.29) | |
aws-sdk-resources (= 2.0.29) | |
aws-sdk-core (2.0.29) | |
builder (~> 3.0) | |
jmespath (~> 1.0) | |
multi_json (~> 1.0) | |
multi_xml (~> 0.5) | |
aws-sdk-resources (2.0.29) | |
aws-sdk-core (= 2.0.29) | |
builder (3.2.2) | |
jmespath (1.0.2) | |
multi_json (~> 1.0) | |
multi_json (1.11.0) | |
multi_xml (0.5.5) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
aws-sdk (~> 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'aws-sdk' | |
sqs = Aws::SQS::Client.new | |
shape = sqs.config.api.operation(:receive_message).output | |
shape = Seahorse::Model::Shapes::Structure.new({ | |
'members' => { | |
shape.metadata('resultWrapper') => shape.definition, | |
'ResponseMetadata' => { | |
'type' => 'structure', | |
'members' => { | |
'RequestId' => { 'type' => 'string' } | |
} | |
} | |
} | |
}, shape_map: shape.shape_map) | |
xml = "<ReceiveMessageResponse>\n <ReceiveMessageResult>\n </ReceiveMessageResult>\n <ResponseMetadata>\n <RequestId>19643011-2310-45d0-8611-e8eaaccc550e</RequestId>\n </ResponseMetadata>\n</ReceiveMessageResponse>\n" | |
Aws::Xml::Parser.new(shape).parse(xml) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment