Class: XDS::ProvideAndRegisterDocumentSetBXop

Inherits:
MTOMXopRequest show all
Defined in:
lib/xds/provide_and_register_document_set_b_xop.rb

Instance Attribute Summary

Attributes inherited from XdsRequest

#endpoint_uri, #header, #proxy_host, #proxy_port

Instance Method Summary collapse

Methods inherited from XdsRequest

#to_soap

Constructor Details

#initialize(service_url, metadata, document) ⇒ ProvideAndRegisterDocumentSetBXop

Returns a new instance of ProvideAndRegisterDocumentSetBXop.



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

def initialize(service_url,,document)
    super(service_url,"urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b")
     = 
    @document = document
end

Instance Method Details

#executeObject



30
31
32
33
# File 'lib/xds/provide_and_register_document_set_b_xop.rb', line 30

def execute
    post = super
    XDS::ProvideAndRegisterDocumentSetBXopResponse.new(self,post)     
end

#get_partsObject



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/xds/provide_and_register_document_set_b_xop.rb', line 35

def get_parts
  body_part =  XdsPart.new("body", to_soap)
  body_part.char_set="UTF-8"
  body_part.id = get_body_part_id
  body_part.set_content_type(%{application/xop+xml; type="application/soap+xml"})
  [body_part]
  #document_part = XdsPart.new("document",@document.to_s)   
 # document_part.char_set="UTF-8"
 # document_part.id=get_document_part_id       
 # [body_part,document_part]
end

#to_soap_body(builder, attributes = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/xds/provide_and_register_document_set_b_xop.rb', line 12

def to_soap_body(builder, attributes={}) 
  .id = "urn:uid:#{UUID.new.generate}" unless .id  
  builder.soapenv(:Body, attributes) do
    builder.xdsb(:ProvideAndRegisterDocumentSetRequest,"xmlns:lcm"=>"urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0",
                                                      "xmlns:rim"=>"urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0",
                                                      "xmlns:xdsb"=>"urn:ihe:iti:xds-b:2007") do 
        builder.lcm(:SubmitObjectsRequest) do
            
            .to_soap(builder)
          
        end
        builder.xdsb(:Document, {"id"=>.id}, Base64.b64encode(@document) ) 
    end
  end
end