Parameter | Description |
Condition | Conditions are used to specify when the policy has to be executed. You can add multiple conditions with logical operators. Available values are: ![]() ![]() Click Add Condition and provide the following information and click ![]() ![]() ![]() ![]() ![]() ${request.payload.xpath[//ns:emp/ns:empName]} where //ns:emp/ns:empName is the xpath to be applied on the payload if contentType is application/xml ${request.payload.jsonPath[$.cardDetails.number]} where $.cardDetails.number is the jsonPath to be applied on the payload if contentType is application/json ${request.payload.regex[[0-9]+]} where [0-9]+ is the regex to be applied on the payload if contentType is text/plain ![]() For example: ${request.payload.xpath[//ns:emp/ns:empName] || request.payload.jsonPath[$.cardDetails.number]} This applies xpath for application/xml and jsonPath for application/json ${request.payload.xpath[//ns:emp/ns:empName] || request.payload.jsonPath[$.cardDetails.number] || request.payload.regex[[0-9]+]} This applies xpath for application/xml, jsonPath for application/json, and regex for text/plain. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Transformation Configuration: Specifies various transformations to be configured. | |
Header/Query/Path Transformation for REST API and Header Transformation for SOAP API | Specifies the Header, Query or path transformation to be configured for incoming requests. You can add or modify header, query or path transformation parameters by providing the following information: ![]() ![]() ![]() ![]() ${request.payload.xpath[//ns:emp/ns:empName]} where //ns:emp/ns:empName is the xpath to be applied on the payload if contentType is application/xml ${request.payload.jsonPath[$.cardDetails.number]} where $.cardDetails.number is the jsonPath to be applied on the payload if contentType is application/xml ${request.payload.regex[[0-9]+]} where [0-9]+ is the regex to be applied on the payload if contentType is anything ![]() For example: ${request.payload.xpath[//ns:emp/ns:empName] || request.payload.jsonPath[$.cardDetails.number]} This applies xpath for application/xml and jsonPath for application/json ${request.payload.xpath[//ns:emp/ns:empName] || request.payload.jsonPath[$.cardDetails.number] || request.payload.regex[[0-9]+]} This applies xpath for application/xml, jsonPath for application/json, and regex for text/xml. Note: The parameter types that are of the format jms.xxx are used when you want to use JMS/AMQP so that transformation can be applied for the jms/amqp values. For example, if you have set the path parameter as jms.path.petid and the corresponding value as jms.header.h1, then if the request contains the header value h1, the value h1 is replaced by the path parameter petid. ![]() ![]() ![]() ![]() ![]() You can add multiple variables and corresponding values by clicking ![]() You can remove any header, query or path transformation parameters by typing the value in the text box. Note: In the 10.2 release, payload transformation does not happen automatically for content-type transformation. When you change the content type, ensure to do payload transformation also as part of IS Service. For example, if you change the content-type header from application/xml to application/json using IS service, you must also change the respective payload from application/xml to application/json |
Method transformation for REST API | Specifies the method transformation to be configured for incoming requests. Select any of the HTTP Method listed: ![]() ![]() ![]() ![]() ![]() ![]() Note: When CUSTOM is selected, the HTTP method in incoming request is sent to the native service. When other methods are selected, the selected method is used in the request sent to the native service. Note: Only Method Transformation happens when configured, but you have to take care of adding payload during transformations involving method change like GET to POST, and so on. |
Payload Transformation | Specifies the payload transformation to be configured for incoming requests. Provide the following information: ![]() ![]() Click Browse to browse and select a file. ![]() ![]() You can add more XSLT features and xslt documents by clicking ![]() ![]() ![]() When the incoming request is in JSON, you can use a XSLT file similar to the below sample: <?xml version="1.0" ?> <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/> <xsl:template match="/" > <xsl:element name="fakeroot"> <xsl:element name="fakenode"> <!-- Apply your transformation rules based on the request from the Client--> </xsl:element> </xsl:element> </xsl:template> </xsl:stylesheet> When the incoming request is in XML, you can use a XSLT file similar to the below sample: <?xml version="1.0" ?> <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> <xsl:output method="xml"/> <xsl:template match="/" > <xsl:element name="soapenv:Envelope"> <xsl:element name="soapenv:Body"> <!-- Apply your transformation rules based on the request from the Client--> </xsl:element> </xsl:element> </xsl:template> </xsl:stylesheet> |
Advanced Transformation | Specifies the advanced transformation to be configured for incoming requests. Provide the following information: ![]() You can add multiple services by clicking ![]() Note: The webMethods IS service must be running on the same Integration Server as API Gateway. ![]() ![]() ![]() |
Transformation Metadata: Specifies the metadata for transformation of the incoming requests. For example, the namespaces configured in this section can be used when you provide the syntax for XPath ${request.payload.xpath} For example: ${request.payload.xpath[//ns:emp/ns:empName]} | |
Namespace | Specifies the namespace information to be configured for transformation. Provide the following information: ![]() ![]() Note: You can add multiple namespace prefix and URI by clicking ![]() |