# Patent

## Title
System and method for web service atomic transaction (WS-AT) affinity routing

## Abstract

A method of operating a web service atomic transaction (WS-AT) system includes: receiving, at a processor of an extensible markup language (XML) gateway, a first message from a communicatively coupled client, and inserting a WS-AT Transaction Identifier (ID) from a Simple Object Access Protocol (SOAP) header into a hypertext transfer protocol (HTTP) header of the first message to generate a first modified message. The method also includes: receiving, at a processor of a network device communicatively coupled to the XML gateway, the first modified message from the XML gateway, determining that the WS-AT Transaction ID is not yet associated with a service provider in a routing table, and in response, sending the first modified message to a particular service provider and associating the WS-AT Transaction ID with the particular service provider in the routing table such that future messages from the client can be routed to the particular service provider.

## Background
CROSS REFERENCE TO RELATED APPLICATION
This application is a continuation of U.S. application Ser. No. 16/841,580, entitled “SYSTEM AND METHOD FOR WEB SERVICE ATOMIC TRANSACTION (WS-AT) AFFINITY ROUTING,” filed Apr. 6, 2020, which is a continuation of U.S. application Ser. No. 15/486,929, entitled “SYSTEM AND METHOD FOR WEB SERVICE ATOMIC TRANSACTION (WS-AT) AFFINITY ROUTING,” filed Apr. 13, 2017, which claims priority to and the benefit of U.S. Provisional Application No. 62/322,647, entitled “SYSTEM AND METHOD FOR WEB SERVICE ATOMIC TRANSACTION (WS-AT) AFFINITY ROUTING,” filed Apr. 14, 2016, which are hereby incorporated by reference in their entirety for all purposes.


BACKGROUND
The present disclosure relates generally to web services, and, more specifically, to web service atomic transaction (WS-AT) systems.
Web Service Atomic Transaction (WS-AT) is a technology standard widely adopted by the industry. WS-AT is a web service standard created by the Organization for the Advancement of Structured Information Standards (OASIS), and the standard provides a specific coordination type that defines protocols for atomic transactions that are ACID (Atomicity, Consistency, Isolation, Durability) compliant. Further, WS-AT includes a two-phase commit transaction protocol and is suitable for short-duration transactions, as well as an interoperability protocol that introduces no new programming interfaces for transaction support.
In a large-scale environment, it is presently recognized that WS-AT systems can suffer from deadlock. For example, because there may be numerous service providers present in a large-scale WS-AT system, each generally operating independently of one another, deadlock can result when two or more service providers unknowingly attempt to access the same resource at the same time (e.g., modify the same database entry) when attempting to satisfy client requests. Such deadlock can result in delays and connection time-outs as client requests remain unsatisfied, as well as additional network traffic and demand on processing resources as clients resubmit requests. As such, it is generally desirable to avoid or prevent deadlock, especially in large-scale environments that include numerous service providers.
BRIEF DESCRIPTION
In an embodiment, a web service atomic transaction (WS-AT) system with affinity routing includes an extensible markup language (XML) gateway comprising a first memory and a first processor. The first processor is configured to: receive a message from a client; determine a Transaction Identifier (ID) of the message from a Simple Object Access Protocol (SOAP) header of the message; modify the message to include the Transaction ID in a hypertext transfer protocol (HTTP) header of the message; and send the modified message to a networking device communicatively coupled to the XML gateway. The system also includes the networking device comprising a second memory storing a routing table and a second processor. The second process is configured to: receive the modified message from the XML gateway; determine the Transaction ID of the modified message from the HTTP header of the modified message; determine whether the Transaction ID is present within the routing table; and send the modified message to a service provider that is associated with the Transaction ID in the routing table, when the Transaction ID is present within the routing table; or send the modified message to an available service provider and associating the Transaction ID with the available service provider in the routing table, when the Transaction ID is not present within the routing table.
In another embodiment, a web service atomic transaction (WS-AT) system includes a networking device communicatively coupled to a plurality of service providers and an extensible markup language (XML) gateway communicatively coupled to the networking device and to a plurality of clients. The XML gateway includes a first memory and a first processor configured to: receive a message from a client of the plurality of clients, wherein the message includes a Simple Object Access Protocol (SOAP) header having a WS-AT Transaction Identifier (ID) and a hypertext transfer protocol (HTTP) header; insert the WS-AT Transaction ID from the SOAP header into the HTTP header to generate a modified message; and send the modified message to the networking device. The networking device comprises a second processor and second memory that includes a routing table storing associations between a plurality of WS-AT Transaction IDs and a plurality of service providers communicatively coupled to the networking device. The second processor is configured to: receive the modified message from the XML, gateway; determine the WS-AT Transaction ID of the modified message from the HTTP header of the modified message; and determine whether the WS-AT Transaction ID is associated with a service provider of the plurality of service providers in the routing table, and in response to determining that it is, send the modified message to the associated service provider, and in response to determining that it is not, send the modified message to an available service provider of the plurality of service providers and associate the WS-AT Transaction ID with the available service provider in the routing table.
In another embodiment, a method of operating a web service atomic transaction (WS-AT) system includes: receiving, at a processor of an extensible markup language (XML) XML gateway, a first message from a communicatively coupled client, wherein the first message includes a Simple Object Access Protocol (SOAP) header having a WS-AT Transaction Identifier (ID) and a hypertext transfer protocol (HTTP) header; inserting, via the processor of the XML gateway, the WS-AT Transaction ID from the SOAP header into the HTTP header of the first message to generate a first modified message; and sending, via the processor of the XML gateway, the first modified message to a networking device communicatively coupled to the XML gateway. The method further includes: receiving, at a processor of the network device, the first modified message from the XML gateway; determining, via the processor of the network device, the WS-AT Transaction ID of the first modified message from the HTTP header of the first modified message; and determining, via the processor of the network device, that the WS-AT Transaction ID is not yet associated with a service provider in a routing table stored in a memory of the network device in response to the WS-Transaction ID, and in response, sending the first modified message to a particular service provider and associating the WS-AT Transaction ID with the particular service provider in the routing table.



DRAWINGS
These and other features, aspects, and advantages of the present disclosure will become better understood when the following detailed description is read with reference to the accompanying drawings in which like characters represent like parts throughout the drawings, wherein:
FIG. 1 is a schematic representation of an example of deadlock in a web service atomic transaction (WS-AT) system;
FIG. 2 is a schematic representation of a WS-AT system that avoids deadlock via affinity routing, in accordance with embodiments of the present technique;
FIG. 3 is a flow diagram illustrating an example of a process whereby the processor of an XML gateway can function within the WS-AT system of FIG. 2 to enable affinity routing, in accordance with embodiments of the present technique;
FIG. 4 is a flow diagram illustrating an example of a process whereby the processor of a networking device can function within the WS-AT system of FIG. 2 to enable affinity routing, in accordance with embodiments of the present technique;
FIG. 5 is a flow diagram illustrating an example of a process whereby the processor of the networking device defines an affinity duration based on an arrival time of a first client message of a transaction, in accordance with embodiments of the present technique; and
FIG. 6 is a flow diagram illustrating an example of a process whereby the processor of the networking device defines an affinity duration based on an arrival time of the most recent client message of a transaction, in accordance with embodiments of the present technique.



DETAILED DESCRIPTION
One or more specific embodiments of the present disclosure will be described below. In an effort to provide a concise description of these embodiments, all features of an actual implementation may not be described in the specification. It should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another. Moreover, it should be appreciated that such a development effort might be complex and time consuming, but would nevertheless be a routine undertaking of design, fabrication, and manufacture for those of ordinary skill having the benefit of this disclosure.
Present embodiments are directed toward systems and methods for providing routing affinity within WS-AT systems, particularly large-scale WS-AT systems that include too many service providers (e.g., greater than 20, greater than 50, greater than 100 service providers) to feasibly or practically group all of the service providers into a single cluster. The disclosed WS-AT systems enable all requests from a particular client transaction to be effectively routed to the same service provider for fulfillment. As discussed in greater detail below, the disclosed techniques generally involve determining a unique identifier (e.g., a Transaction ID) from the communications of the client, modifying a header of the communications to include this identifier, and then effectively routing the modified communications to the same service provider based on this identifier. As such, present embodiments block or prevent deadlock that can result from different service providers (e.g., in different clusters) attempting to fulfill multiple requests of a single client transaction.
FIG. 1 illustrates an example of deadlock in a traditional WS-AT system 10, which is presently recognized as an issues with traditional systems. The illustrated WS-AT system 10 includes a number of clients 12 (e.g., 12A-D) that provide requests to a number of service providers 14 to use (e.g., access, read, lock, modify) a particular resource 16, such as a database. The clients 12 send requests to the service providers 14 by sending messages (e.g., Simple Object Access Protocol (SOAP) requests) via a networking device 18. For example, the networking device 18 may be a router that is programmed to provide load balancing. That is, the networking device 18 may route messages received from the clients 12 to the first available service provider 14 (e.g., 14A-E). It may be appreciated that the load balancing provided by the networking device 18 improves the efficiency of the system 10 by ensuring that the requests of the clients 12 are handled quickly and that the load is evenly spread across the service providers 14.
However, as illustrated in FIG. 1, this load balancing can result in deadlock in the WS-AT system 10. With reference to the example illustrated in FIG. 1, client 12B is attempting to perform a client transaction that results in the generation of two separate messages 20 and 22. By specific example, client 12B may be attempting to increase the balance of a banking account stored in the database 16, and in doing so, two messages are generated: message 20 to request the current account balance, and message 22 to request the addition of the appropriate amount to the current account balance. Since the networking device 18 generally routes client messages to a service provider based on information in the Hypertext Transfer Protocol (HTTP) header, and since there is no information in the HTTP header of messages 20 and 22 to indicate that they are part of the same client transaction, the network device 18 is unaware that both of these messages 20 and 22 are part of the same client transaction.
Accordingly, since the WS-AT system 10 illustrated in FIG. 1 lacks affinity routing, the networking device 18 receives the messages 20 and 22 and provides these messages to service providers 14 according to a load-balancing strategy, for example, in a round-robin fashion. As such, the message 20 is received by service provider 14B, while the message 22 is received by service provider 14D. The service provider 14B accesses the database 16 first (as indicated by the arrow 24) locking one or more records associated with the account. Accordingly, as presently recognized, when service provider 14D attempts to update the records associated with the same account to update the account balance (as indicated by the arrow 26) the service provider 14D is unable to lock the records associated with the account, resulting in deadlock as the client transaction remains uncompleted. If the deadlock continues for a sufficient amount of time, the request 26 made by service provider 14B will time-out, likely resulting in the client 12B and/or the service provider 14B repeating the request, increasing overhead and reducing efficiency of the system 10.
With the foregoing in mind, FIG. 2 illustrates an embodiment of WS-AT system 50, in accordance with embodiments of the present approach, which utilizes routing affinity at the transaction level to avoid the deadlock situation discussed above. Like the WS-AT system 10 illustrated in FIG. 1, the WS-AT system 50 of FIG. 2 includes a number of clients 12 that interact with a number of service providers 14 to use (e.g., access, read, lock, modify) a particular resource 16, such as a database. For the embodiment illustrated in FIG. 2, the clients 12 send requests to the service providers 14 by sending messages (e.g., SOAP requests) via an extensible markup language (XML) gateway 52 and a networking device 54 of the system 50.
The XML gateway 52 is generally a computing device that includes a memory 56 and a processor 58 programmed to receive and process messages 60 from the clients 12 into modified messages 62, as discussed below. The networking device 54 is also generally a computing device (e.g., a router) that includes a memory 66 and a processor 64 programmed receive the modified messages 62 from the XML server 52 and appropriately route these modified messages 62 to one of the service providers 14. As discussed below, the networking device 54 is capable of enabling affinity routing (e.g., for existing and continuing client transactions), while also providing load balancing for new client transactions. Further, as discussed in greater detail below, the illustrated networking device 54 includes a routing table 68 stored in the memory 66 that associates the transaction identifiers (Transaction IDs) of particular client transactions with particular service providers 14.
The WS-AT framework defines a transaction identifier (Transaction ID) that is included in a particular portion of all messages 60 provided by the clients 12. In certain embodiments, for example, the Transaction ID included in each message 60 may be a string of characters that uniquely identifies to which client transaction a particular message 60 belongs, and is used within the WS-AT framework to provide transactional functionality. As illustrated in FIG. 2, for example, when the messages 60 are simple object access protocol (SOAP) requests, each of the messages 60 generally include a Transaction ID in the SOAP header 70.
FIG. 3 illustrates an example embodiment of a process 80 whereby the XML gateway 52 operates to enable routing affinity within the system 50 illustrated in FIG. 2. The process 80 illustrated in FIG. 3 begins with the processor 58 of the XML gateway 52 receiving (block 82) messages 60 from a client 12B. The process 80 continues with the processor 58 of the XML gateway 52 determining (block 84) the Transaction ID associated with each of the messages 60 from the SOAP headers 70 of the messages 60. The processor 58 of the XML gateway 52 then modifies (block 86) the received messages 60 to generate modified messages 62 that (e.g., additionally or alternatively) include the Transaction ID in the HTTP header 72. Finally, the processor 58 of the XML gateway 52 sends (block 88) the modified messages 62 to the networking device 54.
FIG. 4 illustrates an example embodiment of a process 100 whereby the network device 54 operates to enable affinity routing within the system 50 illustrated in FIG. 2. The process 100 illustrated in FIG. 4 begins with the processor 64 of the networking device 54 receiving (block 102) the modified messages 62 from the XML gateway 52. The processor 64 of the networking device 54 may then determine (block 104) the Transaction ID of each of the messages 62 from the HTTP header of the modified message 62. It may be appreciated that, in general, the networking device 54 is adept at efficiently reading and analyzing information in the HTTP header 72, which speeds this step of the process 100.
Continuing through the process 100 illustrated in FIG. 4, next, the processor 64 may search the routing table 68 stored in the memory 66 of the networking device 54 to determine (block 106) whether the Transaction ID determined from the modified messages 62 is presently associated with a particular service provider 14. If the processor 64 determines that the Transaction ID is associated with a particular service provider in the routing table 68, then the processor 64 sends (block 108) the modified message to the associated service provider (e.g., service provider 14B, as illustrated in FIG. 2).
If, however, the processor 64 determines that the Transaction ID in the modified message 62 is not presently associated with one of the service providers 14 in the routing table 68, then the modified message 62 received in block 102 may be the first message of a series of messages of client transaction. As such, the processor 64 may use a load-balancing algorithm (e.g., a round-robin algorithm) to select a service provider (e.g., service provider 14B, as illustrated in FIG. 2), and then send (block 110) the modified message 62 to the available service provider to address the request of the client transaction. Finally, the illustrated process 100 concludes with the processor 64 of the networking device 54 adding the Transaction ID to the routing table 68, and associating the Transaction ID with the service provider to which the modified message was sent, which establishes a temporary affinity between Transaction ID and the particular service provider 14B.
Additionally, the routing table 68 may also be modified over time by the processor 64 of the networking device 54 to control the duration of affinity between the Transaction IDs and the service providers 14. For example, as mentioned above, in certain embodiments, each association that is added to the routing table 68 may only persist for a predefined time period (e.g., an affinity duration greater than or equal to 10 seconds, less than or equal to 30 seconds, less than or equal to 100 seconds, or between 10 second and 100 second) before the association is removed (e.g., deleted, erased, overwritten). As discussed below, in certain embodiments, the predefined time period may begin with the receipt of an initial message, or with the receipt or delivery of a most recent message, of a client transaction.
In certain embodiments, as illustrated by the example process 120 of FIG. 5, the predefined time period may begin from the receipt of the first message 62 of a client transaction (e.g., by the XML gateway, networking device, or service provider). As illustrated, in certain embodiments, when an association between a Transaction ID and a service provider 14 is added to the routing table 68 by the processor 64 of the networking device 56, a time stamp may be created or defined (block 122) for this association (e.g., the record of the routing table 68 storing the association may include a time stamp field that is suitably populated with the current time upon creation/instantiation), and this time stamp may define the beginning of the predefined time window. As such, the processor 64 of the networking device may subsequently determine (block 124) whether the predefined time period has passed relative to the time stamp, and if it has not, check again later, as indicated by arrow 125. When the processor 64 determines that the predefined period of time has passed relative to the time stamp, the processor 64 removes (block 126) the association between the Transaction ID and the service provider 14 in the routing table. This approach is beneficial in that the load can remain better balanced between the service providers 14. However, because of variations in the length of different transactions, this approach can result in the predefined time period ending before all of the messages related to certain client transactions can be received by the service provider 14.
With this in mind, in certain embodiments, the predefined time period may begin from the receipt of the last (e.g., most recent) message 62 of a client transaction (e.g., by the XML gateway, networking device, or service provider), as illustrated by the process 130 of FIG. 6. As illustrated in FIG. 6, in certain embodiments, an entry in the routing table 68 that stores an association between a Transaction ID and a service provider 14 includes a time stamp that is updated (block 132) to reflect a time at which the most recent message 62 was received by the networking device 54 (or the time at which the most recent message 62 was sent to the service provider 14 by the networking device 54), and this time stamp may define the beginning of the predetermined time window. As such, the processor 64 of the networking device may subsequently determine (block 134) whether the predefined time period has passed relative to the time stamp, and if it has not, the processor 64 may await additional messages from the client during the predefined time period, as indicated by arrow 125. If additional messages are received during the predefined time period, the time stamp is updated, and the predefined time period is reset. When the processor 64 determines that the predefined period of time has passed relative to the most recent time stamp without the receipt of additional messages from the client, the processor 64 removes (block 126) the association between the Transaction ID and the service provider 14 in the routing table. It may be appreciated that this approach is beneficial in that, with a properly selected predefined time window, the affinity between the Transaction ID and the service provider will be guaranteed for the duration of the transaction. However, since service providers 14 staying in service longer will shoulder more of the load over time, this approach can hamper load balancing.
While only certain features of the disclosure have been illustrated and described herein, many modifications and changes will occur to those skilled in the art. It is, therefore, to be understood that the appended claims are intended to cover all such modifications and changes as fall within the true spirit of the invention.

## Claims

1. A method of operating a networking device of a web service atomic transaction (WS-AT) system, comprising:
receiving a first modified message, wherein the first modified message includes an identifier in a hypertext transfer protocol (HTTP) header of the first modified message;
applying a load balancing algorithm to select a service provider from a plurality of service providers communicatively coupled to the networking device;
adding an entry to a routing table of the networking device, wherein the entry associates the identifier with the selected service provider;
sending the first modified message to the selected service provider;
receiving a second modified message, wherein the second modified message includes the identifier in the HTTP header of the second modified message;
sending the second modified message to the selected service provider based on the entry in the routing table; and
after sending the second modified message to the selected service provider, removing the entry from the routing table to dissociate the identifier from the selected service provider.

2. The method of claim 1, wherein the entry of the routing table comprises a time stamp that indicates a beginning of a predefined time window, and wherein the method comprises removing the entry from the routing table to dissociate the identifier from the selected service provider in response to determining, based on the time stamp, that the predefined time window has expired.

3. The method of claim 2, comprising generating the time stamp of the entry upon adding the entry to the routing table.

4. The method of claim 3, comprising updating the time stamp of the entry upon sending the second modified message to the selected service provider.

5. The method of claim 1, wherein the plurality of service providers is communicatively coupled to the networking device and at least one common resource.

6. The method of claim 5, wherein the first modified message and the second modified message comprise client requests to retrieve or update data within the at least one common resource, and wherein the at least one common resource comprises a database.

7. The method of claim 1, comprising, before applying the load balancing algorithm to select the service provider, determining that the identifier is not already present within the routing table.

8. A web service atomic transaction (WS-AT) system, comprising:
a networking device comprising a memory and a processor, wherein the memory is configured to store a routing table, and wherein the processor is configured to:
receive a first modified message, wherein the first modified message includes an identifier in a hypertext transfer protocol (HTTP) header of the first modified message;
apply a load balancing algorithm to select a service provider from a plurality of service providers communicatively coupled to the networking device;
add an entry to the routing table that associates the identifier with the selected service provider;
send the first modified message to the selected service provider;
receive a second modified message, wherein the second modified message includes the identifier in the HTTP header of the second modified message;
send the second modified message to the selected service provider based on the entry in the routing table; and
after sending the second modified message to the selected service provider, remove the entry from the routing table to dissociate the identifier from the selected service provider.

9. The WS-AT system of claim 8, wherein the first modified message and the second modified message correspond to access requests of a client.

10. The WS-AT system of claim 9, wherein the first modified message and the second modified message correspond to database access requests of the client.

11. The WS-AT system of claim 8, wherein the entry of the routing table comprises a time stamp that indicates a beginning of a predefined time window, and wherein the processor of the networking device is configured to remove the entry from the routing table to dissociate the identifier from the selected service provider in response to determining, based on the time stamp, that the predefined time window has expired.

12. The WS-AT system of claim 11, wherein the processor of the networking device is configured to generate the time stamp of the entry upon adding the entry to the routing table.

13. The WS-AT system of claim 11, wherein the processor of the networking device is configured to generate the time stamp of the entry upon sending the second modified message to the selected service provider.

14. The WS-AT system of claim 8, wherein, before applying the load balancing algorithm to select the service provider, the processor is configured to determine that the identifier is not already present within the routing table.

15. The WS-AT system of claim 8, wherein the identifier is a Transaction Identifier (ID).

16. The WS-AT system of claim 8, wherein the processor of the networking device is configured to receive the first modified message and the second modified message from a communicatively coupled gateway, wherein the gateway is configured to: extract the identifier from a (SOAP) header of a first message received from a client device, add the extracted identifier to the HTTP header of the first modified message, extract the identifier from a SOAP header of a second message received from the client device, and add the extracted identifier to the HTTP header of the second modified message.

17. The WS-AT system of claim 8, wherein the processor of the networking device is configured to:
receive a third modified message, wherein the third modified message includes a second identifier in a HTTP header of the third modified message;
apply the load balancing algorithm to select a second service provider from the plurality of service providers;
add a second entry to the routing table that associates the second identifier with the second selected service provider;
send the third modified message to the second selected service provider;
receive a fourth modified message, wherein the fourth modified message includes the second identifier in the HTTP header of the fourth modified message;
send the fourth modified message to the second selected service provider based on the second entry in the routing table; and
after sending the second modified message to the selected service provider, remove the second entry from the routing table to dissociate the second identifier from the second selected service provider.

18. A non-transitory, computer-readable medium storing instructions executable by a processor of a networking device, the instructions comprising instructions to:
receive a first modified message, wherein the first modified message includes an identifier in a hypertext transfer protocol (HTTP) header of the first modified message;
apply a load balancing algorithm to select a service provider from a plurality of service providers communicatively coupled to the networking device;
add an entry to a routing table of the networking device, wherein the entry associates the identifier with the selected service provider;
send the first modified message to the selected service provider;
receive a second modified message, wherein the second modified message includes the identifier in the HTTP header of the second modified message;
send the second modified message to the selected service provider based on the entry in the routing table; and
after sending the second modified message to the selected service provider, remove the entry from the routing table to dissociate the identifier from the selected service provider.

19. The medium of claim 18, wherein the entry of the routing table comprises a time stamp that is generated upon adding the entry to the routing table that indicates a beginning of a predefined time window, and wherein the instructions comprise instructions to remove the entry from the routing table to dissociate the identifier from the selected service provider in response to determining, based on the time stamp, that the predefined time window has expired.

20. The medium of claim 18, wherein the entry of the routing table comprises a time stamp that is generated upon sending the second modified message to the selected service provider that indicates a beginning of a predefined time window, and wherein the instructions comprise instructions to remove the entry from the routing table to dissociate the identifier from the selected service provider in response to determining, based on the time stamp, that the predefined time window has expired.