wmls 0.1.8 → 0.1.9
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/README +3 -1
- data/bin/wmls +8 -5
- data/lib/wmls.rb +10 -10
- metadata +1 -1
data/README
CHANGED
@@ -28,4 +28,6 @@ History:
|
|
28
28
|
|
29
29
|
10 Mar 2011 -- initial commit.
|
30
30
|
16 Oct 2011 -- added -D option to wmls command line tool (0.1.7)
|
31
|
-
01 May 2012 -- added GetCap support
|
31
|
+
01 May 2012 -- added GetCap support (0.1.8)
|
32
|
+
01 May 2012 -- added support for capabilitiesIn parameter to all calls (0.1.9)
|
33
|
+
|
data/bin/wmls
CHANGED
@@ -43,6 +43,9 @@ opts =OptionParser.new do |o|
|
|
43
43
|
o.on("-a", "--action ACTION", [:cap,:add,:get,:update,:delete], "WITSML action: cap, add, get, update, or delete (optional, default 'get')") do |v|
|
44
44
|
options[:action] = v || :get
|
45
45
|
end
|
46
|
+
o.on("-o", "--optionsin OPTIONSIN", "optionsIn string (optional)") do |v|
|
47
|
+
options[:optionsin] = v || ""
|
48
|
+
end
|
46
49
|
o.on_tail("-h", "--help", "Show this message") do
|
47
50
|
puts o
|
48
51
|
exit
|
@@ -82,15 +85,15 @@ wmls = Wmls.new options[:url], options[:user_name], options[:password]
|
|
82
85
|
|
83
86
|
case options[:action]
|
84
87
|
when :add
|
85
|
-
result = wmls.add_to_store(template)
|
88
|
+
result = wmls.add_to_store(template, options[:optionsin])
|
86
89
|
when :delete
|
87
|
-
result = wmls.delete_from_store(template)
|
90
|
+
result = wmls.delete_from_store(template, options[:optionsin])
|
88
91
|
when :update
|
89
|
-
result = wmls.update_in_store(template)
|
92
|
+
result = wmls.update_in_store(template, options[:optionsin])
|
90
93
|
when :cap
|
91
|
-
result = wmls.get_cap
|
94
|
+
result = wmls.get_cap options[:optionsin]
|
92
95
|
when :get,nil
|
93
|
-
result = wmls.get_from_store(template)
|
96
|
+
result = wmls.get_from_store(template, options[:optionsin])
|
94
97
|
else
|
95
98
|
raise "unsupported action #{options[:action]}"
|
96
99
|
end
|
data/lib/wmls.rb
CHANGED
@@ -62,7 +62,7 @@ END
|
|
62
62
|
end
|
63
63
|
|
64
64
|
# call WMLS_AddToStore with the given template
|
65
|
-
def add_to_store(template)
|
65
|
+
def add_to_store(template, optionsIn=nil)
|
66
66
|
wmlTypeIn = extract_type(template)
|
67
67
|
queryIn = escape_xml(template)
|
68
68
|
soap_action = 'http://www.witsml.org/action/120/Store.WMLS_AddToStore'
|
@@ -70,7 +70,7 @@ END
|
|
70
70
|
<ns0:WMLS_AddToStore SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
71
71
|
<WMLtypeIn>#{wmlTypeIn}</WMLtypeIn>
|
72
72
|
<XMLin>#{queryIn}</XMLin>
|
73
|
-
<OptionsIn>#{@optionsIn}</OptionsIn>
|
73
|
+
<OptionsIn>#{optionsIn || @optionsIn}</OptionsIn>
|
74
74
|
<CapabilitiesIn>#{@capabilitiesIn}</CapabilitiesIn>
|
75
75
|
</ns0:WMLS_AddToStore>
|
76
76
|
END
|
@@ -78,7 +78,7 @@ END
|
|
78
78
|
end
|
79
79
|
|
80
80
|
# call WMLS_DeleteStore with the given template
|
81
|
-
def delete_from_store(template)
|
81
|
+
def delete_from_store(template, optionsIn = nil)
|
82
82
|
wmlTypeIn = extract_type(template)
|
83
83
|
queryIn = escape_xml(template)
|
84
84
|
soap_action = 'http://www.witsml.org/action/120/Store.WMLS_DeleteFromStore'
|
@@ -86,7 +86,7 @@ END
|
|
86
86
|
<ns0:WMLS_DeleteFromStore SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
87
87
|
<WMLtypeIn>#{wmlTypeIn}</WMLtypeIn>
|
88
88
|
<QueryIn>#{queryIn}</QueryIn>
|
89
|
-
<OptionsIn>#{@optionsIn}</OptionsIn>
|
89
|
+
<OptionsIn>#{optionsIn || @optionsIn}</OptionsIn>
|
90
90
|
<CapabilitiesIn>#{@capabilitiesIn}</CapabilitiesIn>
|
91
91
|
</ns0:WMLS_DeleteFromStore>
|
92
92
|
END
|
@@ -94,7 +94,7 @@ END
|
|
94
94
|
end
|
95
95
|
|
96
96
|
# call WMLS_UpdateInStore with the given template
|
97
|
-
def update_in_store(template)
|
97
|
+
def update_in_store(template, optionsIn=nil)
|
98
98
|
wmlTypeIn = extract_type(template)
|
99
99
|
queryIn = escape_xml(template)
|
100
100
|
soap_action = 'http://www.witsml.org/action/120/Store.WMLS_UpdateInStore'
|
@@ -102,7 +102,7 @@ END
|
|
102
102
|
<ns0:WMLS_UpdateInStore SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
103
103
|
<WMLtypeIn>#{wmlTypeIn}</WMLtypeIn>
|
104
104
|
<XMLin>#{queryIn}</XMLin>
|
105
|
-
<OptionsIn>#{@optionsIn}</OptionsIn>
|
105
|
+
<OptionsIn>#{optionsIn || @optionsIn}</OptionsIn>
|
106
106
|
<CapabilitiesIn>#{@capabilitiesIn}</CapabilitiesIn>
|
107
107
|
</ns0:WMLS_UpdateInStore>
|
108
108
|
END
|
@@ -110,7 +110,7 @@ END
|
|
110
110
|
end
|
111
111
|
|
112
112
|
# call WMLS_GetFromStore with the given template
|
113
|
-
def get_from_store(template)
|
113
|
+
def get_from_store(template, optionsIn=nil)
|
114
114
|
wmlTypeIn = extract_type(template)
|
115
115
|
queryIn = escape_xml(template)
|
116
116
|
soap_action = 'http://www.witsml.org/action/120/Store.WMLS_GetFromStore'
|
@@ -118,18 +118,18 @@ END
|
|
118
118
|
<ns0:WMLS_GetFromStore SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
119
119
|
<WMLtypeIn>#{wmlTypeIn}</WMLtypeIn>
|
120
120
|
<QueryIn>#{queryIn}</QueryIn>
|
121
|
-
<OptionsIn>#{@optionsIn}</OptionsIn>
|
121
|
+
<OptionsIn>#{optionsIn || @optionsIn}</OptionsIn>
|
122
122
|
<CapabilitiesIn>#{@capabilitiesIn}</CapabilitiesIn>
|
123
123
|
</ns0:WMLS_GetFromStore>
|
124
124
|
END
|
125
125
|
return send envelope_middle, soap_action
|
126
126
|
end
|
127
127
|
|
128
|
-
def get_cap()
|
128
|
+
def get_cap(optionsIn=nil)
|
129
129
|
soap_action = 'http://www.witsml.org/action/120/Store.WMLS_GetCap'
|
130
130
|
envelope_middle = <<END
|
131
131
|
<ns0:WMLS_GetCap SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
132
|
-
<OptionsIn>#{@optionsIn}</OptionsIn>
|
132
|
+
<OptionsIn>#{optionsIn || @optionsIn}</OptionsIn>
|
133
133
|
</ns0:WMLS_GetCap>
|
134
134
|
END
|
135
135
|
return send envelope_middle, soap_action
|