Class: XDS::XdsRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service_url, action, message_id = XdsHeader.new_message_id) ⇒ XdsRequest

Returns a new instance of XdsRequest.



8
9
10
11
12
13
# File 'lib/xds/xds_request.rb', line 8

def initialize(service_url,action,message_id = XdsHeader.new_message_id)
  @header = XDS::XdsHeader.new(service_url,action,message_id)
  @endpoint_uri = service_url
  @proxy_host = XDS.proxy_config[:host]
  @proxy_port = XDS.proxy_config[:port]
end

Instance Attribute Details

#endpoint_uriObject

Returns the value of attribute endpoint_uri.



4
5
6
# File 'lib/xds/xds_request.rb', line 4

def endpoint_uri
  @endpoint_uri
end

#headerObject

Returns the value of attribute header.



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

def header
  @header
end

#proxy_hostObject

Returns the value of attribute proxy_host.



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

def proxy_host
  @proxy_host
end

#proxy_portObject

Returns the value of attribute proxy_port.



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

def proxy_port
  @proxy_port
end

Instance Method Details

#executeObject



20
21
22
23
24
25
26
# File 'lib/xds/xds_request.rb', line 20

def execute
  client = create_client
  post = PostMethod.new(endpoint_uri)
  post.request_entity = StringRequestEntity.new(to_soap, 'application/soap+xml', 'UTF-8')
  client.executeMethod(post)
  post
end

#to_soap(builder = Builder::XmlMarkup.new(:indent => 2), attributes = {}) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/xds/xds_request.rb', line 28

def to_soap(builder = Builder::XmlMarkup.new(:indent => 2),attributes={})
  builder.instruct!
  builder.soapenv(:Envelope, 
                "xmlns:soapenv" => "http://www.w3.org/2003/05/soap-envelope",
                 "xmlns"=>"http://www.w3.org/2003/05/soap-envelope",
                 "xmlns:wsa" =>"http://www.w3.org/2005/08/addressing") do
    header.endpoint_uri = endpoint_uri
    header.to_soap(builder)
    to_soap_body(builder, attributes)
  end
end

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



40
41
42
# File 'lib/xds/xds_request.rb', line 40

def to_soap_body(builder,attributes={})
  raise "Implement Me, Really!!!!"
end