InteropService
The InteropService WCF service is primarily used from the cms server instance to e.g. render items. Since the cms server instance knows nothing about the new macro and viper syntax (SXML), it is not capable to render items itself with its built-in render engine.
Therefore, each time a (pre)view for a specific item is requested, this request is passed to the Smartsite iXperion publication engine using the InteropService. This service will render the item and send it back to the cms server instance. Besides "normal" item rendering, the service provides AIM rendering mode as well.
The InteropService also provides several administrator options, available from the Options dialog of the cms manager, to e.g. reload the contenttypes, clear the module and/or data-cache (or All cache for that matter) of the publication engine server instance.
Furthermore, the service offers a method to validate content on its SXML syntax and/or schema-compliance against a variety of (x)html schemas.
The InteropService implements the IInteropService interface of which the class diagram is shown below. It is this interface which defines the contract of the service.
Interop Client
Whenever the cms server instance needs to call a method on the InteropService, it does not call that method directly. Since the cms server instance still uses COM, it is limited to using the Microsoft Soap Toolkit for webservice communication and it can not take advantage of the rich functionalities available in the Windows Communication Foundation (WCF) programming model, such as using named pipes instead of the http protocol.
To circumvent this issue, the cms server instance uses an Interop client, written in .NET, to make the actual calls. This way, we can take full advantage of the WCF framework. The assembly Smartsite.InteropServicesClient.dll provides this Interop client.
Because of using this Interop client, it is possible in the default implementation, with both the cms and the publication server instances running on the same machine, to use named pipes as protocol between the cms and the publication engine. It is therefore also only necessary to specify just a named pipe listener in the web.config for the InteropService, which makes it more secure (the service is externally not available).
Configuration
The configuration for the InteropService is, besides it should be registered within the services section within the smartsite.config file, limited to just two sections within the system.serviceModel node of the web.config configuration file.
First of all there should be a service node for the InteropService, which specifies the endpoint address, the binding and the contract. Second, within the bindings section there should be a binding node for the InteropService to overrule default binding specifications, in this case particularly the maximum received message size.
The example below shows the system.serviceModel section of a web.config file with just the necessary nodes for the InteropService.
XML | Copy Code |
---|---|
<system.serviceModel> <services> <service name="Smartsite.Core.Services.InteropService"> <endpoint address="net.pipe://localhost/sitename/InteropService" binding="netNamedPipeBinding" bindingNamespace="http://Smartsite.Webservices.InteropService" bindingConfiguration="InteropServiceBinding" contract="Smartsite.Core.Services.IInteropService" /> </service> </services> <bindings> <netNamedPipeBinding> <binding name="InteropServiceBinding" maxReceivedMessageSize="1048576"> <readerQuotas maxStringContentLength="1048576" /> </binding> </netNamedPipeBinding> </bindings> </system.serviceModel> |
Note that sitename in the address should be substituted with your site's name, or should be left out. However, it is adviced to use a sitename within the address, so when running multiple sites on the same machine, each address will be unique by means of the use of different sitenames.
Since a named pipe is always local to the machine, just use localhost for the machine-part of the address URI. The name attribute of the service element equals the fully qualified namespace of the InteropService. Notice however that the contract attribute of the endpoint element specifies the aforementioned IInteropService interface (fully qualified: Smartsite.Core.Services.IInteropService), since the interface defines the implemented contract.