|
|
|
@ -14,8 +14,6 @@
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
# from soaplib.wsgi import Application
|
|
|
|
|
# from spyne import Application
|
|
|
|
|
from spyne.server.wsgi import WsgiApplication
|
|
|
|
|
|
|
|
|
|
import re
|
|
|
|
@ -295,8 +293,10 @@ class ClApplication(WsgiApplication):
|
|
|
|
|
logger.critical("Couldn't get method name from HTTP_SOAPACTION")
|
|
|
|
|
return retval
|
|
|
|
|
|
|
|
|
|
#rips sid param from soap request (if there is one)
|
|
|
|
|
def get_sid_from_soap(self, http_req_env):
|
|
|
|
|
"""
|
|
|
|
|
rips sid param from soap request (if there is one)
|
|
|
|
|
"""
|
|
|
|
|
if (not "wsgi.input" in http_req_env):
|
|
|
|
|
return None
|
|
|
|
|
length = http_req_env.get("CONTENT_LENGTH")
|
|
|
|
@ -315,6 +315,9 @@ class ClApplication(WsgiApplication):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_rpc(self, req_env, start_response):
|
|
|
|
|
"""
|
|
|
|
|
Overriding spyne.wsgiApplication method
|
|
|
|
|
"""
|
|
|
|
|
import OpenSSL
|
|
|
|
|
import threading
|
|
|
|
|
http_resp_headers = {
|
|
|
|
@ -331,21 +334,10 @@ class ClApplication(WsgiApplication):
|
|
|
|
|
if method_name is None:
|
|
|
|
|
resp = "Could not extract method name from the request!"
|
|
|
|
|
http_resp_headers['Content-Length'] = str(len(resp))
|
|
|
|
|
# print("Method name could not be resolved")
|
|
|
|
|
start_response(HTTP_500, http_resp_headers.items())
|
|
|
|
|
return [resp]
|
|
|
|
|
|
|
|
|
|
# print(method_name)
|
|
|
|
|
|
|
|
|
|
service = self.app.services[0]
|
|
|
|
|
# descriptor = service.public_methods.get(method_name)
|
|
|
|
|
# service1 = self.app.services[0]
|
|
|
|
|
# service2 = self.app.services[1]
|
|
|
|
|
# a = service1.public_methods.get(method_name)
|
|
|
|
|
# b = service2.public_methods.get(method_name)
|
|
|
|
|
# descriptor = a if a else b
|
|
|
|
|
# service = service1 if a else service2
|
|
|
|
|
|
|
|
|
|
import threading
|
|
|
|
|
|
|
|
|
|
curthread = threading.currentThread()
|
|
|
|
@ -366,7 +358,6 @@ class ClApplication(WsgiApplication):
|
|
|
|
|
method_name[5:]))
|
|
|
|
|
resp = "Permission denied: " + method_name
|
|
|
|
|
http_resp_headers['Content-Length'] = str(len(resp))
|
|
|
|
|
# print("PERMISSION DENIED")
|
|
|
|
|
start_response(HTTP_403, http_resp_headers.items())
|
|
|
|
|
return [resp]
|
|
|
|
|
if sid:
|
|
|
|
|