1 require 'soap/header/simplehandler' 2 3 class ClientAuthHeaderHandler < SOAP::Header::SimpleHandler 4 SessionHeader = XSD::QName.new("rn:enterprise.soap.sforce.com", "SessionHeader") 5 6 attr_accessor :sessionid 7 def initialize 8 super(SessionHeader) 9 @sessionid = nil 10 end 11 12 def on_simple_outbound 13 if @sessionid 14 {"sessionId" => @sessionid} 15 end 16 end 17 18 def on_simple_inbound(my_header, mustunderstand) 19 @sessionid = my_header["sessionid"] 20 end 21 end 22