![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
ActiveMatrix imposes certain limitations on WCF services that serve as WCF Host components. There are general limitations that apply to all WCF services and specific limitations that concern the WCF attributes and attribute properties supported by WCF Host components.
It is expected that all proxy references within the WCF implementation code are closed once they are no longer used. This is required for the WCF services hosted within TIBCO ActiveMatrix Service Grid to release resources. If proxy references are not closed, resources are leaked and performance is adversly affected.WCF services that are hosted in ActiveMatrix interact with clients and other services via ActiveMatrix communication channels. In other words, a WCF Host component does not use a WCF channel to communicate between other ActiveMatrix services or clients external to ActiveMatrix.
• Configure the channel in runtime code (for example, the code in the main method of an existing self hosted WCF service will not be executed). It must be configured in the app.config file.
• Support sessionful WCF services. All the deployed services are stateless services and each request is handled as if the binding were sessionless.
• Endpoint bindings for WCF Host components are not used at runtime. Only the service behavior of the endpoint is preserved. All other endpoint configuration is disregarded.
• Endpoint binding information for client endpoints (partners) are also disregarded at runtime with the exception of the service behavior and timeout settings (OpenTimeout, CloseTimeout, ReceiveTimeout, SendTimeout).
• Client proxy variables (used to reference ActiveMatrix Service Grid partner services) must be explicity closed. If the client proxies are not closed, threads in the node process grow eventually resulting in the following error:Here is a sample showing a service implementation method which is referencing an ActiveMatrix Service Grid service using the clientProxy varaible.In WCF, a service is defined as a group of operations known as a service contract. You define an operation by creating a method and annotating it with the OperationContract attribute. To create a service contract, you group together the operations by declaring them within an interface annotated with the ServiceContract attribute.Once you have designed and implemented the service contract, you can configure the execution behavior of the service runtime. To configure the behavior, you mark service classes with ServiceBehavior attributes and service methods with OperationBehavior attributes. The following sections list supported and unsupported attributes and attribute properties.
InstanceContextMode (WCF hosted services behave like sessionless call. If PerSession or Singleton is set, the service will behave as PerCall.)
SessionMode (can only use default value of Allowed)To invoke a service from a WCF Host component, you generate a proxy class (See WCF documentation for information on how to generate a proxy class) and invoke the proxy class in the WCF Host component implementation.
1. Create the proxy instance using the prototype that has an endpointConfigurationName as the only parameter.
2. The standard output and error streams from WCF Host component implementations are directed to the Management Daemon console.Within ActiveMatrix, a global, static, preconfigured TraceSource named Funcs.ts is provided for WCF Host component implementations. You can directly use this TraceSource in your implementation:Funcs.ts.TraceEvent(TraceEventType.Warning, 8820, "ValidationCallBack: Matching schema not found. No validation occurred. " + args.Message);
The size of the message supplied to a TraceSource method should be less than 2K. Messages that are longer are truncated.To control where log messages are directed, you set the logging configuration for the WCF Host container or the WCF Host service unit that contains the component implementation. For information on logging configurations, see Working with Logging Configurations in TIBCO ActiveMatrix Administration.
• If you configure file-based logging for the WCF Host container, the log statements are sent to the specified log(s), depending on where you have specified the log roll over.
• If you configure file-based logging for WCF Host service units, the log statements from the Java portion of the Service Assembly (SA) or Service Unit (SU) framework are sent to the specified log(s), depending on where you have specified the log roll over.Since the ActiveMatrix WCF Host container consists of Java, C++, and C# code, a separate log file is created for each AppDomain in the hosted CLR. Each WCF Host component is assigned its own AppDomain. There is one log file for the default AppDomain (CLRHost_DefaultDomain.log) and one log for each AppDomain hosting a component implementation. The AppDomain log files contain log statements from both C# portion of the container and from the application code that uses the Funcs.ts log object.
To use the Funcs.ts object, the application needs to reference the AMXServicesSupport.dll provided by TIBCO.Since the AppDomain log files use the standard Microsoft text TraceListener, the log statements are not in CBEF format, so cannot be imported into TIBCO Business Studio.
1. Begin with the file name entered in the logging configuration in ActiveMatrix Administrator. Remove the trailing suffix .log if it exists. For a file named MyService.log the component is:
3. Append the AppDomain.CurrentDomain.FriendlyName component. The procedure for constructing this component is described in AppDomain Name.
− If the name of the composite is hw, the namespace of the composite is http://www.example.com/hw/ (this can be changed in the composite’s property page in the Composite Editor, if needed) and
− If the component name is HelloWorld, the AppDomain.CurrentDomain.FriendlyName is www_example_com_hw__HelloWorld.MyService_www_example_com_hw__HelloWorld
4. Append .log.MyService_www_example_com_hw__HelloWorld.logEach AppDomain must have a unique name. TIBCO uses an algorithm to generate this unique AppDomain name. The algorithm concatenates the following strings, each separated by an underscore:
• Normalize the composite namespace after removing the leading "http://". To normalize means replacing reserved file characters with underscores. The reserved characters include periods and slashes.targetNamespace="http://www.example.com/hw/" and component name = HelloWorldComp yields the AppDomain Name: www_example_com_hw__HelloWorldComp
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |