require 'soap/header/simplehandler' class ShipmentRequestHeader < CustomHeader NAMESPACE = 'http://WS.G4SI.COM/' def initialize(shipment_request) @shipment_request = shipment_request super(XSD::QName.new(NAMESPACE, 'ShipmentRequest')) end def on_simple_outbound to_hash(@shipment_request) #{"Username" => @username, "Password" => @password, "AccessKey"=>@accessKey} end end