soap4juddi 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 935ba2fd41b33c29a30a9e20f71575cfa79cd693
4
+ data.tar.gz: 1f9d2ce6109f5ccab9c90b5cdc37bc5f96ae73c1
5
+ SHA512:
6
+ metadata.gz: 74cc52f6a11e59e890efbf57b6e7a0e2dc08bc328d70d0b1f1c8f41590bcd6481bda8487fbbfd24a97e622c6c6263c96e16290d830f811c6868f9cfadbf87a2b
7
+ data.tar.gz: dca5e53eb54bf03b8618636193a466ee1a354e800b826a7d60217e000acec3a4622471c6166bdabd1f667285671cbe53a8c07c9f4a648b7bd08aa2864ac2ce37
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in soap4juddi.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Ernst van Graan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # Soap4juddi
2
+
3
+ Soap4juddi provides connector, xml and brokerage facilities to interested consumers. It takes care of talking http or https SOAP to a jUDDI instance, as well as a means of translating the consumer's business domain into the jUDDI business domain (businesses, entities, bindings, etc.)
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'soap4juddi'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install soap4juddi
20
+
21
+ ## Usage
22
+
23
+ @urns = { 'base' => ServiceRegistry::BASE_URN,
24
+ 'company' => ServiceRegistry::REGISTRY_URN,
25
+ 'domains' => ServiceRegistry::DOMAINS_URN,
26
+ 'teams' => ServiceRegistry::TEAMS_URN,
27
+ 'services' => ServiceRegistry::SERVICES_URN,
28
+ 'service-components' => ServiceRegistry::SERVICE_COMPONENTS_URN}
29
+ broker = ::Soap4juddi::Broker.new(@urns)
30
+ broker.set_uri('https://uddi.server.com:1234')
31
+ broker.authenticate('user', 'credential')
32
+ broker.save_service_element('service-name', 'service-description', 'service-definition-uri', @urns['services'], 'generated-business-key')
33
+ etc...
34
+
35
+ ## Development
36
+
37
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
38
+
39
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
+
41
+ ## Contributing
42
+
43
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/soap4juddi. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
44
+
45
+
46
+ ## License
47
+
48
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
49
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "soap4juddi"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,261 @@
1
+ module Soap4juddi
2
+ class Broker
3
+ def initialize(urns)
4
+ @urns = urns
5
+ @soap_connector = Soap4juddi::Connector.new
6
+ @soap_xml = Soap4juddi::XML.new
7
+ end
8
+
9
+ def set_uri(uri)
10
+ @base_uri = uri
11
+ end
12
+
13
+ def auth_body
14
+ @soap_xml.element_with_key_value("authInfo", "authtoken", @auth_token)
15
+ end
16
+
17
+ def save_element_bindings(service, bindings, urn, description)
18
+ body = auth_body
19
+ if (not bindings.nil?) and (not (bindings.size == 0))
20
+ bindings.each do |binding|
21
+ access_point = @soap_xml.element_with_value('accessPoint', binding, {'URLType' => extract_binding_url_type(binding)})
22
+ description = @soap_xml.element_with_value('description', description)
23
+ model_instance_details = @soap_xml.element_with_value('tModelInstanceDetails', '')
24
+ bindingTemplate = @soap_xml.element_with_value("bindingTemplate",
25
+ "#{description}#{access_point}#{model_instance_details}",
26
+ {'bindingKey' => '', 'serviceKey' => "#{urn}#{service}"})
27
+ body = body + bindingTemplate
28
+ end
29
+ end
30
+ @soap_connector.request_soap(@base_uri, 'publishv2', 'save_binding', body) do | res|
31
+ res.body
32
+ end
33
+ end
34
+
35
+ def save_business(key, name, description)
36
+ body = @soap_xml.element_with_value("name", name)
37
+ if description
38
+ description.each do |desc|
39
+ xml = @soap_xml.element_with_value('description', desc, {'xml:lang' => 'en'})
40
+ body = "#{body}#{xml}" if desc and not (desc == "")
41
+ end
42
+ end
43
+
44
+ businessEntity = @soap_xml.element_with_value('businessEntity', body, {'businessKey' => key})
45
+ @soap_connector.request_soap(@base_uri,
46
+ 'publishv2', 'save_business',
47
+ "#{auth_body} #{businessEntity}") do | res|
48
+ extract_business(res.body)
49
+ end
50
+ end
51
+
52
+ def get_business(key)
53
+ @soap_connector.request_soap(@base_uri, 'inquiryv2', 'get_businessDetail', @soap_xml.element_with_value('businessKey', key)) do |res|
54
+ extract_business(res.body)
55
+ end
56
+ end
57
+
58
+ def find_business(pattern)
59
+ qualifiers = @soap_xml.element_with_value('findQualifiers', @soap_xml.element_with_value('findQualifier', 'approximateMatch'))
60
+ xml = @soap_xml.element_with_value('name', pattern)
61
+ @soap_connector.request_soap(@base_uri, 'inquiryv2', 'find_business', "#{qualifiers} #{xml}") do |res|
62
+ extract_business_entries(res.body)
63
+ end
64
+ end
65
+
66
+ def delete_business(key)
67
+ xml = @soap_xml.element_with_value('businessKey', key)
68
+ @soap_connector.request_soap(@base_uri, 'publishv2', 'delete_business',
69
+ "#{auth_body} #{xml}") do |res|
70
+ { 'errno' => extract_errno(res.body) }
71
+ end
72
+ end
73
+
74
+ def find_services(pattern)
75
+ qualifier1 = @soap_xml.element_with_value('findQualifier', 'approximateMatch')
76
+ qualifier2 = @soap_xml.element_with_value('findQualifier', 'orAllKeys')
77
+ qualifiers = @soap_xml.element_with_value('findQualifiers', "#{qualifier1}#{qualifier2}")
78
+ xml = @soap_xml.element_with_value('name', pattern)
79
+ @soap_connector.request_soap(@base_uri, 'inquiryv2', 'find_service', "#{qualifiers} #{xml}") do |res|
80
+ extract_service_entries_elements(res.body, @urns['services'])
81
+ end
82
+ end
83
+
84
+ def find_service_components(pattern)
85
+ qualifier1 = @soap_xml.element_with_value('findQualifier', 'approximateMatch')
86
+ qualifier2 = @soap_xml.element_with_value('findQualifier', 'orAllKeys')
87
+ qualifiers = @soap_xml.element_with_value('findQualifiers', "#{qualifier1}#{qualifier2}")
88
+ xml = @soap_xml.element_with_value('name', pattern)
89
+ @soap_connector.request_soap(@base_uri, 'inquiryv2', 'find_service', "#{qualifiers} #{xml}") do |res|
90
+ extract_service_entries_elements(res.body, @urns['service-components'])
91
+ end
92
+ end
93
+
94
+ def find_element_bindings(name, urn)
95
+ @soap_connector.request_soap(@base_uri, 'inquiryv2', 'get_serviceDetail', @soap_xml.element_with_value('serviceKey', "#{urn}#{name}")) do |res|
96
+ extract_bindings(res.body)
97
+ end
98
+ end
99
+
100
+ def delete_binding(binding)
101
+ xml = @soap_xml.element_with_value('bindingKey', binding)
102
+ @soap_connector.request_soap(@base_uri, 'publishv2', 'delete_binding', "#{auth_body} #{xml}") do |res|
103
+ { 'errno' => extract_errno(res.body) }
104
+ end
105
+ end
106
+
107
+ def get_service_element(name, urn)
108
+ key = name.include?(urn) ? name : "#{urn}#{name}"
109
+ xml = @soap_xml.element_with_value('serviceKey', key)
110
+ @soap_connector.request_soap(@base_uri, 'inquiryv2', 'get_serviceDetail', "#{xml}") do |res|
111
+ { 'name' => extract_name(res.body),
112
+ 'description' => extract_descriptions(res.body),
113
+ 'definition' => extract_service_definition(res.body) }
114
+ end
115
+ end
116
+
117
+ def save_service_element(name, description, definition, urn, business_key)
118
+ # byebug
119
+ service_details = @soap_xml.element_with_value('name', name)
120
+ if description
121
+ description.each do |desc|
122
+ service_details = service_details + @soap_xml.element_with_value('description', desc, { 'xml:lang' => 'en' }) if desc and not (desc == "")
123
+ end
124
+ end
125
+ if definition and not (definition.strip == "")
126
+ keyedReference = @soap_xml.element_with_value('keyedReference', '', {'tModelKey' => 'uddi:uddi.org:wadl:types', 'keyName' => 'service-definition', 'keyValue' => definition})
127
+ service_details = service_details + @soap_xml.element_with_value('categoryBag', keyedReference)
128
+ end
129
+ xml = @soap_xml.element_with_value('businessService', service_details, {'businessKey' => business_key, 'serviceKey' => "#{urn}#{name}"})
130
+
131
+ body = "#{auth_body} #{xml}"
132
+
133
+ @soap_connector.request_soap(@base_uri, 'publishv2', 'save_service', body) do | res|
134
+ extract_service(res.body)
135
+ end
136
+ end
137
+
138
+ def delete_service_element(name, urn)
139
+ service_key = @soap_xml.element_with_value('serviceKey', "#{urn}#{name}")
140
+ @soap_connector.request_soap(@base_uri, 'publishv2', 'delete_service', "#{auth_body} #{service_key}") do |res|
141
+ { 'errno' => extract_errno(res.body) }
142
+ end
143
+ end
144
+
145
+ def extract_service(soap)
146
+ entries = {}
147
+ entries[@soap_xml.extract_id(soap, 'serviceKey')] = extract_name(soap)
148
+ entries
149
+ end
150
+
151
+ def extract_service_entries_elements(soap, urn)
152
+ entries = {}
153
+ entry = soap[/<ns2:serviceInfos>(.*?)<\/ns2:serviceInfos>/, 1]
154
+ while entry do
155
+ service = entry[/<ns2:serviceInfo (.*?)<\/ns2:serviceInfo>/, 1]
156
+ break if service.nil?
157
+ id = @soap_xml.extract_id(service, 'serviceKey')
158
+ entries[id.gsub(urn, "")] = { 'id' => id, 'name' => extract_name(service) } if id.include?(urn)
159
+ entry[/<ns2:serviceInfo (.*?)<\/ns2:serviceInfo>/, 1] = ""
160
+ entry.gsub!("<ns2:serviceInfo </ns2:serviceInfo>", "")
161
+ entry = nil if entry.strip == ""
162
+ end
163
+ { 'services' => entries }
164
+ end
165
+
166
+ def extract_business(soap)
167
+ entries = {}
168
+ entries[@soap_xml.extract_id(soap, 'businessKey').gsub(@urns['domains'], "")] = { 'name' => extract_name(soap), 'description' => extract_descriptions(soap) }
169
+ entries
170
+ end
171
+
172
+ def extract_business_entries(soap)
173
+ entries = {}
174
+ entry = soap[/<ns2:businessList (.*?)<\/ns2:businessList>/, 1]
175
+ while entry do
176
+ business = entry[/<ns2:businessInfo (.*?)<\/ns2:businessInfo>/, 1]
177
+ break if business.nil?
178
+ business[/<ns2:serviceInfos(.*?)<\/ns2:serviceInfos>/, 1] = "" if business[/<ns2:serviceInfos(.*?)<\/ns2:serviceInfos>/, 1]
179
+ id = @soap_xml.extract_id(entry, 'businessKey')
180
+ entries[id.gsub(@urns['domains'], "")] = { 'id' => id, 'name' => extract_name(business) }
181
+ entry[/<ns2:businessInfo (.*?)<\/ns2:businessInfo>/, 1] = ""
182
+ entry.gsub!("<ns2:businessInfo </ns2:businessInfo>", "")
183
+ entry = nil if entry.strip == ""
184
+ end
185
+ { 'businesses' => entries }
186
+ end
187
+
188
+ def extract_errno(soap)
189
+ soap[/<ns2:result errno="(.*?)"\/>/, 1]
190
+ end
191
+
192
+ def check_availability
193
+ result = `curl -S #{@base_uri}/juddiv3 2>&1`
194
+ not(result.downcase.include?("fail"))
195
+ end
196
+
197
+ def authenticate(auth_user, auth_password)
198
+ @soap_connector.authenticate(auth_user, auth_password)
199
+ end
200
+
201
+ def authorize
202
+ @auth_token = @soap_connector.authorize(@base_uri)
203
+ end
204
+
205
+ private
206
+
207
+ def extract_service_definition(soap)
208
+ soap[/<ns2:keyedReference tModelKey="uddi:uddi.org:wadl:types" keyName="service-definition" keyValue="(.*?)"\/>/, 1]
209
+ end
210
+
211
+ def extract_bindings(soap)
212
+ entries = {}
213
+ entry = soap[/<ns2:bindingTemplates>(.*?)<\/ns2:bindingTemplates>/, 1]
214
+ while entry do
215
+ binding = entry[/<ns2:bindingTemplate (.*?)<\/ns2:bindingTemplate>/, 1]
216
+ break if binding.nil?
217
+ id = @soap_xml.extract_id(binding, 'bindingKey')
218
+ entries[id] = {'access_point' => extract_access_point(binding), 'description' => extract_description(binding)}
219
+ entry[/<ns2:bindingTemplate (.*?)<\/ns2:bindingTemplate>/, 1] = ""
220
+ entry.gsub!("<ns2:bindingTemplate </ns2:bindingTemplate>", "")
221
+ entry = nil if entry.strip == ""
222
+ end
223
+ { 'bindings' => entries }
224
+ end
225
+
226
+ def extract_access_point(soap)
227
+ soap[/^.*>(.*?)<\/ns2:accessPoint>/, 1]
228
+ end
229
+
230
+ def extract_name(soap)
231
+ name = soap[/<ns2:name xml:lang="en">(.*?)<\/ns2:name>/, 1]
232
+ name ||= soap[/<ns2:name>(.*?)<\/ns2:name>/, 1]
233
+ name
234
+ end
235
+
236
+ def extract_description(soap)
237
+ description = soap[/<ns2:description xml:lang="en">(.*?)<\/ns2:description>/, 1]
238
+ description ||= soap[/<ns2:description>(.*?)<\/ns2:description>/, 1]
239
+ description
240
+ end
241
+
242
+ def extract_descriptions(soap)
243
+ descriptions = []
244
+ description = soap[/<ns2:description xml:lang="en">(.*?)<\/ns2:description>/, 1]
245
+ while description do
246
+ descriptions << description
247
+ soap.gsub!("<ns2:description xml:lang=\"en\">#{description}<\/ns2:description>", "")
248
+ description = soap[/<ns2:description xml:lang="en">(.*?)<\/ns2:description>/, 1]
249
+ end
250
+ descriptions
251
+ end
252
+
253
+ def extract_binding_url_type(binding)
254
+ url_type = nil
255
+ url_type = 'https' if binding.include?('https')
256
+ url_type = 'http' if (not binding.include?('https') and binding.include?('http'))
257
+ url_type ||= 'unknown'
258
+ url_type
259
+ end
260
+ end
261
+ end
@@ -0,0 +1,70 @@
1
+ module Soap4juddi
2
+ class Connector
3
+ include Soap4juddi::JSender
4
+
5
+ def initialize
6
+ @soap_xml = Soap4juddi::XML.new
7
+ end
8
+
9
+ def authenticate(auth_user, auth_password)
10
+ @auth_user = auth_user
11
+ @auth_password =auth_password
12
+ end
13
+
14
+ def authorize(base_uri)
15
+ @auth_token = '' # clear any existing token
16
+ result = execute(build_authorization_request(base_uri)) do |res|
17
+ @auth_token = (res.body.split('authtoken:')[1]).split('<')[0]
18
+ end
19
+ @auth_token
20
+ end
21
+
22
+ def request_soap(base_uri, version, service, request, attr = nil, &block)
23
+ req = connection(base_uri, version, service)
24
+ req.body = @soap_xml.soap_envelope(request, service, attr)
25
+ execute(req) do |res|
26
+ block.call(res)
27
+ end
28
+ end
29
+
30
+ def execute(req, &block)
31
+ res = Net::HTTP.start(@uri.hostname, @uri.port) do |http|
32
+ http.request(req)
33
+ end
34
+
35
+ jsend_result(res, block)
36
+ end
37
+
38
+ private
39
+
40
+ def build_authorization_request(base_uri)
41
+ req = connection(base_uri, 'security', 'get_authToken')
42
+ auth = @soap_xml.element_with_value('get_authToken', '', {'userID' => @auth_user, 'cred' => @auth_password})
43
+ req.body = @soap_xml.envelope_header_body(auth)
44
+ req
45
+ end
46
+
47
+ def connection(base_uri, service, action)
48
+ @uri = URI("#{base_uri}/juddiv3/services/#{service}")
49
+ req = Net::HTTP::Post.new(@uri)
50
+ req.content_type = @soap_xml.content_type
51
+ req['SOAPAction'] = action
52
+ req
53
+ end
54
+
55
+ def jsend_result(res, block)
56
+ case res
57
+ when Net::HTTPSuccess
58
+ return soap_success(res, block)
59
+ else
60
+ return fail(res.body)
61
+ end
62
+ end
63
+
64
+ def soap_success(res, block)
65
+ result = block.call(res) if block
66
+ return success_data(result) if result
67
+ return success
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,50 @@
1
+ module Soap4juddi
2
+ module JSender
3
+ def report(status, message, result = nil)
4
+ data = compile_data(result)
5
+ data['notifications'] = message.is_a?(Array) ? message : [ message ]
6
+ { 'status' => status, 'data' => data }
7
+ end
8
+
9
+ def fail(message = nil, data = nil)
10
+ message ||= 'fail'
11
+ report('fail', message, data)
12
+ end
13
+
14
+ def fail_data(data = nil)
15
+ fail(nil, data)
16
+ end
17
+
18
+ def success_data(data = nil)
19
+ success(nil, data)
20
+ end
21
+
22
+ def success(message = nil, data = nil)
23
+ message ||= 'success'
24
+ report('success', message, data)
25
+ end
26
+
27
+ def has_data?(result, key = nil)
28
+ return false if key.nil?
29
+ return false if (result.nil?) or (result['data'].nil?)
30
+ return false if (not key.nil?) and (result['data'][key].nil?)
31
+ true
32
+ end
33
+
34
+ def notifications_include?(result, pattern)
35
+ return false if not has_data?(result, 'notifications')
36
+ result['data']['notifications'].to_s.include?(pattern)
37
+ end
38
+
39
+ private
40
+
41
+ def compile_data(result)
42
+ data ||= {}
43
+ result = { 'result' => result} if not result.is_a? Hash
44
+ result.each do |key, value|
45
+ data[key] = value
46
+ end
47
+ data
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,3 @@
1
+ module Soap4juddi
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,43 @@
1
+ module Soap4juddi
2
+ class XML
3
+ def element_with_key_value(element, key, value, attributes = nil)
4
+ element_with_value(element, "#{key}:#{value}")
5
+ end
6
+
7
+ def element_with_value(element, value, attributes = nil)
8
+ xml = "<urn:#{element}"
9
+ xml = append_key_value_attributes_to_xml(xml, attributes) if attributes
10
+ xml = "#{xml}>#{value}</urn:#{element}>"
11
+ end
12
+
13
+ def extract_id(soap, type)
14
+ soap[/#{type}="(.*?)"/, 1]
15
+ end
16
+
17
+ def envelope_header_body(text, version = 3)
18
+ "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:urn='urn:uddi-org:api_v#{version}'> <soapenv:Header/> <soapenv:Body> #{text} </soapenv:Body> </soapenv:Envelope>"
19
+ end
20
+
21
+ def soap_envelope(message, urn = nil, attr = nil)
22
+ text = ""
23
+ text = text + "<urn:#{urn} generic='2.0' xmlns='urn:uddi-org:api_v2' " + (attr.nil? ? "" : attr) + ">" if urn
24
+ text = text + message
25
+ text = text + "</urn:#{urn}>" if urn
26
+ envelope_header_body(text, 2)
27
+ end
28
+
29
+ def content_type
30
+ 'text/xml;charset=UTF-8'
31
+ end
32
+
33
+ private
34
+
35
+ def append_key_value_attributes_to_xml(xml, attributes)
36
+ attributes.each do |k, v|
37
+ v = "'#{v}'" if v.is_a?(String)
38
+ xml = "#{xml} #{k}=#{v}"
39
+ end
40
+ xml
41
+ end
42
+ end
43
+ end
data/lib/soap4juddi.rb ADDED
@@ -0,0 +1,8 @@
1
+ require "soap4juddi/version"
2
+ require 'soap4juddi/jsender'
3
+ require 'soap4juddi/xml'
4
+ require 'soap4juddi/connector'
5
+ require 'soap4juddi/broker'
6
+
7
+ module Soap4juddi
8
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'soap4juddi/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "soap4juddi"
8
+ spec.version = Soap4juddi::VERSION
9
+ spec.authors = ["Ernst van Graan"]
10
+ spec.email = ["ernst.van.graan@hetzner.co.za"]
11
+
12
+ spec.summary = %q{Provides connector, xml and brokerage facilities to a jUDDI consumer}
13
+ spec.description = %q{Provides connector, xml and brokerage facilities to a jUDDI consumer}
14
+ #spec.homepage = "https://github.com:hetznerZA/soap4juddi.git"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec"
25
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: soap4juddi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ernst van Graan
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Provides connector, xml and brokerage facilities to a jUDDI consumer
56
+ email:
57
+ - ernst.van.graan@hetzner.co.za
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".travis.yml"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bin/console
70
+ - bin/setup
71
+ - lib/soap4juddi.rb
72
+ - lib/soap4juddi/broker.rb
73
+ - lib/soap4juddi/connector.rb
74
+ - lib/soap4juddi/jsender.rb
75
+ - lib/soap4juddi/version.rb
76
+ - lib/soap4juddi/xml.rb
77
+ - soap4juddi.gemspec
78
+ homepage:
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.4.6
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Provides connector, xml and brokerage facilities to a jUDDI consumer
102
+ test_files: []