Abstract:
A method and Web server for verifying a Web service request originating from a Web page is provided. The method includes matching the Web service request with a Web service. A sequence ID contained in the request is identified. The Web service request is verified if the identified sequence ID does not correspond with a previous sequence ID for the matched Web service. Additionally, the Web service does not verify a same Web service request twice.

Description:
FIELD 
       [0001]    The present invention relates to a method and apparatus for reloading a Web server page in a Web browser, and in particular to a method and apparatus for overcoming the problem of a conflicting reload of a Web server page in a Web browser. 
       BACKGROUND 
       [0002]    When a Web page is submitted to a server through an hypertext transfer protocol (HTTP) POST request or an HTTP GET request, a Web user that attempts to refresh the server response may cause the contents of the original request to be resubmitted, possibly causing undesired results, such as a duplicate Web purchase. The reload problem occurs in many situations. Actions that re-request a document from the server may include: pressing a reload or refresh button; printing or saving the uniform resource locator (URL) in the browser and returning to the page using a bookmark or favorite; using back or forward buttons; pressing an enter key in a URL location entry box; and resizing the browser window. Typically an HTTP response contains a reload request to an URL that just displays the result. Accordingly, there exists a need in the art to overcome at least some of the deficiencies and limitations described herein above. 
       BRIEF SUMMARY 
       [0003]    A first aspect of the invention provides a Web server comprising a computer processor coupled to a computer-readable memory unit, a matcher component, an identifier component, and a verifier component, the memory unit comprising instructions that when executed by the computer processor implements a method for verifying a Web service request originating from a Web form, the method comprising: matching, by the computer processor executing the matcher component, the Web service request with a Web service; identifying, by the computer processor executing the identifier component, a sequence ID contained in the request; and verifying, by the computer processor executing the verifier component, the Web service request if the identified sequence ID does not correspond with an already received sequence ID for the matched Web service, wherein the Web service does not verify a same Web service request twice. 
         [0004]    A second aspect of the invention provides a method for verifying a Web service request originating from a Web page, the method comprising: matching, by a computer processor of a Web server executing a matcher component of the Web server, the Web service request with a Web service; identifying, by the computer processor executing an identifier component of the Web server, a sequence ID contained in the request; and verifying, by the computer processor executing a verifier component of the Web server, the Web service request if the identified sequence ID does not correspond with a previous sequence ID for the matched Web service, wherein the Web service does not verify a same Web service request twice. 
         [0005]    A third aspect of the invention provides a computer program product, comprising a computer readable hardware storage device storing a computer readable program code, the computer readable program code comprising an algorithm that when executed by a computer processor of a Web server system implements a method, the method comprising: matching, by the computer processor executing a matcher component of the Web server, the Web service request with a Web service; identifying, by the computer processor executing an identifier component of the Web server, a sequence ID contained in the request; and verifying, by the computer processor executing a verifier component of the Web server, the Web service request if the identified sequence ID does not correspond with a previous sequence ID for the matched Web service, wherein the Web service does not verify a same Web service request twice. 
         [0006]    The present invention is able to improve the accuracy of a process for submitting a Webpage. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0007]      FIG. 1  illustrates a computer system deployment diagram, in accordance with embodiments of the present invention. 
           [0008]      FIG. 2  illustrates a component diagram of a sequence ID, in accordance with embodiments of the present invention. 
           [0009]      FIG. 3  illustrates a flow diagram of a process, in accordance with embodiments of the present invention. 
           [0010]      FIG. 4  illustrates an interaction diagram, in accordance with embodiments of the present invention. 
           [0011]      FIG. 5  illustrates a more detailed interaction diagram, in accordance with embodiments of the present invention. 
           [0012]      FIGS. 6A and 6B  illustrate an example interaction diagram, in accordance with embodiments of the present invention. 
       
    
    
     DETAILED DESCRIPTION 
       [0013]    Referring to  FIG. 1 , the deployment of a preferred embodiment in computer processing system  10  is described. Computer processing system  10  is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well-known computing processing systems, environments, and/or configurations that may be suitable for use with computer processing system  10  include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments that include any of the above systems or devices. 
         [0014]    Computer processing system  10  may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer processor. Generally, program modules may include routines, programs, objects, components, logic, and data structures that perform particular tasks or implement particular abstract data types. Computer processing system  10  may be embodied in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices. 
         [0015]    Computer processing system  10  comprises: general-purpose computer server  12 , computer client  13  and one or more user input devices  14  and user output devices  16  directly attached to the computer client  13 . Computer server  12  and computer client  13  are connected to a network  20  via network adapters (not shown). Input devices  14  include one or more of: a keyboard, a scanner, a mouse, trackball or another pointing device. Output devices  16  include one or more of a display or a printer. Network  20  can be a local area network (LAN), a wide area network (WAN), or the Internet. 
         [0016]    Computer server  12  comprises: central processing unit (CPU)  22 ; network adapter (not shown); bus  28  and memory  30 . Computer client  13  also comprises: a CPU; network adapter; bus; and memory but these are not shown. 
         [0017]    CPU  22  loads machine instructions from memory  30  and performs machine operations in response to the instructions. Such machine operations include: incrementing or decrementing a value in register (not shown); transferring a value from memory  30  to a register or vice versa; branching to a different location in memory if a condition is true or false (also known as a conditional branch instruction); and adding or subtracting the values in two different registers and loading the result in another register. A typical CPU can perform many different machine operations. A set of machine instructions is called a machine code program, the machine instructions are written in a machine code language which is referred to a low level language. A computer program written in a high level language needs to be compiled to a machine code program before it can be run. Alternatively a machine code program such as a virtual machine or an interpreter can interpret a high level language in terms of machine operations. 
         [0018]    A network adapter (not shown) is connected to bus  28  and network  20  for enabling communication between the computer server  12  and network devices. 
         [0019]    A device adapter (not shown but more relevant for computer client  13 ) is for enabling communication on input devices  14  and output devices  16 . 
         [0020]    Bus  28  couples the main system components together including memory  30  to CPU  22 . Bus  28  represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnects (PCI) bus. 
         [0021]    Memory  30  includes computer system readable media in the page of volatile memory  32  and non-volatile or persistent memory  34 . Examples of volatile memory  32  are random access memory (RAM)  36  and cache memory  38 . Generally volatile memory is used because it is faster and generally non-volatile memory is used because it will hold the data for longer. Computer processing system  10  may further include other removable and/or non-removable, volatile and/or non-volatile computer system storage media. By way of example only, persistent memory  34  can be provided for reading from and writing to a non-removable, non-volatile magnetic media (not shown and typically a magnetic hard disk or solid-state drive). Although not shown, further storage media may be provided including: an external port for removable, non-volatile solid-state memory; and an optical disk drive for reading from or writing to a removable, non-volatile optical disk such as a compact disk (CD), digital video disk (DVD) or Blu-ray. In such instances, each can be connected to bus  28  by one or more data media interfaces. As will be further depicted and described below, memory  30  may include at least one program product having a set (for example, at least one) of program modules that are configured to carry out the functions of embodiments of the invention. 
         [0022]    The set of program modules configured to carry out the functions of the preferred embodiment comprises: Web server module  100  in computer server  12  and Web browser module  110  in computer client  13 . Further program modules that support the preferred embodiment but are not shown include firmware, boot strap program, operating system, and support applications. Each of the operating system, support applications, other program modules, and program data or some combination thereof, may include an implementation of a networking environment. 
         [0023]    Computer processing system  10  communicates with at least one network  20  (such as a local area network (LAN), a general wide area network (WAN), and/or a public network like the Internet) via network adapter  24 . Network adapter  24  communicates with the other components of computer server  12  via bus  28 . It should be understood that although not shown, other hardware and/or software components could be used in conjunction with computer processing system  10 . Examples, include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, redundant array of independent disks (RAID), tape drives, and data archival storage systems. 
         [0024]    Web server  100  comprises web service  102  and request verifier  104 . Request verifier  104  comprises: sequence ID engine  200  and request verification method  300 . 
         [0025]    In operation, Web browser  110  downloads Web page  112  comprising a sequence ID  114 . 
         [0026]    Still yet, any of the components of the present invention could be created, integrated, hosted, maintained, deployed, managed, serviced, etc. by a service supplier who offers to enable a process for scoring conditions and presenting results. Thus the present invention discloses a process for deploying, creating, integrating, hosting, maintaining, and/or integrating computing infrastructure, including integrating computer-readable code into the computer system  90 , wherein the code in combination with the computer system  90  is capable of performing a method for scoring conditions and presenting results. In another embodiment, the invention provides a business method that performs the process steps of the invention on a subscription, advertising, and/or fee basis. That is, a service supplier, such as a Solution Integrator, could offer to enable a process for scoring conditions and presenting results. In this case, the service supplier can create, maintain, support, etc. a computer infrastructure that performs the process steps of the invention for one or more customers. In return, the service supplier can receive payment from the customer(s) under a subscription and/or fee agreement and/or the service supplier can receive payment from the sale of advertising content to one or more third parties. 
         [0027]    Aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, microcode, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module,” or “system.” 
         [0028]    The present invention may be a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention. 
         [0029]    The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire. 
         [0030]    Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device. 
         [0031]    Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user&#39;s computer, partly on the user&#39;s computer, as a stand-alone software package, partly on the user&#39;s computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user&#39;s computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention. 
         [0032]    Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions. 
         [0033]    These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks. 
         [0034]    The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks. 
         [0035]    The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions. 
         [0036]      FIG. 2  illustrates a sequence ID engine  200 , in accordance with embodiments of the present invention. Sequence ID engine  200  comprises: sequence ID registers  202 A to  202 N; corresponding session registers  203 A to  203 N; sequence ID test register  204 ; sequence ID generator  206 ; and a sequence ID comparator  208 . 
         [0037]    Sequence ID registers  202 A to  202 N are used for storing a sequence ID after it the sequence ID is generated. 
         [0038]    Session registers  203 A to  203 N are associated with respective sequence ID registers  202 A to  202 N and are used for storing the particular user session associated with a generated sequence ID thereby allowing a sequence ID to be associated with a particular user session thereby associated with all the objects of the associated user session. 
         [0039]    Sequence ID test register  204  is used for storing a sequence ID under test. 
         [0040]    Sequence ID generator  206  is used for generating a sequence ID and for saving the generated sequence ID in sequence ID register  202 . 
         [0041]    Sequence ID comparator  208  is used for comparing the sequence ID stored in sequence ID register  202  with a sequence ID stored in sequence ID test register  204 . 
         [0042]    Sequence ID engine  200  is described in terms of a single sequence ID for simplicity, however, the embodiments are adapted to handle multiple sequence IDs. 
         [0043]      FIG. 3  illustrates an algorithm detailing a request verification method  300 , in accordance with embodiments of the present invention. The request verification method  300  comprises logical process steps  302  to  314  for carrying out the steps of an embodiment of the invention. 
         [0044]    Step  302  comprises a start of the process. 
         [0045]    Step  304  comprises matching a Web service request with Web service by checking the user session of the Web service. 
         [0046]    Step  306  comprises identifying a sequence ID contained in the Web service request and loading the identified sequence ID into the sequence ID test register  204 . 
         [0047]    Step  308  comprises checking if the identified sequence ID corresponds with allowable sequence ID for the matched Web service. A look up is performed using the session registers  203 A to  203 N to locate associated sequence registers from sequence ID registers  202 A to  202 N. Sequence ID comparator  208  compares the sequence ID in the associated sequence register with the sequence ID in sequence ID test register  204 . If the sequence IDs corresponds or matches then step  310 . If the sequence IDs do not correspond or match then step  312 . 
         [0048]    Step  310  comprises allowing the Web request to proceed as it is and the process is terminated in step  314 . 
         [0049]    Step  312  comprises amending the request by stripping out extra parameters from the request and the process is terminated in step  314 . 
         [0050]    Referring to  FIG. 4 , a message flow of the prior art comprises steps  402  to  408 . 
         [0051]      FIG. 4  illustrates an algorithm detailing an example interaction in accordance with embodiments of the present invention. The algorithm of  FIG. 4  comprises steps  602  to  612  with respect to a single request. 
         [0052]    In step  602 , a user fills out an order form on a computer client and clicks a submit request. A Web SUBMIT command is sent from the computer client to a Web service on a server computer. 
         [0053]    In step  604 , the Web service receives the SUBMIT command and initiates a POST Command. Nothing is sent back to the client at this stage and nothing is cached. 
         [0054]    In step  606 , the Web Service checks a sequence ID against an expected ID. If the sequence ID differs from the expected ID, then the parameters in the SUBMIT command are removed. The server sends a confirmation page containing a 2xx success code. If the URL contains the parameters then step is  608  is executed. If the parameters are removed then step  612  is executed. 
         [0055]    In step  608 , when the URL contains parameters, the client displays a successful order page. If the user refreshes the page then step  610  is executed. 
         [0056]    In step  610 , the user (accidently or intentionally) refreshes the Web page displaying the order form. However, since the parameters in the submit command have been removed then the process recycles from step  604 . 
         [0057]    In step  612 , (when the URL does not contain parameters) the client displays a new order form. If the user fills in the form then the user repeats step  602 . 
         [0058]      FIG. 5  illustrates an algorithm detailing a further example interaction diagram, in accordance with embodiments of the present invention. The algorithm of  FIG. 5  includes an example sequence ID comprising steps  702  to  712 . 
         [0059]    In step  702 , a customer requests a page containing possible context modification requests such as a purchase. The server generates an expected sequence ID of 1234. 
         [0060]    In step  704 , a page is generated with all links or forms containing a sequence ID=1234 
         [0061]    In step  706 , the customer submits a purchase request containing a sequence ID=1234. The expected sequence ID is correct and the request is accepted. The next sequence ID is computed as 1235. 
         [0062]    In step  708 , a new page is generated with all links or forms containing sequence ID=1235. 
         [0063]    In step  710 , the customer re-submits the same purchase request with sequence ID=1234. This time the expected sequence ID is incorrect and the request is rejected. The next sequence ID=1236 is computed. 
         [0064]    In step  712 , the process is repeated. 
         [0065]      FIGS. 6A and 6A , in combination, illustrate an algorithm detailing a further example interaction diagram, in accordance with embodiments of the present invention. The algorithms of  FIGS. 6A and 6B  comprise steps  802  to  824  with particular attention to an application interaction and an example URL. 
         [0066]    In step  802 , a user requests a page for an online shop. In response, A HTTP GET command (http://server/page) is sent from the client to the server requesting the page. 
         [0067]    In step  804 , the server generates a new sequence ID and stores it as session data. The HTTP GET command is forwarded to the application and a secure URL (initSecureUrl http://server/page) is sent back to the server. 
         [0068]    In step  806 , the server adds the sequence ID to the URL (http://server/page?Id=3452768) 
         [0069]    In step  808 , the application builds page content including URLs using given prefix such as http://server/page?Id=3452768&amp;Action=Buy. The application responds by sending an HTTP 200 Okay message plus the page content and the server forwards this response to the client. 
         [0070]    In step  810 , a user clicks on the URL to buy a referenced article. The client sends an HTTP GET command including the URL to the server (GET http://server/page?Id=3452768&amp;Action=Buy). 
         [0071]    In step  812 , the server checks that the sequence ID is the expected one and forwards the command to the application. 
         [0072]    In step  814 , the application performs the required action and builds a response page. An HTTP OK signal is sent back to the server (200 OK+page content). 
         [0073]    In step  816 , the server generates a new ID and sends it to the client (200 OK plus page content). 
         [0074]    In step  818 , the user reloads the page by sending an HTTP Get signal to the server. GET http://server/page?Id=3452768&amp;Action=Buy. 
         [0075]    In step  820 , the server checks the sequence ID and upon determining that the sequence ID is an old sequence ID (by check prior sequence IDs) or determining that it is not the same (‘No match’) as the newly generated ID then in step  816 , the server removes all elements after the URL (in this case the elements ‘?Id=3452768&amp;Action=Buy’) and sends the stripped down URL to the application (GET http://server/page). 
         [0076]    In step  822 , the server generates a new sequence ID. 
         [0077]    In step  824 , the application builds response page for stripped down URL request and sends an HTTP message signal 200 OK plus the page content to the server. The server forwards the HTTP message to the client. 
         [0078]    Whilst a particular advantage of the preferred embodiment is that the solution is transparent to the Web service, in a further embodiment it is possible to perform the invention without stripping out the extra parameters of the request and instead passing the request ‘as is’ to the Web service  102 . In this case the application would understand that the sequence ID was not verified and would then ignore the extra elements in the URL. 
         [0079]    Further embodiments of the invention are now described. It will be clear to one of ordinary skill in the art that all or part of the logical process steps of the preferred embodiment may be alternatively embodied in a logic apparatus, or a plurality of logic apparatus, comprising logic elements arranged to perform the logical process steps of the method and that such logic elements may comprise hardware components, firmware components or a combination thereof. 
         [0080]    It will be equally clear to one of skill in the art that all or part of the logic components of the preferred embodiment may be alternatively embodied in logic apparatus comprising logic elements to perform the steps of the method, and that such logic elements may comprise components such as logic gates in, for example a programmable logic array or application-specific integrated circuit. Such a logic arrangement may further be embodied in enabling elements for temporarily or permanently establishing logic structures in such an array or circuit using, for example, a virtual hardware descriptor language, which may be stored and transmitted using fixed or transmittable carrier media. 
         [0081]    In a further alternative embodiment, the present invention may be realized in the form of a computer implemented method of deploying a service comprising steps of deploying computer program code operable to, when deployed into a computer infrastructure and executed thereon, cause the computer system to perform all the steps of the method. 
         [0082]    It will be appreciated that the method and components of the preferred embodiment may alternatively be embodied fully or partially in a parallel computing system comprising two or more processors for executing parallel software. 
         [0083]    It will be clear to one skilled in the art that many improvements and modifications can be made to the foregoing exemplary embodiment without departing from the scope of the present invention.