Setup Web services
The web serives zip file is complete with sample projects including source code that can be used for developing your own services. It can be used with integration engines such as Microsoft Biztalk and iCore or with a direct integration through web services towards any kind of system, vendor independent.
Brief introduction to Windows Communication Foundation (WCF)
The service uses Windows Communication Foundation (WCF) services. The WCF services are usually hosted inside Microsoft IIS.
A WCF service is provided by defining one or more WCF endpoints. An endpoint is defined by an address, a binding and a service contract. The address defines where the service is located. The binding specifies how to communicate with the service. The service contract defines the operations that the service can perform.
The binding specifies the set of protocols for communicating with the application. You need to associate an address and a binding with a service contract. This is typically done in a configuration file, either by editing the file directly, or by using a configuration editor provided with WCF. The internal behavior of service types can be adjusted using the properties of a family of classes called behaviors.
This best practice will only describe how to configure and host the WCF services inside Microsoft IIS with HTTP as transport protocol.
Architecture
The add-on is designed to make it easier to build WCF services that other systems can use to communicate with Litium Studio. There are two approaches – inbound and outbound calls (or services).
The framework has built-in functions for authentication and authorization with username and password. To ensure that the message between the client and server (including username and password) is not sent in plain text, all communication is secured with an X.509 certificate (SSL).
The WCF services are hosted inside Microsoft IIS. Each service is described in the contract assembly. This contains a data contract (for the data structure) and service contract (for the service endpoint). Each operation is described in the operation contract inside the service contract.
We recommend that the service should be divided into an implementation assembly and a contract assembly. This would enable you to change the implementation or upgrade Litium Studio without having to change the contract assembly in the other end of the integration.
You also want to separate the integration implementation from Litium Studio. When no direct references are used you can update either of them separately. The implementation will be loaded at runtime and will use service, operations and data contracts to specify the different methods that can be used in the service.
An inbound call is a service provided by Litium Studio being called from an external system, for example an ERP or PIM.
An outbound call is a service provided by an external system (for example an ERP or PIM), being called from Litium Studio.
The samples included in the WSIK package are separated into two different assemblies, according to the suggested architecture. Separating the contract assembly from the implementation assembly will make it easier to upgrade the service implementation (including assembly version) without having to distribute new assemblies to the all clients. This is only necessary if the contracts themselves are changed.