soap4juddi 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0d1a1249516ba00f7fe56b5a9c73bd8f5d58398
4
- data.tar.gz: bf997e14beb7b601b736ca21b7f048fbb7528276
3
+ metadata.gz: 16f70f47a54d2f93ac133783fedcc0549eddf715
4
+ data.tar.gz: 0509ffefcfac10a9147de7631de7cef67e2dd5a8
5
5
  SHA512:
6
- metadata.gz: 6269ef19ee7b9c0d2317bc3168ff0821d0f3b4f0a161330da21a546c3e5a87f36fbd324ff70cba3096a913ca66d7600b9c4c04068690eea133b9668feba5ed37
7
- data.tar.gz: ad166661af40c0b6a67a911f0fecc3c6110eba297eef1d41120b1610c16d5a1a2229e35db536abbba451049c6d2b000526dacc91cd782e73c8494404fe0b6b7d
6
+ metadata.gz: b902b04aa09cb11a0307ed796367dd9475cd3aac8701edb666a48356a496128a417473d84f5584d8cf0b360d1b27adbb4f153ea4e892ba808742f7e70e3b2c1c
7
+ data.tar.gz: 2d84e731433767fd57358e0d66ac167f9ccfa449ceb6c27bd6fa95101bbfbc06191e0289837dd2211935743dc6ea00ea3a517baafb638f69e5da5149c2873df5
@@ -1,3 +1,6 @@
1
+ require 'soap4juddi/xml'
2
+ require 'soap4juddi/connector'
3
+
1
4
  module Soap4juddi
2
5
  class Broker
3
6
  def initialize(urns)
@@ -115,7 +118,9 @@ module Soap4juddi
115
118
  end
116
119
 
117
120
  def save_service_element(name, description, definition, urn, business_key)
118
- # byebug
121
+ # preserve bindings
122
+ bindings = find_element_bindings_access_points(name, urn)['data']['result']
123
+
119
124
  service_details = @soap_xml.element_with_value('name', name)
120
125
  if description
121
126
  description.each do |desc|
@@ -130,9 +135,14 @@ module Soap4juddi
130
135
 
131
136
  body = "#{auth_body} #{xml}"
132
137
 
133
- @soap_connector.request_soap(@base_uri, 'publishv2', 'save_service', body) do | res|
138
+ result = @soap_connector.request_soap(@base_uri, 'publishv2', 'save_service', body) do | res|
134
139
  extract_service(res.body)
135
140
  end
141
+
142
+ #restore bindings
143
+ save_element_bindings(name, bindings, urn, '')
144
+
145
+ result
136
146
  end
137
147
 
138
148
  def delete_service_element(name, urn)
@@ -205,6 +215,12 @@ module Soap4juddi
205
215
 
206
216
  private
207
217
 
218
+ def find_element_bindings_access_points(name, urn)
219
+ @soap_connector.request_soap(@base_uri, 'inquiryv2', 'get_serviceDetail', @soap_xml.element_with_value('serviceKey', "#{urn}#{name}")) do |res|
220
+ extract_bindings_access_points(res.body)
221
+ end
222
+ end
223
+
208
224
  def extract_service_definition(soap)
209
225
  soap[/<ns2:keyedReference tModelKey="uddi:uddi.org:wadl:types" keyName="service-definition" keyValue="(.*?)"\/>/, 1]
210
226
  end
@@ -224,6 +240,21 @@ module Soap4juddi
224
240
  { 'bindings' => entries }
225
241
  end
226
242
 
243
+ def extract_bindings_access_points(soap)
244
+ entries = []
245
+ entry = soap[/<ns2:bindingTemplates>(.*?)<\/ns2:bindingTemplates>/, 1]
246
+ while entry do
247
+ binding = entry[/<ns2:bindingTemplate (.*?)<\/ns2:bindingTemplate>/, 1]
248
+ break if binding.nil?
249
+ id = @soap_xml.extract_id(binding, 'bindingKey')
250
+ entries << extract_access_point(binding)
251
+ entry[/<ns2:bindingTemplate (.*?)<\/ns2:bindingTemplate>/, 1] = ""
252
+ entry.gsub!("<ns2:bindingTemplate </ns2:bindingTemplate>", "")
253
+ entry = nil if entry.strip == ""
254
+ end
255
+ entries
256
+ end
257
+
227
258
  def extract_access_point(soap)
228
259
  soap[/^.*>(.*?)<\/ns2:accessPoint>/, 1]
229
260
  end
@@ -1,3 +1,5 @@
1
+ require 'net/http'
2
+
1
3
  module Soap4juddi
2
4
  class Connector
3
5
  include Soap4juddi::JSender
@@ -1,3 +1,3 @@
1
1
  module Soap4juddi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soap4juddi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernst van Graan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-28 00:00:00.000000000 Z
11
+ date: 2015-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.10'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Provides connector, xml and brokerage facilities to a jUDDI consumer
@@ -59,9 +59,9 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ".gitignore"
63
- - ".rspec"
64
- - ".travis.yml"
62
+ - .gitignore
63
+ - .rspec
64
+ - .travis.yml
65
65
  - Gemfile
66
66
  - LICENSE.txt
67
67
  - README.md
@@ -85,18 +85,19 @@ require_paths:
85
85
  - lib
86
86
  required_ruby_version: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ">="
88
+ - - '>='
89
89
  - !ruby/object:Gem::Version
90
90
  version: 2.0.0
91
91
  required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
93
+ - - '>='
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.4.6
98
+ rubygems_version: 2.0.14
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Provides connector, xml and brokerage facilities to a jUDDI consumer
102
102
  test_files: []
103
+ has_rdoc: