Class: Ronin::RPC::PHP::Response

Inherits:
RPC::Response
  • Object
show all
Defined in:
lib/ronin/rpc/php/response.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parserObject

Returns the default XML parser to use for parsing XMLRPC responses.



38
39
40
# File 'lib/ronin/rpc/php/response.rb', line 38

def Response.parser
  @@parser ||= XMLRPC::XMLParser::REXMLStreamParser.new
end

.parser=(new_parser) ⇒ Object



42
43
44
# File 'lib/ronin/rpc/php/response.rb', line 42

def Response.parser=(new_parser)
  @@parser = new_parser
end

Instance Method Details

#decodeObject

Decodes the XMLRPC response message embedded in the response from the server.



50
51
52
53
54
55
56
57
58
# File 'lib/ronin/rpc/php/response.rb', line 50

def decode
  response = @contents[/<rpc>.*<\/rpc>/m]

  unless response
    raise(ResponseMissing,"failed to receive a valid RPC method response",caller)
  end

  return Response.parser.parseMethodResponse(response)
end