How To: Configure WSDL and XML Policies to process both SOAP and SwA requests and route accordingly

Administrators may want to build WSDL or XML Policies that accept both SOAP and SwA requests and route the requests to a specific back-end server accordingly. You will need three task lists to accomplish this goal. A quick overview of the necessary configuration is below, followed by detailed instructions.

General Overview

I. Create a task list group that runs the following two task lists in order:

Task List 1:

    1. Take the inbound document and add temporary XML nodes to store attributes in (XSLT attached creates 5 slots and can be modified as needed).
    2. Store the Content-Type header value in the first attribute slot.
   
Task List 2:

    1. Identify the document based on the value in the first attribute slot (the Content-Type).
    2. Remove the temporary XML nodes and restore the original document.
    3. Modify the remote routing as needed for the Content-Type of the message coming through.

Task List 3:
    
    1. Remove the temporary XML nodes and restore the original document. This will be used in cases where Task List 2 is not fired.

II. Associate the task list group with your XML or WSDL policy.


Notes:

    * You will need to make sure you have a MIME (Multipart) request filter on your WSDL and XML policies.
    * You will need to modify the identify statement in the second task list as appropriate to your content-type.
    * All Content Types not caught by the second task list will be sent on to the default back end server.
    * You can add additional task lists in the style of the second task list to further enhance your document routing based on headers.
    * There will be an XML namespace "fsaw" defined in the SOAP (or XML) document outbound to the back-end server. This could potentially be removed, just be aware aware of it in case it causes problems for your back-end servers.

    * You'll need a sample document for Task List 2. To create a sample document, run Task List 1 and save the output as an XML file. Import this XML file on the Documents tab and use it as the Sample Document for Task List 2.



Detailed Description of Configuring the Tasks and Task List Groups


I. Task List 1 - Actions performed: Gather attribute, add additional XML nodes to place attribute in, and place attribute in node.

   1. Map Headers
         a. Map: From Header
         b. Mapping: Attribute
         c. On Error: Log & Halt Processing
         d. Header Mappings
               Header Name = Content-Type
               Attribute = ContentType
               
   2. Transform Document
         a. Use the attached file AttributeWrapper.xsl
         
   3. Map Attributes to XML
         a. Map From: User Attribute (e.g. LDAP)
         b. Target Document Elements
               Element = /fsaw:Root/fsaw:Attribute1
               User Attribute = ContentType


II. Task List 2 - Identify MIME requests, remove additional XML nodes, and change remote routing.

   1. Identify Document. You'll need a sample document for this Task list. To create a sample document, run Task List 1 and save the output as an XML file. Import this XML file on the Documents tab and use it as the Sample Document for Task List 2.
         a. Path = /fsaw:Root/fsaw:Attribute1
         b. Comparitor = starts-with
         c. Value = "Multipart/Related"
         
   2. Transform
         a. Use the attached file AttributeWrapper-Remove.xsl
         
   3. Remote Routing
         a. Action: Override remote routing
         b. Remote Policy: Change as needed
         c. Remote Path: Change as needed


III. Task List 3 - Remove additional XML nodes from requests not processed by Task List 2.
   
   1. Transform
         a. Use the attached file AttributeWrapper-Remove.xsl
         
    
IV. Create a Task List Group as follows:

   1. Process Each Task List Below in Sequence: Enabled
   
   2. Task List
         a. Task List 1
         b. Task List 2
         c. Task List 3


V. Take the Task list group and associate it with your XML policy or WSDL operations.



With the configuration above (or something similar), you can route requests to specific back-end servers based on the Content-Type or any other HTTP header.

Have more questions? Submit a request

0 Comments

Article is closed for comments.