ee-soa-service
Advanced tools
Comparing version 0.2.43 to 0.2.44
@@ -318,2 +318,3 @@ | ||
/** | ||
@@ -323,4 +324,6 @@ * handles Outgoing orm controller requests | ||
, _handleRequest: function(req, callback) { | ||
var collection = req.getCollection(); | ||
var collection = req.getCollection() | ||
, response; | ||
if (debugService) log.info('[DefaultService] Outgoing request for '+[this.name, req.getCollection(), req.getActionName()].join('.')+' ...'); | ||
@@ -337,4 +340,18 @@ | ||
var res = new SOAResponse(); | ||
res.on('end', function(status, result) { | ||
// we may have gotten a soa response instead of a callback | ||
if (type.object(callback)) { | ||
response = callback; | ||
if (debugService) { | ||
response.once('end', function(status, result) { | ||
log.info('[DefaultService] Outgoing request for '+[this.name, req.getCollection(), req.getActionName()].join('.')+' responded with the status «'+status+'» ...'); | ||
}.bind(this)); | ||
} | ||
} | ||
// we need to make our own response object | ||
else { | ||
response = new SOAResponse(); | ||
response.once('end', function(status, result) { | ||
var err = null; | ||
@@ -347,7 +364,10 @@ if(result && result.error) err = result; | ||
}.bind(this)); | ||
} | ||
// keep the request internal? | ||
if(this._hasController(collection)) { | ||
if (debugService) log.debug('[DefaultService] Hanbdling request internally ...'); | ||
this.request(req, res); | ||
this.request(req, response); | ||
} | ||
@@ -357,6 +377,12 @@ else { | ||
this.emit('request', req, res); | ||
this.emit('request', req, response); | ||
} | ||
} | ||
, _handleResponse: function(err, result, req, callback, status, headers) { | ||
@@ -363,0 +389,0 @@ |
@@ -5,3 +5,3 @@ { | ||
, "keywords" : ["ee", "soa", "service"] | ||
, "version" : "0.2.43" | ||
, "version" : "0.2.44" | ||
, "author": { | ||
@@ -8,0 +8,0 @@ "name" : "Tobias Kneubuehler" |
84871
1419