service-model
Version:
An object oriented web service framework inspired by Windows Communication Foundation.
33 lines (32 loc) • 1.01 kB
JavaScript
/**
* Service and Endpoint Behavior that enabled debugging information to be sent to the client.
*
* <uml>
* hide members
* hide circle
* EndpointBehavior <|.. DebugBehavior
* ServiceBehavior <|.. DebugBehavior
* </uml>
*/
var DebugBehavior = (function () {
function DebugBehavior() {
}
DebugBehavior.prototype.applyEndpointBehavior = function (description, endpoint) {
this._enableDebugging(endpoint);
};
DebugBehavior.prototype.applyServiceBehavior = function (description, service) {
for (var i = 0; i < service.endpoints.length; i++) {
this._enableDebugging(service.endpoints[i]);
}
};
/**
* Enables debugging information in error messages for an endpoint.
* @param endpoint The target endpoint.
* @hidden
*/
DebugBehavior.prototype._enableDebugging = function (endpoint) {
endpoint.includeErrorDetailInFault = true;
};
return DebugBehavior;
})();
exports.DebugBehavior = DebugBehavior;