Class: XDS::RegistryStoredQueryResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/xds/registry_stored_query_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistryStoredQueryResponse

Returns a new instance of RegistryStoredQueryResponse.



5
6
7
8
# File 'lib/xds/registry_stored_query_response.rb', line 5

def initialize
  @retrieved_metadata = []
  @request_successful = false
end

Instance Attribute Details

#retrieved_metadataObject (readonly)

Returns the value of attribute retrieved_metadata.



3
4
5
# File 'lib/xds/registry_stored_query_response.rb', line 3

def 
  @retrieved_metadata
end

Instance Method Details

#parse_soap_response(soap_xml) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/xds/registry_stored_query_response.rb', line 14

def parse_soap_response(soap_xml)
  doc = REXML::Document.new(StringIO.new(soap_xml))
  status = REXML::XPath.first(doc, 
              '/soapenv:Envelope/soapenv:Body/query:AdhocQueryResponse/@status',
              COMMON_NAMESPACES)
  if status.to_s.eql?('urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Success')
    @request_successful = true
    REXML::XPath.each(doc, 
                '/soapenv:Envelope/soapenv:Body/query:AdhocQueryResponse/rim:RegistryObjectList/rim:ExtrinsicObject',
                COMMON_NAMESPACES) do |eo|
       = Metadata.new
      .load_from_extrinsic_object(eo)
      @retrieved_metadata << 
    end
  end
end

#request_successful?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/xds/registry_stored_query_response.rb', line 10

def request_successful?
  @request_successful
end