Monday, May 11, 2015

Creating a loopback service on MPG

As we already learned what is MultiProtocol gateway in datapowerfresher.blogspot.com/2013/04/creating-multiprotocal-gateway.html.Lets see how to create a sample loop back service.

Scenario: The below example is MPGW is acting like a backend to the WSP which is the front end for the client. The client will make a SOAP call to WSP http handler and the request is routed to MPGW where requested has been processed and gives out a static reply or just a loopback of the request.

Once we have done the basic configurations for WSP and MPGW like request, response types, Processing policy,XML manager,http or https or any fsh handlers etc.

MPGW configurations:
 As MPG itself acting as backend and it is not calling any other server or object the backend option in MPG would be dynamic backend.

Steps:
  • Select Dynamic Backend option on mpg
  • Open Processing policy and create a request rule
  • Use the appropriate actions to process the request like transform for any xpath validations
  • Before result action,drag and drop the advanced action 
  • Open the advanced action and select the set variable option
  • For variable name click on var builder and service variable select the var://service/mpgw/skip-backside

  • Variable assignment can be given as 1
  • Apply policy

When MPG receives a request it will match the match rule in request rule and do the modifications specified in transform action and it will skip the backside connection and loop back the output context of previous action.

This is the test to check the MPG is working with the allowed configurations or not.