|
Proxy services are definitions of services implemented locally on the AquaLogic Service Bus server. You design and configure the message flow in the pipelines and route nodes of a proxy services by adding and configuring actions.
This topic describes how to add actions to stages in pipelines, route nodes, and describes each of the actions available in AquaLogic Service Bus. It includes the following sections:
You add actions to stages on the Edit Stage Configuration page. Actions are the elements of stages in pipelines and route and branch nodes that define how messages are to be defined as they flow through a proxy service. To learn more about Message Flow, see Overview of Message Flow.
| Note: | You must create a pipeline pair node and add a stage before you can add actions. To learn more, see Adding a Pipeline Pair Node and Adding a Stage.You can also add actions to Route Nodes and Error Handlers. To learn more, see Adding Route Node Actions, and Error Handler Actions |
The Edit Message Flow page is displayed.
The following table lists the actions you can configure for AquaLogic Service Bus message flows, and links you to topics that describe the actions, including how to configure them.
After you configure an action, you are returned to the Edit Stage Configuration page, in which you can perform further operations as listed in Table 18-2.
Click the appropriate request or response pipeline, then click Add Stage. To learn more, see Adding a Stage.
|
|||
Click the Proxy Service icon, then click Add Pipeline Pair. Alternatively, click an existing Pipeline Pair Node icon, click Add, then click Add Pipeline Pair. To learn more, see Adding a Pipeline Pair Node.
|
|||
Click the Pipeline Pair Node icon, click Add, then click Add Route. To learn more, see Adding a Route Node.
|
|||
|
|||
Click the Pipeline Pair Node icon, click Add, then click Add Conditional Branch Node. To learn more, see Adding a Conditional Branch.
|
|||
Click the Proxy Service icon, then click Add Service Error Handler. To learn more, see Adding Error Handling for the Proxy Service.
|
|||
Click Cancel All. When you confirm that you want to exit the Message Flow, the Summary of Proxy Services page is displayed if you initially clicked the Edit Message Flow icon for the proxy service on that page or the Project View or Folder View pages are displayed if you clicked the Edit Message Flow icon for the proxy service on those pages.
|
| Note: | When you click Save, the Message Flow is updated in the current session. When you have finished making changes to this configuration, from the left navigation pane, click Activate under Change Center. The session ends and the configuration is saved. Alternatively, click Discard at any time during the session to delete the changes you have made so far in the current session. |
| Note: | To learn more about actions, see Modeling Message Flow in AquaLogic Service Bus in the AquaLogic Service Bus User Guide for usage scenarios, design patterns, and best practices. |
Update actions include Delete, Rename, Insert, and Replace actions. They are evaluated and executed as follows:
Listing and Locating Proxy Services
Viewing and Changing Proxy Services
Viewing and Changing Message Flow
Use a Publish action to identify a target service for a message and configure how the message is packaged and sent to that service.This topic includes the following sections:
The following quality of service and scope of the message context information applies to Publish actions and Publish Table actions.
When a message is published to another service as the result of a Publish, Dynamic Publish, or Publish Table action, the default quality of service (QoS) is best effort. The QoS best effort essentially means that there is no reliable messaging—however, performance is optimized. To override the default best effort quality of service attribute, you must use the Routing Options action to set the Quality of Service. For more information, see Routing Options. For information about exactly once reliability, see Adding a Route Node.
For more information about quality of service, see Modeling Message Flow in AquaLogic Service Bus in the AquaLogic Service Bus User Guide.
Each publish request transformation maintains its own local copy of a message context. The changes to the predefined context variables ($headers, $body, $attachments, $outbound) in the publish request actions are isolated to that publish endpoint and do not affect subsequent processing by the message flow. For more information on context variables, see Predefined Context Variables
For the purposes of instruction, the following questions about working with the message context in publish actions are asked and answered considering an example scenario in which AquaLogic Service Bus receives a SOAP message with attachments (3 parts: SOAP, text, binary).
No. Any changes you, or the transport, make to an outbound message (or $outbound)in a publish action only affect the published message. In other words, the changes you, or the transport, make in the publish action (or $outbound) are rolled back before the message flow proceeds to any actions or nodes that immediately follow the publish action.
Likewise, the $outbound variable is also reverted to its original state after the Publish action has completed. Ordinarily, after a communication operation, the $outbound variable will contain useful information such as the response metadata, the actual URI used when communicating with a service, and, in the case of File Transport, the name of the file that was created. However, due to Publish reverting $outbound to its original state, this information will be unavailable. If this information is important, the user should do a service callout to a local transport proxy that routes to the business service. The local transport proxy can then return relevant portions of $outbound as the response from the Service Callout.
When you use a Reply action as one of the Publish request actions, the message content is not rolled back. In other words the message that is in the message context, is the one returned to the client as a result of the Reply action being executed.
The nature of the message written to the file system depends on the type of your outbound service:
<soap:Envelope>) as the root part. (For more information, see SOAP Services.)$body as the root part. (For more information, see XML Services (Non SOAP) and Messaging Services.)$body):
<soap-env:Body>{
$attachments/ctx:attachment[2]/ctx:body/node()
}</soap-env:Body>
$body with the contents of the attachment:$attachments/ctx:attachment[2]/ctx:body/node()
You need not set any transport headers. The Content-Type is set automatically according to the service type. For more information, see Initializing the attachments Context Variable.
Publish. The Publish action is displayed.A publish table is a set of publish actions wrapped in a switch-style condition table. It is a short-hand construct that allows different routes to be selected based upon the results of a single XQuery expression. Use a Publish Table action to identify target services for messages and configure how the messages are packaged and sent to these services.
For information about the default quality of service and the scope of the message context for Publish actions, see Understanding Publish Actions.
| Note: | There is a nesting limit of 4 cumulative levels in the stage editor. If you attempt to add a 5th level, this nesting action is not displayed. Cumulative levels include all branching actions: If... Then... Conditions, Publish Tables, and Route Tables. For example, you can have 2 levels of conditionals, then a publish table with a route table inside of it, bringing the total to 4 levels. If you attempt to add another conditional (to the last publish table), the conditional is not displayed. |
Publish Table. The Publish Table action is displayed.
Use a Dynamic Publish action to publish a message to a service specified by an XQuery expression.
Dynamic Publish. The Dynamic Publish action is displayed, which includes the following functionality:<ctx:route isProxy="false">
<ctx:service>project/folder/businessservicename</ctx:service>
<ctx:operation>foo</ctx:operation>
</ctx:route>
| Note: | The element operation is optional. |
Use the Routing Options action to modify any or all of the following properties for the outbound request in $outbound: URI, Quality of Service, Mode, Retry parameters. Although these properties can be modified using Assign, Insert, Replace, or Delete actions on $outbound, using Routing options provides a simpler way to perform this task, without requiring knowledge of XPath, XQuery, or the structure of the $outbound context variable.
The Routing Options action can only be used where the context variable $outbound is valid. It can be added to the following actions:
Routing Options.The Routing Options action is displayed, with check boxes to select the following functionality.
| Note: | This is normally already automatically set, based on the interface of the service invoked. However, in some cases like Any Soap or Any XML services, this is not so. |
Use a Service Callout action to configure a synchronous (blocking) call to a proxy or business service that is already registered with AquaLogic Service Bus. This topic includes the following sections:
Service Callouts allow you to make a callout from a proxy service to another proxy service or business service. Input parameters for the called service are constructed from the proxy service message context and outputs from the called service are mapped back to the message context. A service to which call outs are made must have the following characteristics:
Only SOAP document-style, XML (HTTP binding with mime:mimeXml body) and SOAP RPC-style (SOAP 1.1 and SOAP 1.2) Web services are supported.
Attachments are not supported.
Note: The endpoint URI for the service to which the callout is being made can be the same as the URI specified by the soap:address element in the WSDL, or it can be a different URI.
The outbound request uses the AquaLogic Service Bus binding layer to achieve the correct construction of the request payload, based on the service type. Also, WS-Security is supported through the binding layer.
Use the Routing Options action to set the Quality of Service for a Service Callout. For more information, see Routing Options.
In addition to any transport headers you specify when configuring the TransportHeader action for a service (see Transport Headers), headers are automatically added by the AquaLogic Service Bus binding layer for SOAP services. The headers differ depending on whether the service uses SOAP 1.1 or SOAP 1.2.
Content-Type = text/xml + charset for HTTP/HTTPS services
The charset parameter is set according to the configuration of the business service.
If you specify a value for the Content-Type transport header when you configure the Service Callout action, the value you specify is used, not the default text/xml value.
SOAPAction for SOAP 1.1 document-style or SOAP 1.1 RPC style HTTP/HTTPS servicesThis is added only if present in the SOAP Binding operation section of the WSDL.
Content-Type HTTP header similar to the following is added
Content-Type: application/soap+xml; action=”http://example.com/ticker”
| Note: | The action parameter of the above example is added only for SOAP 1.2 WSDL-based services. For SOAP 1.2 services that are not based on a WSDL, no action parameter is added. The value of the action parameter is based on the value bound to the operation in the WSDL. |
| Note: | SOAPAction transport headers are not used for SOAP 1.2. |
| Note: | For JMS transport, neither SOAPAction nor Content-Type headers are used for SOAP 1.2. |
Configuring a Service Callout action involves populating the context by specifying a service and operation, and entering context variables to bind to the invocation input and output parameters.
Service Callout. A Service Callout action is added to the message flow displayed on the page.
The name of the selected service is added to the stage configuration page.
$body directly.| Note: | This option supports SOAP-RPC encoded, which is not supported when configuring payload parameters or document. |
Table 18-5, below, provides instructions for each of the options listed in Table 18-4, above.
You must wrap the input document for the SOAP Request Header with |
|
You must provide only the core payload documents in the input variable—the SOAP package is created for you by AquaLogic Service Bus. In other words, do not wrap the input document with
For example, when creating a body input variable that is used for this request parameter, you would define that variable’s contents using the XPath statement |
|
For SOAP Document-type services, the variable is evaluated at runtime to form the body of the SOAP message sent to the service. For Any XML services, the variable is evaluated at runtime to form the body of the XML message sent to the service.
For SOAP Document-type services and for Any XML services, you provide only the core payload documents in the input variable—the SOAP package is created for you by AquaLogic Service Bus. In other words, do not wrap the input document with
For example, when creating a body input variable that is used for this request parameter, you would define that variable’s contents using the XPath statement For Messaging services, the variable is evaluated to form the body of the message, based on the type of data expected by the service. The following restrictions apply to variables used with Messaging services: |
| Note: | In addition to the transport headers you specify, headers are added by the AquaLogic Service Bus binding layer. For more information, see Note About Transport Headers. |
How does a Service Callout action differ from a Route Node at run time?
The different behavior of the actions configured on a Route node and the Service Callout actions at run time are primarily as follows:
Use a Transport Header action to set the header values in messages.
The Transport Header action allows you to set transport header values for outbound requests (the messages sent out by a proxy service in Route, Publish, or Service Callout actions) and inbound responses (the response messages a proxy service sends back to clients). This specifies to the run time which of the message context locations are to be modified.
After you specify the header set to be modified, you configure the header values. You set the header values as an unordered table of name and value pairs. The run time automatically handles all namespace and ordering issues when updating $inbound or $outbound.
Transport Header. The Transport Header action is displayed.This is a required field and specifies to the run time whether the header values are to be set for outbound requests (the messages sent out by a proxy service in Route, Publish, or Service Callout actions) and inbound responses (the response messages a proxy service sends back to clients).
Selecting Outbound Request or Inbound Response when you configure the Transport Headers action specifies to the run time which of the message context locations are to be modified—these header elements are located in the message context as follows:
When you select this option, the Transport Headers action will automatically pass all headers through from the inbound message to the outbound message or vice versa. Every header in the source set of headers will be copied to the target header set, overwriting any existing values in the target header set.
For information about using this option in conjunction with the header-specific pass through option, see About the Global Pass Through and Header-Specific Copy Options.
The drop-down list is populated with all of the predefined header names for the target transport (for example, Content-Type for HTTP transports, JMSCorrelationID for JMS transports, and so on). If you enter a header name in the Other field, and that header name is not one of the predefined headers for this service’s transport, it becomes a user-header, as defined by the transport specification.
Selecting this option allows you to use an XQuery or XSLT expression to set the value of the header. The expression can be simple (for example, “text/xml”) or a complex XQuery or XSLT expression.
Because the AquaLogic Service Bus transport layer defines the XML representation of all headers as string values, the result of any expression is converted to a string before the header value is set. Expressions that return nothing result in the header value being set to the empty string. You cannot delete a header using an expression.
Warning: Not all of the header settings you can specify in this action are honored at run time. For information about which of the headers for a given transport you can set, and which of those set are honored at run time, see Understanding How the Run Time Uses the Transport Headers’ Settings.
Specifies that the header is removed from the request or response metadata.
Copy Header from Inbound Request (if you are setting transport headers for the Outbound Request—see Figure 18-5)
or
Copy Header from Outbound Response (if you are setting transport headers for the Inbound Response—see Figure 18-5)
Specify that this header is copied directly from the corresponding header of the same name from the inbound message to the outbound message and vice versa. For example, if you want to set the SOAPAction header for an outbound request, selecting Copy Header from Inbound Request causes the run time to copy the value from the SOAPAction request header of $inbound. In the case of inbound response headers, the source of the header to copy is the response headers of $outbound.
In the event that the Copy Header... option is selected for a header that does not exist in the source, this option is ignored and no action is performed on the target for this header. In other words, this Copy Header... option copies only headers that are present in the source to the target.
For information about using this option in conjunction with the global Pass all Headers through Pipeline option, see About the Global Pass Through and Header-Specific Copy Options.
The table is expanded to include an additional row, which includes a new set of options that you can use to configure another transport header.
The preceding figure displays a Transport Headers table with two headers; a different action is specified for each header. You can add as many headers as necessary to this table and remove headers from the table using the delete option
associated with that header row in the table. You need not order the headers in the table because the run time declares namespaces and places header elements in their proper order when generating the corresponding XML.
As described in the preceding section, the following options are available when you configure a Transport Headers action:
| WARNING: | Because transport headers are specific to the transport types, it is recommended that the pass-through (or copy) options only be used to copy headers between services of the same transport type. Passing (or copying) headers between services of different transport types can result in an error if the header being passed is not accepted by the target transport. For the same reasons, be careful when you specify a header name using the Set Header option. |
Selecting Pass all Headers through Pipeline specifies that at run time, the Transport Headers action passes all headers through from the inbound message to the outbound message or vice versa. Every header in the source set of headers is copied to the target header set, overwriting any existing values in the target header set.
Selecting a Copy Header option specifies that at run time, the Transport Headers action copies the specific header with which this option is associated from the inbound message to the outbound message or vice versa.
Use the options in a way that best suits your scenario. Both options result in the headers in the source header set being copied to the target header set, overwriting any existing value in the target set. Note that the Pass all Headers through Pipeline option is executed before the header-specific Copy Header options. In other words, for a given Transport Headers action configuration, if you select Pass all Headers through Pipeline, there is no need to select the Copy Header option for given headers.
However, you can select Pass all Headers through Pipeline to copy all headers, and subsequently configure the action such that individual headers are deleted by selecting Delete Header for specific headers.
The preceding topics describe how the values of the transport headers for outbound requests (the messages sent out by a proxy service in Route, Publish, or Service Callout actions) and inbound responses (the response messages a proxy service sends back to clients) can be configured for Transport Headers actions. In general, the header values can be:
The Transport Headers action allows you to set, delete or pass-through the headers in $inbound or $outbound. If you set or delete these headers and then log $inbound or $outbound, you can see the effects of your changes. However, when the message is sent out, the AquaLogic Service Bus binding layer may modify or remove some headers in $inbound or $outbound and the underlying transport may in turn, ignore some of these headers and use its own values. An important distinction is that any modifications done by the binding layer on a header are done directly to $inbound and $outbound, whereas modifications done by the transport affects only the message's wire format. For example, although you can specify a value for the outbound Content-Length header, the binding layer deletes it from $outbound when sending the message. Consequently, the modification is visible in the response path (for example, you can see the modified value if you log $outbound). If you set the User-Agent header in $outbound, the HTTP transport ignores it and use its own value—however, the value in $outbound is not changed.
The following table describes the transport headers that are ignored or overwritten at run time and other limitations that exist for specific transport headers.
Should be set to the message time-to-live in milliseconds. The resulting value in the message received is the sum of the time-to-live value specified by the client and the GMT at the time of the send or publish1.
|
|||
No limitations. In other words you can set or delete the header(s)3 for File and FTP transports and your specifications are honored by the AquaLogic Service Bus run time.
|
|||
These headers have no meaning for outbound requests. If they are set dynamically (that is, if they are set in the
$outbound headers section), they are ignored.4
|
|||
1For example, if you set the JMSExpiration header to 1000, and at the time of the send, GMT is 1,000,000 (as a result of System.currentTimeMillis()), the resulting value of the JMSExpiration property in the JMS message is 1,000,1000 2Header names with the JMS_IBM prefix are to be used with respect to destinations hosted by an IBM MQ server 3For FTP and file proxies, there is an transport request header 'fileName'. The value of this request header is the name of the file being polled.
4 |
| Note: | The same limitations around setting certain transport headers and metadata are true when you set the inbound and outbound context variables, and when you use the AquaLogic Service Bus Test Console to test your proxy or business services. For more information, see the following topics: |
Use the For Each action to iterate over a sequence of values and execute a block of actions.
For Each. The For Each action is displayed. Let us use the values shown in the following figure to describe how the For Each action is executed at run time.
Specifying values for the value, index, and total variables, and for the XPath expression is optional. In other words, if they are not specified when you design the action, you can still activate the session.
| Note: | For information about the scope of the context variables in For Each actions, see Scope of Variables in the For Each Action and Nested For Each Actions. |
The value context variable is only visible inside the For Each action—when the For Each action finishes execution (whether it finishes successfully or with an error), the value variable falls out of scope and is removed from the message context. However, when the For Each action finishes execution, the index and total count variables remain in the context with their last known values. If the For Each action finishes successfully, then the index variable and the total count variable both have the same numeric value—the total number of items in the sequence.
If an error occurs when an iteration is in progress, the value of the index variable is smaller than the value of the total count variable. However, note that during the final iteration, index has the same value as total count. So, if an error occurs and the values in index and total are equal, then you can determine only that the error occurred either in the final iteration or after the For Each action finished successfully.
You can modify any of the variables (value, index, or total) in the Do() loop.
You can configure nested For Each actions. When you do so, it is recommend that where possible you use unique variable names. If you reuse the variables in nested For Each actions, be aware of the scope of those variables. As described in the preceding section:
Use an If Then action to perform an action or set of actions conditionally, based on the Boolean result of an XQuery expression.
If... Then... The If... Then... action is displayed. The condition you create is used as the test that is executed before the then() clause is entered, per standard if...then logic. To learn more, see Using the XQuery Condition Editor.
| Note: | Condition actions can be nested. However, there is a nesting limit of 4 cumulative levels in the stage editor. If you attempt to add a 5th level, this nesting action is not displayed. Cumulative levels include all branching actions: If... Then... Conditions, Publish Tables, and Route Tables. For example, you can have 2 levels of conditionals, then a publish table with a route table inside of it, bringing the total to 4 levels. If you attempt to add another conditional action (to the last publish table), it is not displayed. |
Use the Raise Error action to raise an exception with a specified error code (a string) and description.
Raise Error. The Raise Error action is displayed. To learn more about error handling actions, see Error Messages and Handling.
The Reply action can be used in the request, response or error pipeline. You can configure it to result in a reply with success or failure. n the case of Reply with failure where the inbound transport is HTTP, the Reply action specifies that an immediate reply is sent to the invoker.
Reply. The Reply action is displayed. With Success and With Failure options
To learn more about error handling actions, see Error Messages and Handling
For information about using the Reply action as one of the Publish action request actions, see Scope of the Message Context in Overview of Publish Actions