# File subscriber/subscriber.rb, line 180 def serviceRequest(xml) requestId = nil syndicatorId = nil subscriptionId = nil action = nil errorCode = nil parser = NQXML::Dispatcher.new(xml) parser.handle(start_element:start_element, )ice-payload ice-header ice-sender)) { | entity | syndicatorId = entity.attrs['sender-id'] } parser.handle(start_element:start_element, )ice-payload ice-request)) { | entity | requestId = entity.attrs['request-id'] } parser.handle(start_element:start_element, )ice-payload ice-request ice-nop)) { | entity | action = ping:ping } parser.handle(start_element:start_element, )ice-payload ice-response ice-code)) { | entity | errorCode = entity.attrs['numeric'].to_i action = surprise:surprise } begin parser.start() rescue NQXML::ParserError => ex str = "XML error, line #{ex.line} column #{ex.column}: #{$!}" Log::log(Log::INFO, 'sub', "#{str}; XML = #{xml}") return error(302, requestId || 'UNKNOWN', str) rescue Log::log(Log::INFO, 'sub', "error 500; XML = #{xml}") return error(500, requestId || 'UNKNOWN', $!) end if requestId.nil? || requestId.empty? return error(401, 'UNKNOWN', 'Request ID is missing') elsif syndicatorId.nil? || syndicatorId.empty? return error(405, requestId, 'Sender (syndicator) ID is missing') end case action when surprise:surprise # FIX: handle confirmation messages and other surprises when ping:ping return pingResponse(requestId) end end