* serialize method is called on the returned response object to obtain the extected
* response XML.
*/
private void attachVolume( HttpServletRequest request, HttpServletResponse response )
throws ADBException, XMLStreamException, IOException {
EC2Volume EC2request = new EC2Volume();
// -> all these parameters are required
String[] volumeId = request.getParameterValues( "VolumeId" );
if ( null != volumeId && 0 < volumeId.length )
EC2request.setId( volumeId[0] );
else { response.sendError(530, "Missing VolumeId parameter" ); return; }
String[] instanceId = request.getParameterValues( "InstanceId" );
if ( null != instanceId && 0 < instanceId.length )
EC2request.setInstanceId( instanceId[0] );
else { response.sendError(530, "Missing InstanceId parameter" ); return; }
String[] device = request.getParameterValues( "Device" );
if ( null != device && 0 < device.length )
EC2request.setDevice( device[0] );
else { response.sendError(530, "Missing Device parameter" ); return; }
// -> execute the request
AttachVolumeResponse EC2response = EC2SoapServiceImpl.toAttachVolumeResponse( ServiceProvider.getInstance().getEC2Engine().attachVolume( EC2request ));
serializeResponse(response, EC2response);