kuji-cube 1.5.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.
- data/.document +5 -0
- data/.gitignore +53 -0
- data/.rspec +2 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +82 -0
- data/LICENSE.txt +20 -0
- data/README.md +69 -0
- data/Rakefile +38 -0
- data/kuji-cube.gemspec +28 -0
- data/lib/cube/cube.rb +154 -0
- data/lib/cube/olap_result.rb +13 -0
- data/lib/cube/version.rb +3 -0
- data/lib/cube/xmla.rb +9 -0
- data/lib/cube.rb +2 -0
- data/lib/wsdl/xmla.xml +104 -0
- data/spec/cassettes/.yml +40 -0
- data/spec/cassettes/formatted_values.yml +183 -0
- data/spec/cassettes/kvartovi_u_recima.yml +167 -0
- data/spec/cassettes/kvatovi_u_koloni.yml +169 -0
- data/spec/cassettes/member_query.yml +331 -0
- data/spec/cassettes/mondrian_broj_intervencija.yml +269 -0
- data/spec/cassettes/mondrian_jedan_red_odgovor.yml +171 -0
- data/spec/cassettes/mondrian_nula_redaka.yml +159 -0
- data/spec/cassettes/mondrian_scalar_value.yml +166 -0
- data/spec/cassettes/mondrian_vrati_samo_jedan_broj.yml +166 -0
- data/spec/cassettes/razlog_prijave_i_kvart.yml +219 -0
- data/spec/cube_spec.rb +143 -0
- data/spec/spec_helper.rb +53 -0
- metadata +112 -0
data/.document
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# rcov generated
|
2
|
+
coverage
|
3
|
+
|
4
|
+
# rdoc generated
|
5
|
+
rdoc
|
6
|
+
|
7
|
+
# yard generated
|
8
|
+
doc
|
9
|
+
.yardoc
|
10
|
+
|
11
|
+
# bundler
|
12
|
+
.bundle
|
13
|
+
|
14
|
+
*.un~
|
15
|
+
|
16
|
+
*.swp
|
17
|
+
|
18
|
+
# jeweler generated
|
19
|
+
pkg
|
20
|
+
|
21
|
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
22
|
+
#
|
23
|
+
# * Create a file at ~/.gitignore
|
24
|
+
# * Include files you want ignored
|
25
|
+
# * Run: git config --global core.excludesfile ~/.gitignore
|
26
|
+
#
|
27
|
+
# After doing this, these files will be ignored in all your git projects,
|
28
|
+
# saving you from having to 'pollute' every project you touch with them
|
29
|
+
#
|
30
|
+
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
31
|
+
#
|
32
|
+
# For MacOS:
|
33
|
+
#
|
34
|
+
#.DS_Store
|
35
|
+
|
36
|
+
# For TextMate
|
37
|
+
#*.tmproj
|
38
|
+
#tmtags
|
39
|
+
|
40
|
+
# For emacs:
|
41
|
+
#*~
|
42
|
+
#\#*
|
43
|
+
#.\#*
|
44
|
+
|
45
|
+
# For vim:
|
46
|
+
#*.swp
|
47
|
+
|
48
|
+
# For redcar:
|
49
|
+
#.redcar
|
50
|
+
|
51
|
+
# For rubinius:
|
52
|
+
#*.rbc
|
53
|
+
.rvmrc
|
data/.rspec
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
group :development, :test do
|
6
|
+
gem "ruby-debug", :platforms => :mri_18
|
7
|
+
#for 1.9.3
|
8
|
+
#bash < <(curl -L https://raw.github.com/gist/1333785)
|
9
|
+
gem 'linecache19', '>= 0.5.13', :platforms => :mri_19
|
10
|
+
gem 'ruby-debug-base19', '>= 0.11.26', :platforms => :mri_19
|
11
|
+
gem 'ruby-debug19', :require => 'ruby-debug', :platforms => :mri_19
|
12
|
+
gem "vcr"
|
13
|
+
gem "rspec", "~> 2.8.0"
|
14
|
+
gem "bundler", ">= 1.0.0"
|
15
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cube (1.4.0)
|
5
|
+
savon
|
6
|
+
webmock
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.2.6)
|
12
|
+
akami (1.0.0)
|
13
|
+
gyoku (>= 0.4.0)
|
14
|
+
archive-tar-minitar (0.5.2)
|
15
|
+
builder (3.0.0)
|
16
|
+
columnize (0.3.6)
|
17
|
+
crack (0.3.1)
|
18
|
+
diff-lcs (1.1.3)
|
19
|
+
gyoku (0.4.4)
|
20
|
+
builder (>= 2.1.2)
|
21
|
+
httpi (0.9.5)
|
22
|
+
rack
|
23
|
+
linecache (0.46)
|
24
|
+
rbx-require-relative (> 0.0.4)
|
25
|
+
linecache19 (0.5.13)
|
26
|
+
ruby_core_source (>= 0.1.4)
|
27
|
+
nokogiri (1.5.0)
|
28
|
+
nokogiri (1.5.0-java)
|
29
|
+
nori (1.0.2)
|
30
|
+
rack (1.4.1)
|
31
|
+
rbx-require-relative (0.0.9)
|
32
|
+
rspec (2.8.0)
|
33
|
+
rspec-core (~> 2.8.0)
|
34
|
+
rspec-expectations (~> 2.8.0)
|
35
|
+
rspec-mocks (~> 2.8.0)
|
36
|
+
rspec-core (2.8.0)
|
37
|
+
rspec-expectations (2.8.0)
|
38
|
+
diff-lcs (~> 1.1.2)
|
39
|
+
rspec-mocks (2.8.0)
|
40
|
+
ruby-debug (0.10.4)
|
41
|
+
columnize (>= 0.1)
|
42
|
+
ruby-debug-base (~> 0.10.4.0)
|
43
|
+
ruby-debug-base (0.10.4)
|
44
|
+
linecache (>= 0.3)
|
45
|
+
ruby-debug-base19 (0.11.26)
|
46
|
+
columnize (>= 0.3.1)
|
47
|
+
linecache19 (>= 0.5.11)
|
48
|
+
ruby_core_source (>= 0.1.4)
|
49
|
+
ruby-debug19 (0.11.6)
|
50
|
+
columnize (>= 0.3.1)
|
51
|
+
linecache19 (>= 0.5.11)
|
52
|
+
ruby-debug-base19 (>= 0.11.19)
|
53
|
+
ruby_core_source (0.1.5)
|
54
|
+
archive-tar-minitar (>= 0.5.2)
|
55
|
+
savon (0.9.7)
|
56
|
+
akami (~> 1.0)
|
57
|
+
builder (>= 2.1.2)
|
58
|
+
gyoku (>= 0.4.0)
|
59
|
+
httpi (~> 0.9)
|
60
|
+
nokogiri (>= 1.4.0)
|
61
|
+
nori (~> 1.0)
|
62
|
+
wasabi (~> 2.0)
|
63
|
+
vcr (1.11.3)
|
64
|
+
wasabi (2.0.0)
|
65
|
+
nokogiri (>= 1.4.0)
|
66
|
+
webmock (1.7.10)
|
67
|
+
addressable (~> 2.2, > 2.2.5)
|
68
|
+
crack (>= 0.1.7)
|
69
|
+
|
70
|
+
PLATFORMS
|
71
|
+
java
|
72
|
+
ruby
|
73
|
+
|
74
|
+
DEPENDENCIES
|
75
|
+
bundler (>= 1.0.0)
|
76
|
+
cube!
|
77
|
+
linecache19 (>= 0.5.13)
|
78
|
+
rspec (~> 2.8.0)
|
79
|
+
ruby-debug
|
80
|
+
ruby-debug-base19 (>= 0.11.26)
|
81
|
+
ruby-debug19
|
82
|
+
vcr
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 drKreso
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
Cube
|
2
|
+
================
|
3
|
+
|
4
|
+
Talk to the OLAP based backend via XMLA SOAP messages from Ruby.
|
5
|
+
You can send (simple) MDX queries and get the result back in a human friendly from.
|
6
|
+
|
7
|
+
Installation
|
8
|
+
------------
|
9
|
+
Add to Gemfile
|
10
|
+
|
11
|
+
```
|
12
|
+
gem 'cube'
|
13
|
+
```
|
14
|
+
|
15
|
+
Configuration
|
16
|
+
--------------
|
17
|
+
Set up your catalog and endpoint
|
18
|
+
|
19
|
+
```
|
20
|
+
XMLA.configure do |c|
|
21
|
+
c.catalog = "OUTAGE"
|
22
|
+
c.endpoint = "http://localhost:8383/mondrian/xmla"
|
23
|
+
end
|
24
|
+
```
|
25
|
+
|
26
|
+
Querying the OLAP
|
27
|
+
-------
|
28
|
+
```
|
29
|
+
table = XMLA::Cube.execute <<-MDX
|
30
|
+
SELECT [Location].[City].children on COLUMNS,
|
31
|
+
[Measures].[Count] on ROWS
|
32
|
+
FROM [OUTAGE]"
|
33
|
+
MDX
|
34
|
+
```
|
35
|
+
Table has two attributes: header and rows.
|
36
|
+
|
37
|
+
Scalar results
|
38
|
+
-----------
|
39
|
+
```
|
40
|
+
average_mtbf = XMLA::Cube.execute_scalar <<-MDX
|
41
|
+
SELECT {Hierarchize({[Measures].[MTBF]})} ON COLUMNS
|
42
|
+
FROM [OUTAGE]
|
43
|
+
WHERE [Country].[Croatia]
|
44
|
+
MDX
|
45
|
+
```
|
46
|
+
|
47
|
+
Limitations
|
48
|
+
------------
|
49
|
+
* No drill down (fails to even parse the result)
|
50
|
+
* No multi named columns
|
51
|
+
* Tested only with icCube and Mondrian XMLA, in theory works with every XMLA provider
|
52
|
+
|
53
|
+
Contributing to cube
|
54
|
+
-------------------------------
|
55
|
+
|
56
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
57
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
58
|
+
* Fork the project
|
59
|
+
* Start a feature/bugfix branch
|
60
|
+
* Commit and push until you are happy with your contribution
|
61
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
62
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
63
|
+
|
64
|
+
Copyright
|
65
|
+
----------
|
66
|
+
|
67
|
+
Copyright (c) 2012 drKreso. See LICENSE.txt for
|
68
|
+
further details.
|
69
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
|
6
|
+
$:.push File.expand_path("../lib", __FILE__)
|
7
|
+
require "cube/version"
|
8
|
+
|
9
|
+
begin
|
10
|
+
Bundler::GemHelper.install_tasks
|
11
|
+
rescue Bundler::BundlerError => e
|
12
|
+
$stderr.puts e.message
|
13
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
14
|
+
exit e.status_code
|
15
|
+
end
|
16
|
+
|
17
|
+
require 'rspec/core'
|
18
|
+
require 'rspec/core/rake_task'
|
19
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
20
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
22
|
+
|
23
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
24
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
25
|
+
spec.rcov = true
|
26
|
+
end
|
27
|
+
|
28
|
+
task :default => :spec
|
29
|
+
|
30
|
+
require 'rake/rdoctask'
|
31
|
+
Rake::RDocTask.new do |rdoc|
|
32
|
+
version = Cube::VERSION
|
33
|
+
|
34
|
+
rdoc.rdoc_dir = 'rdoc'
|
35
|
+
rdoc.title = "cube #{version}"
|
36
|
+
rdoc.rdoc_files.include('README*')
|
37
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
38
|
+
end
|
data/kuji-cube.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
$:.push File.expand_path("../lib", __FILE__)
|
4
|
+
require "cube/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.authors = ["drKreso", "stellard"]
|
8
|
+
gem.email = ["kresimir.bojcic@gmail.com", "scott@kujilabs.com"]
|
9
|
+
gem.description = "Eases the pain I had to go through to get to the data out of XMLA based OLAP provider(Mondiran, Pentaho, icCube)"
|
10
|
+
gem.summary = "Get's the data from OLAP cube via XMLA(Mondiran, Pentaho, icCube)"
|
11
|
+
gem.homepage = "http://github.com/kujilabs/cube"
|
12
|
+
gem.date = "2012-05-16"
|
13
|
+
|
14
|
+
|
15
|
+
gem.licenses = ["MIT"]
|
16
|
+
gem.files = `git ls-files`.split($\)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.name = "kuji-cube"
|
20
|
+
gem.require_paths = ["lib"]
|
21
|
+
gem.version = Cube::VERSION
|
22
|
+
|
23
|
+
|
24
|
+
gem.add_dependency "savon", ">= 0"
|
25
|
+
gem.add_dependency "webmock", ">= 0"
|
26
|
+
|
27
|
+
end
|
28
|
+
|
data/lib/cube/cube.rb
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
require 'savon'
|
2
|
+
require 'bigdecimal'
|
3
|
+
require_relative 'olap_result'
|
4
|
+
|
5
|
+
Savon.configure do |config|
|
6
|
+
config.soap_version = 1
|
7
|
+
config.log = false
|
8
|
+
end
|
9
|
+
|
10
|
+
HTTPI.log = false
|
11
|
+
|
12
|
+
module XMLA
|
13
|
+
|
14
|
+
class Cube
|
15
|
+
attr_reader :query, :catalog
|
16
|
+
|
17
|
+
def Cube.execute(query, catalog = XMLA.catalog)
|
18
|
+
OlapResult.new(Cube.new(query, catalog).as_table)
|
19
|
+
end
|
20
|
+
|
21
|
+
def Cube.execute_members(query, catalog = XMLA.catalog)
|
22
|
+
Cube.new(query, catalog).axes
|
23
|
+
end
|
24
|
+
|
25
|
+
def Cube.execute_scalar(query, catalog = XMLA.catalog)
|
26
|
+
BigDecimal.new Cube.new(query, catalog).as_table[0]
|
27
|
+
end
|
28
|
+
|
29
|
+
def as_table
|
30
|
+
return [table] if y_size == 0
|
31
|
+
clean_table(table, y_size).reduce([]) { |result, row| result << row.flatten }
|
32
|
+
end
|
33
|
+
|
34
|
+
def axes
|
35
|
+
axes = all_axes.select { |axe| axe[:@name] != "SlicerAxis" }
|
36
|
+
@axes ||= axes.reduce([]) do |result, axe|
|
37
|
+
result << tuple(axe).reduce([]) { |y, member|
|
38
|
+
data = (member[0] == :member) ? member[1] : member[:member]
|
39
|
+
if ( data.class == Hash || data.size == 1 )
|
40
|
+
y << [data[:caption].strip].flatten
|
41
|
+
else
|
42
|
+
y << data.select { |item_data| item_data.class == Hash }.reduce([]) do |z,item_data|
|
43
|
+
z << item_data[:caption].strip
|
44
|
+
end
|
45
|
+
end
|
46
|
+
}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
#header and rows
|
53
|
+
def table
|
54
|
+
if (header.size == 1 && y_size == 0)
|
55
|
+
cell_data[0]
|
56
|
+
else
|
57
|
+
(0...y_axe.size).reduce(header) do |result, j|
|
58
|
+
result << ( y_axe[j] + (0...x_size).map { |i| "#{cell_data[i + j]}" })
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def header
|
64
|
+
[ ( (0..y_size - 1).reduce([]) { |header| header << '' } << x_axe).flatten ]
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
def initialize(query, catalog)
|
69
|
+
@query = query
|
70
|
+
@catalog = catalog
|
71
|
+
@response = get_response
|
72
|
+
self
|
73
|
+
end
|
74
|
+
|
75
|
+
def get_response
|
76
|
+
client = Savon::Client.new do
|
77
|
+
wsdl.document = File.expand_path("../../wsdl/xmla.xml", __FILE__)
|
78
|
+
wsdl.endpoint = XMLA.endpoint
|
79
|
+
end
|
80
|
+
|
81
|
+
@response = client.request :execute, xmlns:"urn:schemas-microsoft-com:xml-analysis" do
|
82
|
+
soap.body = Cube.request_body(query, catalog)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
#cleanup table so items don't repeat (if they are same)
|
87
|
+
def clean_table(table, number_of_colums)
|
88
|
+
above_row = []
|
89
|
+
#filter if they are not last column, and they are same as the item on the row above
|
90
|
+
table.reduce([]) { |result, row|
|
91
|
+
result << row.each_with_index.map do |item,i|
|
92
|
+
if i == number_of_colums
|
93
|
+
item
|
94
|
+
else
|
95
|
+
item == above_row[i] ? '' : item
|
96
|
+
end
|
97
|
+
end
|
98
|
+
above_row = row
|
99
|
+
result
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
def cell_data
|
104
|
+
cell_data = @response.to_hash[:execute_response][:return][:root][:cell_data]
|
105
|
+
return [""] if cell_data.nil?
|
106
|
+
@data ||= cell_data.reduce([]) do |data, cell|
|
107
|
+
cell[1].reduce(data) do |data, value|
|
108
|
+
data << (value.class == Hash ? (value[:fmt_value] || value[:value]) : value[1] )
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
def tuple axe
|
114
|
+
axe[:tuples].nil? ? [] : axe[:tuples][:tuple]
|
115
|
+
end
|
116
|
+
|
117
|
+
def all_axes
|
118
|
+
@response.to_hash[:execute_response][:return][:root][:axes][:axis]
|
119
|
+
end
|
120
|
+
|
121
|
+
def x_axe
|
122
|
+
@x_axe ||= axes[0]
|
123
|
+
end
|
124
|
+
|
125
|
+
def y_axe
|
126
|
+
@y_axe ||= axes[1]
|
127
|
+
end
|
128
|
+
|
129
|
+
def y_size
|
130
|
+
(y_axe.nil? || y_axe[0].nil?) ? 0 : y_axe[0].size
|
131
|
+
end
|
132
|
+
|
133
|
+
def x_size
|
134
|
+
x_axe.size
|
135
|
+
end
|
136
|
+
|
137
|
+
def Cube.request_body(query, catalog)
|
138
|
+
<<-REQUEST
|
139
|
+
<Command>
|
140
|
+
<Statement> <![CDATA[ #{query} ]]> </Statement>
|
141
|
+
</Command>
|
142
|
+
<Properties>
|
143
|
+
<PropertyList>
|
144
|
+
<Catalog>#{catalog}</Catalog>
|
145
|
+
<Format>Multidimensional</Format>
|
146
|
+
<AxisFormat>TupleFormat</AxisFormat>
|
147
|
+
</PropertyList>
|
148
|
+
</Properties>
|
149
|
+
REQUEST
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
|
data/lib/cube/version.rb
ADDED
data/lib/cube/xmla.rb
ADDED
data/lib/cube.rb
ADDED
data/lib/wsdl/xmla.xml
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8' ?>
|
2
|
+
<!-- Generated 04/26/01 by Microsoft SOAP Toolkit WSDL File Generator, Version 1.00.623.0 -->
|
3
|
+
<definitions name ='msxmla' targetNamespace = 'http://tempuri.org/wsdl/'
|
4
|
+
xmlns:wsdlns='http://tempuri.org/wsdl/'
|
5
|
+
xmlns:typens='http://tempuri.org/type'
|
6
|
+
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
|
7
|
+
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
|
8
|
+
xmlns:stk='http://schemas.microsoft.com/soap-toolkit/wsdl-extension'
|
9
|
+
xmlns='http://schemas.xmlsoap.org/wsdl/'>
|
10
|
+
<types>
|
11
|
+
<schema targetNamespace='http://tempuri.org/type'
|
12
|
+
xmlns='http://www.w3.org/2001/XMLSchema'
|
13
|
+
xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
|
14
|
+
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
|
15
|
+
elementFormDefault='qualified'>
|
16
|
+
<complexType name ='clsXMLAProx.Discover.Result'>
|
17
|
+
<sequence>
|
18
|
+
<any minOccurs='0' maxOccurs='unbounded' namespace='#any' processContents='skip'/>
|
19
|
+
</sequence>
|
20
|
+
</complexType>
|
21
|
+
<complexType name ='clsXMLAProx.Discover.Restrictions'>
|
22
|
+
<sequence>
|
23
|
+
<any minOccurs='0' maxOccurs='unbounded' namespace='#any' processContents='skip'/>
|
24
|
+
</sequence>
|
25
|
+
</complexType>
|
26
|
+
<complexType name ='clsXMLAProx.Discover.Properties'>
|
27
|
+
<sequence>
|
28
|
+
<any minOccurs='0' maxOccurs='unbounded' namespace='#any' processContents='skip'/>
|
29
|
+
</sequence>
|
30
|
+
</complexType>
|
31
|
+
<complexType name ='clsXMLAProx.Execute.Result'>
|
32
|
+
<sequence>
|
33
|
+
<any minOccurs='0' maxOccurs='unbounded' namespace='#any' processContents='skip'/>
|
34
|
+
</sequence>
|
35
|
+
</complexType>
|
36
|
+
<complexType name ='clsXMLAProx.Execute.Command'>
|
37
|
+
<sequence>
|
38
|
+
<any minOccurs='0' maxOccurs='unbounded' namespace='#any' processContents='skip'/>
|
39
|
+
</sequence>
|
40
|
+
</complexType>
|
41
|
+
<complexType name ='clsXMLAProx.Execute.Properties'>
|
42
|
+
<sequence>
|
43
|
+
<any minOccurs='0' maxOccurs='unbounded' namespace='#any' processContents='skip'/>
|
44
|
+
</sequence>
|
45
|
+
</complexType>
|
46
|
+
</schema>
|
47
|
+
</types>
|
48
|
+
<message name='clsXMLAProx.Discover'>
|
49
|
+
<part name='RequestType' type='xsd:string'/>
|
50
|
+
<part name='Restrictions' type='typens:clsXMLAProx.Discover.Restrictions'/>
|
51
|
+
<part name='Properties' type='typens:clsXMLAProx.Discover.Properties'/>
|
52
|
+
</message>
|
53
|
+
<message name='clsXMLAProx.DiscoverResponse'>
|
54
|
+
<part name='Result' type='typens:clsXMLAProx.Discover.Result'/>
|
55
|
+
</message>
|
56
|
+
<message name='clsXMLAProx.Execute'>
|
57
|
+
<part name='Command' type='typens:clsXMLAProx.Execute.Command'/>
|
58
|
+
<part name='Properties' type='typens:clsXMLAProx.Execute.Properties'/>
|
59
|
+
</message>
|
60
|
+
<message name='clsXMLAProx.ExecuteResponse'>
|
61
|
+
<part name='Result' type='typens:clsXMLAProx.Execute.Result'/>
|
62
|
+
</message>
|
63
|
+
<portType name='clsXMLAProxSoapPort'>
|
64
|
+
<operation name='Discover' parameterOrder='RequestType Restrictions Properties'>
|
65
|
+
<input message='wsdlns:clsXMLAProx.Discover' />
|
66
|
+
<output message='wsdlns:clsXMLAProx.DiscoverResponse' />
|
67
|
+
</operation>
|
68
|
+
<operation name='Execute' parameterOrder='Command Properties'>
|
69
|
+
<input message='wsdlns:clsXMLAProx.Execute' />
|
70
|
+
<output message='wsdlns:clsXMLAProx.ExecuteResponse' />
|
71
|
+
</operation>
|
72
|
+
</portType>
|
73
|
+
<binding name='clsXMLAProxSoapBinding' type='wsdlns:clsXMLAProxSoapPort' >
|
74
|
+
<stk:binding preferredEncoding='UTF-8'/>
|
75
|
+
<soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http' />
|
76
|
+
<operation name='Discover' >
|
77
|
+
<soap:operation soapAction='urn:schemas-microsoft-com:xml-analysis:Discover' />
|
78
|
+
<input>
|
79
|
+
<soap:body use='encoded' namespace='urn:schemas-microsoft-com:xml-analysis'
|
80
|
+
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' />
|
81
|
+
</input>
|
82
|
+
<output>
|
83
|
+
<soap:body use='encoded' namespace='urn:schemas-microsoft-com:xml-analysis'
|
84
|
+
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' />
|
85
|
+
</output>
|
86
|
+
</operation>
|
87
|
+
<operation name='Execute' >
|
88
|
+
<soap:operation soapAction='urn:schemas-microsoft-com:xml-analysis:Execute' />
|
89
|
+
<input>
|
90
|
+
<soap:body use='encoded' namespace='urn:schemas-microsoft-com:xml-analysis'
|
91
|
+
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' />
|
92
|
+
</input>
|
93
|
+
<output>
|
94
|
+
<soap:body use='encoded' namespace='urn:schemas-microsoft-com:xml-analysis'
|
95
|
+
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' />
|
96
|
+
</output>
|
97
|
+
</operation>
|
98
|
+
</binding>
|
99
|
+
<service name='msxmla' >
|
100
|
+
<port name='clsXMLAProxSoapPort' binding='wsdlns:clsXMLAProxSoapBinding' >
|
101
|
+
<soap:address location='http://localhost/xmla/msxisapi.dll' />
|
102
|
+
</port>
|
103
|
+
</service>
|
104
|
+
</definitions>
|
data/spec/cassettes/.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: http://localhost:8383/mondrian/xmla
|
6
|
+
body: ! "<?xml version=\"1.0\" encoding=\"UTF-8\"?><env:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
|
7
|
+
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:wsdl=\"http://tempuri.org/wsdl/\"
|
8
|
+
xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ins0=\"http://tempuri.org/type\"><env:Body><Execute
|
9
|
+
xmlns=\"urn:schemas-microsoft-com:xml-analysis\"><Command> <Statement> <![CDATA[
|
10
|
+
\ ]]> </Statement> </Command> <Properties> <PropertyList> <Catalog></Catalog>\n
|
11
|
+
\ <Format>Multidimensional</Format> <AxisFormat>TupleFormat</AxisFormat>
|
12
|
+
</PropertyList> </Properties></Execute></env:Body></env:Envelope>"
|
13
|
+
headers:
|
14
|
+
soapaction:
|
15
|
+
- ! '"urn:schemas-microsoft-com:xml-analysis:Execute"'
|
16
|
+
content-type:
|
17
|
+
- text/xml;charset=UTF-8
|
18
|
+
content-length:
|
19
|
+
- '612'
|
20
|
+
response: !ruby/struct:VCR::Response
|
21
|
+
status: !ruby/struct:VCR::ResponseStatus
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
server:
|
26
|
+
- Apache-Coyote/1.1
|
27
|
+
content-type:
|
28
|
+
- text/xml
|
29
|
+
transfer-encoding:
|
30
|
+
- chunked
|
31
|
+
date:
|
32
|
+
- Sat, 11 Feb 2012 23:02:52 GMT
|
33
|
+
body: ! "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"
|
34
|
+
SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" >\n<SOAP-ENV:Header>\n</SOAP-ENV:Header>\n<SOAP-ENV:Body>\n<SOAP-ENV:Fault>\n
|
35
|
+
\ <faultcode>SOAP-ENV:Server.00HSBB01</faultcode>\n <faultstring>XMLA SOAP
|
36
|
+
Body processing error</faultstring>\n <faultactor>Mondrian</faultactor>\n <detail>\n
|
37
|
+
\ <XA:error xmlns:XA=\"http://mondrian.sourceforge.net\">\n <code>00HSBB01</code>\n
|
38
|
+
\ <desc>The Mondrian XML: Mondrian Error:Internal error: Unknown catalog
|
39
|
+
''</desc>\n </XA:error>\n </detail>\n</SOAP-ENV:Fault>\n</SOAP-ENV:Body>\n</SOAP-ENV:Envelope>\n"
|
40
|
+
http_version: '1.1'
|