Call Web Service in Datapower Multiprotocol Gateway

So many time you would like to call a Web Service that receives input from a MQ, File, JMS or HTTP and want to put the result of the Web Service to an different output protocol (MQ, File, JMS or HTTP).

This can be done using an Datapower Mulitprotocol gateway.

Step 1: Setup your front Side and BackSide Handler on your Multi protocol Gateway.

Step 2: Modify your current policy by adding an Transform action after your Match Action that will execute the Web Service SOAP request.

Below is an sample of the Web Service Stylesheet file:

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dp="http://www.datapower.com/extensions"
                exclude-result-prefixes="dp"
                version="1.0">

  <xsl:output method="xml"/>

  <xsl:variable name="call">
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:evt="http://evtlog.ws.jboss.webserviceportal.co.za/">
      <xsl:copy-of select="/soap:Envelope/soap:Body"/>
    </soap:Envelope>
  </xsl:variable>

  <xsl:template match="/*">
    <xsl:variable name="result" select='dp:soap-call("http://11.22.173.134:8080/SendEvtLogWS/SendEvtLogWS", $call)'/>
Calling:
    <xsl:copy-of select="$call"/>
About to call.
    <xsl:copy-of select="$result/."/>
Done with call
  </xsl:template>

</xsl:stylesheet>

Note: Add your own namespaces to the SOAP Envelope and change the endpoint IP, Port and URI.

Advertisements

4 Comments on “Call Web Service in Datapower Multiprotocol Gateway

  1. Hi Shreyasma, yes you can call an API as a Web Service from Datapower MPG as long as the your appliance has access to the intranet or internet endpoint.

  2. Hi Michels,
    How to make a call from MPGW service to Webservice proxy in datapower. Here MPGW is common service to check credentials in DMZ and internally i want to implement webservice poxy for soap based webservice.
    Thanks
    Manish

  3. Hi,

    Can you please advise why do we need to use stylesheet for calling WebServices instead of default backend URL?

    There is an option on MPGW, which we can select request messages type and response message type with the backend URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: