Skip to content

Commit 8986e16

Browse files
author
Likitha Shetty
committed
CLOUDSTACK-2576. AWS API not returning values in CFSimpleXML Object format.
PHP SDK calls the CFSimpleXML parser class to parse the response body into CFSimpleXML Object format. In AWSAPI added an XML declaration during serialization of Axis beans to XML output
1 parent a2fea4d commit 8986e16

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

awsapi/src/com/cloud/bridge/service/EC2RestServlet.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,8 +2043,9 @@ private void serializeResponse(HttpServletResponse response, ADBBean EC2Response
20432043
throws ADBException, XMLStreamException, IOException {
20442044
OutputStream os = response.getOutputStream();
20452045
response.setStatus(200);
2046-
response.setContentType("text/xml; charset=UTF-8");
2046+
response.setContentType("text/xml");
20472047
XMLStreamWriter xmlWriter = xmlOutFactory.createXMLStreamWriter( os );
2048+
xmlWriter.writeStartDocument("UTF-8","1.0");
20482049
MTOMAwareXMLSerializer MTOMWriter = new MTOMAwareXMLSerializer( xmlWriter );
20492050
MTOMWriter.setDefaultNamespace("http://ec2.amazonaws.com/doc/" + wsdlVersion + "/");
20502051
EC2Response.serialize( null, factory, MTOMWriter );

0 commit comments

Comments
 (0)