fixed issue 153: correct 500 status if there is a SOAP fault
This commit is contained in:
+7
-1
@@ -4830,9 +4830,15 @@ class Service(object):
|
|||||||
for method, (function, returns, args, doc) in procedures.iteritems():
|
for method, (function, returns, args, doc) in procedures.iteritems():
|
||||||
dispatcher.register_function(method, function, returns, args, doc)
|
dispatcher.register_function(method, function, returns, args, doc)
|
||||||
if request.env.request_method == 'POST':
|
if request.env.request_method == 'POST':
|
||||||
|
fault = {}
|
||||||
# Process normal Soap Operation
|
# Process normal Soap Operation
|
||||||
response.headers['Content-Type'] = 'text/xml'
|
response.headers['Content-Type'] = 'text/xml'
|
||||||
return dispatcher.dispatch(request.body.read())
|
xml = dispatcher.dispatch(request.body.read(), fault=fault)
|
||||||
|
if fault:
|
||||||
|
# May want to consider populating a ticket here...
|
||||||
|
response.status = 500
|
||||||
|
# return the soap response
|
||||||
|
return xml
|
||||||
elif 'WSDL' in request.vars:
|
elif 'WSDL' in request.vars:
|
||||||
# Return Web Service Description
|
# Return Web Service Description
|
||||||
response.headers['Content-Type'] = 'text/xml'
|
response.headers['Content-Type'] = 'text/xml'
|
||||||
|
|||||||
Reference in New Issue
Block a user