
Service gateway
A service gateway is a single access point and acts as a proxy for multiple services. A service gateway enables transformations, routing, and common processing across all the services.
- Common processing - once the message is received by the gateway, common processing occurs for all messages, such as adding protocol level headers or logging the message.
- Service identification - the message that is processed by the gateway needs to be identified as a certain service type. For example, the message is queried to determine if it is for service provider A, B, or C.
- Endpoint routing - when it is known that a message will be delivered to a particular service provider, it is mapped to a network-addressable endpoint so that the message can be forwarded to the service provider.
- Service-specific processing - any processing that is required for the particular target service is performed.
Each of these patterns follow a general format within the tooling environment in IBM Integration Designer, as shown in Figure 1. The service gateway is represented as an SCA module. An export exposes the endpoint and has the service gateway interface attached. The service gateway interface instructs the runtime that it is in the service gateway mode.

The service gateway interface has two operations: requestOnly and requestResponse. Both operations use messages that have an anyType structure. An anyType message structure allows it to be one of five core structures that represent raw data that is sent to the mediation flow component, as shown in Figure 2. This is not to accommodate any business object. Implement one or both of the interface operations.

| Binding type | Business object created |
|---|---|
| WebSevice Binding | TextBody |
| HTTP Binding | |
| HTTP Content-Type=text/* | TextBody |
| HTTP Content-Type=application/soap+xml | TextBody |
| HTTP Other | BytesBody |
| JMS Binding | |
| JMS TextMessage | TextBody |
| JMS BytesMessage | BytesBody |
| JMS StreamMessage | StreamBody |
| JMS MapMessage | MapBody |
| JMS ObjectMessage | ObjectBody |
| MQ Binding | |
| MQ Format = MQSTR | TextBody |
| Other | BytesBody |
The content of the message is in a serialized form (such as XML) when it reaches the mediation flow component and is held within a TextBody structure. Header information is parsed as a business object and can be found in the header section of the Service Message Object (SMO). To change the body of the message, it can be parsed within the mediation flow component and changed using transformation mediation primitives and then serialized before it is passed to the service gateway import. To parse the message within the mediation flow component, the schema information associated with the message type should be available to the module.
Manual parsing of the gateway message
The DataHandler mediation primitive can be used to convert a message from a serialized form (such as XML) to a business object structure. This mediation primitive differs from other transformation primitives such as the Mapping or the BO Mapper, which convert one business object into another business object.

Automatic parsing and any message type support
