# File lib/casclient/responses.rb, line 106
    def parse(raw_text)
      raise BadResponseException, 
        "CAS response is empty/blank." if raw_text.blank?
      @parse_datetime = Time.now
      
      @xml = check_and_parse_xml(raw_text)
      
      if is_success?
        @proxy_ticket = @xml.elements["cas:proxyTicket"].text.strip if @xml.elements["cas:proxyTicket"]
      elsif is_failure?
        @failure_code = @xml.elements['//cas:proxyFailure'].attributes['code']
        @failure_message = @xml.elements['//cas:proxyFailure'].text.strip
      else
        # this should never happen, since the response should already have been recognized as invalid
        raise BadResponseException, "BAD CAS RESPONSE:\n#{raw_text.inspect}\n\nXML DOC:\n#{doc.inspect}"
      end
      
    end