A mechanism for platform-independent communication with web servers is disclosed. A method of embodiments of the invention includes accessing a web server of a plurality of web servers from a computer system using a cli. Accessing the web server is performed independent of a runtime environment at the computer system. The method further includes establishing communication between the web server and the computer system. Establishing communication further includes converting web service arguments into command line arguments that are cli-compatible and provided through a cli console associated with the cli.
|
1. A method comprising:
for each of a plurality of web service methods, determining, by a processing device executing a command line interface (cli) console, whether an argument of the web service method comprises a primitive type property or an object, wherein the plurality of web service methods correspond to a web service executing on a web server separate from a computer system of the processing device;
creating, by the processing device via the cli console, method signatures for each of the plurality of web service methods, wherein the creating further comprises:
when the argument comprises a primitive type property, storing the argument as a semantic of the method signature; and
when the argument comprises an object, parsing the object until a primitive type property is located and storing the located primitive type property and the object as the semantic of the method signature;
generating, by the processing device via the cli console, command line arguments for each of the method signatures by utilizing the stored semantics of the method signatures, wherein the command line argument are cli-compatible;
receiving, via the cli console, at least one of the command line arguments directed to the web server;
converting, by the processing device, the received at least one command line argument into the corresponding argument of the web service in view of the generated method signature for the argument of the web service;
accessing, by the processing device, the web server using the web service argument generated from the converting, wherein the accessing of the web server is performed independent of a runtime environment and operating system of the computer system; and
converting the web service arguments received from the web server into the command line arguments for processing by the computer system.
8. A computing device comprising:
a memory to store instructions to establish platform-independent communication with a web server; and
a processing device communicably coupled to the memory, the processing device to execute the instructions that cause the processing device to:
for each of a plurality of web service methods, determine whether an argument of the web service method comprises a primitive type property or an object, wherein the plurality of web service methods correspond to a web service executing on a web server separate from the computing device;
create, via a command line interface (cli) console, method signatures for each of the plurality of web service methods, wherein the creating further comprises:
when the argument comprises a primitive type property, store the argument as a semantic of the method signature; and
when the argument comprises an object, parsing the object until a primitive type property is located and storing the located primitive type property and the object as the semantic of the method signature;
generate, via the cli console, command line arguments for each of the method signatures by utilizing the stored semantics of the method signatures, wherein the command line argument are cli-compatible;
receive, via the cli console, at least one of the command line arguments directed to the web server;
convert the received at least one command line argument into the corresponding argument of the web service in view of the generated method signature for the argument of the web service;
access the web server using the web service argument generated from the converting, wherein the accessing of the web server is performed independent of a runtime environment and operating system of the computing device; and
convert the web service arguments received from the web server into the command line arguments for processing by the computer system.
15. A non-transitory machine-readable storage medium including instructions that, when accessed by a processing device, cause the processing device to:
for each of a plurality of web service methods, determine, by the processing device executing a command line interface (cli) console, whether an argument of the web service method comprises a primitive type property or an object, wherein the plurality of web service methods correspond to a web service executing on a web server separate from a computer system of the processing device;
create, by the processing device via the cli console, method signatures for each of the plurality of web service methods, wherein the processing device to create the method signatures further comprises the processing device to:
when the argument comprises a primitive type property, store the argument as a semantic of the method signature; and
when the argument comprises an object, parse the object until a primitive type property is located and storing the located primitive type property and the object as the semantic of the method signature;
generate, by the processing device via the cli console, command line arguments for each of the method signatures by utilizing the stored semantics of the method signatures, wherein the command line argument are cli-compatible;
receive, via the cli console, at least one of the command line arguments directed to the web server;
convert, by the processing device, the received at least one command line argument into the corresponding argument of the web service in view of the generated method signature for the argument of the web service;
access, by the processing device, the web server using the web service argument generated from the converting, wherein the accessing of the web server is performed independent of a runtime environment and operating system of the computer system; and
convert the web service arguments received from the web server into the command line arguments for processing by the computer system.
2. The method of
3. The method of
4. The method of
5. The method of
6. The method of
7. The method of
9. The computing device of
generate code for the web service; and
facilitate bi-directional communication between the web service and the computing device.
10. The computing device of
11. The computing device of
12. The computing device of
13. The computing device of
14. The computing device of
16. The non-transitory machine-readable storage medium of
17. The non-transitory machine-readable storage medium of
18. The non-transitory machine-readable storage medium of
19. The non-transitory machine-readable storage medium of
20. The non-transitory machine-readable storage medium of
|
The embodiments of the invention relate generally to web server communication and, more specifically, relate to a mechanism for providing platform-independent communication with web servers using command line interface.
Web servers are well-known for performing various functions, including serving web content (e.g., web pages), using Hypertext Transfer Protocol (HTTP), over the World Wide Web (WWW). Web servers are primarily known for delivering web content or used as monitoring devices as part of a monitoring system. A typical web server refers to a computer server that executes web services. However, accessing a web server requires dealing with a number of dependencies which makes web server communication a cumbersome process. The process becomes even more convoluted when multiple web servers are involved. For example, a separate client is required to be generated for each web server that is being accessed and this client-generation depends on the base runtime platform (e.g., Microsoft® .NET®, Java® Runtime Environment, etc.) which further depends on the base operating system (e.g., Microsoft Windows®, Linux®, Unix®, etc.) and so forth.
The invention will be understood more fully from the detailed description given below and from the accompanying drawings of various embodiments of the invention. The drawings, however, should not be taken to limit the invention to the specific embodiments, but are for explanation and understanding only.
Embodiments of the invention provide for platform-independent communication with web servers. A method of embodiments of the invention includes accessing a web server of a plurality of web servers from a computer system using a Command Line Interface (CLI). Accessing the web server is performed independent of a runtime environment employed at the computer system. The method further includes establishing communication between the web server and the computer system, which includes converting web service arguments into command line arguments that are CLI-compatible and provided through a CLI console associated with the CLI.
Embodiments of the invention provide improved two-way communication between web servers and computer systems such that the communication is performed using a CLI and is free of excessive dependencies. In one embodiment, communication between a web server and a computer system is established and maintained independent of runtime environments, operating systems, programming languages, etc., employed at or associated with either the computer system or the web server. For example, regardless of the operating system employed at a computer system, a user (e.g., software developer, programmer, etc.) can use the CLI console at the computer system to access a web server. Moreover, in case of multiple web servers, as soon as the user provides a Uniform Record Locator (URL) identifying a web server, a code corresponding to the web server is dynamically and instantly generated to provide a seamless switching between various web servers and thus, greatly reducing the human factor from the process.
Host machine 100 includes a base hardware platform having a processor 102 that is capable, for example, of working with an operating system 104. Operating system 104 serves as an interface between hardware/physical resources of the host machine 100 and the user. In some embodiments, base hardware platform may include memory devices, network devices, drivers, and so on. Host machine 100 includes a server computer system or a client computer system. Terms like “machine”, “device” and “computer system” are used interchangeably throughout this document.
In one embodiment, the host machine 100 includes a universal runtime environment 106 that is independent of operating systems 104. For example, Python® runtime environment, which is known as a universal runtime environment and supports any number of operating systems 104 (e.g., Windows, Linux, Unix, Mac®, etc.), may be employed as the runtime environment 106. The two-way communication between the host machine 100 and a web server may be established by the communication mechanism 108 using a Simple Object Access Protocol (SOAP)/SUDS communication package 110 over a network (e.g., Wide Area Network (WAN), Local Area Network (LAN), Internet, etc.). SOAP refers to a protocol used for accessing web servers, exchanging structured information in the implementation of web services, and consuming web services; while, SUDS is a SOAP-based WebService communicating that is particular to Python runtime environment.
In one embodiment, the communication mechanism 108 includes a code generation entity 212 and an access entity 222. The code generation entity 212 includes a description access module 214 and a dynamic code generator 216. In one embodiment, when an attempt is made by a user to access web server A 204, such as when a URL corresponding to web server A 204 is provided by the user, the description access module 214 accesses, via WSDL, web services description associated with web server A 204 and extracts relevant information about web server A 204 from its WSDL. In one embodiment, dynamic code generator 216 uses the extracted relevant information from WSDL to generate a code that is particular to web server A 204 so that communication with web server A 204 can be established. This, for example, allows the code generation entity 212 to work with access entity 222 to translate or convert web service method arguments into CLI arguments and vice versa based on providing a platform-independent two-way communication between the web server A 204 and the host machine and other machines. Using the CLI, and thus CLI arguments, etc., the platform-independent communication is provided independent of software frameworks, operation systems, and programming languages, and other software applications, etc., employed at these machines. If, for example, the user switches to access another web server, such as web server B 206, by entering a URL corresponding to web server B 206, the description access module 214 instantly switches to accessing web services description associated with web server B 206 and, as with web server A 204, it dynamically generates a code relevant to web server B 206 to, seamlessly, facilitate communication between the host machine and, now, web server B206.
In one embodiment, the access entity 222 of the communication mechanism 106 includes a CLI shell console 224 and a WSDL-CLI utility module 226. The CLI console 224 allows a user to access a web server 204, 206 using CLI. WSDL-CLI utility module 226 works with construction module 232 to construct CLI arguments from web service method arguments and further, with deconstruction module 234 to deconstruct CLI arguments back to web service method arguments to facilitate communication between the host machine and web servers 204, 206 using CLI. For example, if web server A 204 is to be accessed, the web service methods relating to web server A 204 are researched for web service method arguments which are further researched for objects and primitive type properties of the web service associated with web server A 204. Since primitive type properties are compatible with CLI, they are stored and provided as they are found. The properties may be stored at a storage device or a database associated with the host machine employing the communication mechanism 108. The objects of the web services methods associated with the web service, on the other hand, are continuously researched until a primitive type property (e.g., integer, string, etc.) is found within the last found object. For example, if object A of a web service method argument is researched and object B is found within object A, then object B is researched and, let us suppose, object C is found within object B. Object C is then researched and, for example, primitive property P is found within object C. In this case, the CLI argument of this corresponding web service method argument is presented in a “period” or “dot” form, such as A.B.C.P. Conversely, a CLI argument is deconstructed, using the deconstruction module 234, to construct or reach a corresponding web service method argument. Using the foregoing example, P is provided as a primitive type property, while the A.B.C portion of the CLI argument is deconstructed into their original forms as objects A, B and C to be provided as a web service method argument. Web service method arguments are part of web services methods and they are used to call web service methods which are part of web services that are executed on web servers 204, 206.
In one embodiment, as aforementioned, the SOAP/SUDS communication package is used to establish network contact between host machine and a web server. In one embodiment, SOAP/SUDS communication package includes a protocol that is used to create an instance that provides a web service proxy that may be used as a network interface to access and/or call web service methods of a web server. Typically, the called web service methods are executed locally on a web server by a web service. In one embodiment, a web service proxy is used to access or call web service methods as proxy web service methods, at block 305, while a research proxy of the web service proxy is used to research the proxy web service methods at block 310. Although, in one embodiment, proxies may be generated to call or research web service methods, in another embodiment, such tasks may be performed without the use of proxies. At block 315, WSDL-CLI utility module triggers the construction module of the communication mechanism to generate a method signature for each web service method. Each method signature includes the semantics of a web server method as provided through its corresponding proxy web service method. These method signatures are stored locally in a method signature container.
In one embodiment, at block 320, each method signature is researched for the web service method arguments of its corresponding web service method. Typically, each web service method includes one or both of the following arguments: (1) a primitive type property (e.g., a simple integer or string) that is compatible with CLI; and (2) an object (which may contain one or more additional objects and/or a primitive type property) that is incompatible with CLI. In one embodiment, the web service method semantics at each signature method is researched to determine whether the signature method's corresponding web service method's argument includes a primitive type property or an object. If the argument is a primitive type property, it is stored because it is compatible with CLI. If, however, the argument is an object, further research is done to determine whether the object contains another object or a primitive type property. If the object contains a primitive type property, it is saved. If not, the object is continued to be researched until a primitive type property is found. This is further discussed with reference to
Once the web service method arguments are researched, a CLI argument representing each web service method argument is created within its corresponding signature method at block 325. For example, for an argument that contains an object (e.g., A) which contains a primitive type property (e.g., P), its dot or period CLI argument representation may look like “A.P”. If, however, the first object (i.e., A) contains a second object (e.g., B), the second object is researched. If the second object (i.e., B) contain a primitive type property (e.g., P), its new CLI argument may be represented as “A.B.P”.
Each method signature representing a CLI argument is then referenced or mapped to its corresponding proxy web service method (associated with a web service method) at block 330. Each signature method is stored in a method container at block 335. At block 340, CLI-based access to web servers is provided using these stored signature methods representing CLI arguments corresponding to web server method arguments and their associated web server methods.
In one embodiment, at block 405, each method signature is researched as discussed with reference to
If the object 420 includes another object 445, a period- or dot-based CLI argument is formed (by adding a period or dot to separate the two objects 420, 445) at block 450 and the process continues with further researching the object property of the object 420 until a primitive type property 440 is found. For example, if object A (e.g., object 420) includes object B (e.g., object 445) which includes a primitive type property P (e.g., primitive type 440), its period- or dot-based CLI argument is completed and represented as A.B.P at block 455. At block 460, a determination is made as to whether the last primitive type property was the last property of object 420. If not, the process continues with block 435. If yes, the final CLI argument is saved within the corresponding method signature which is stored at a method signature container and the process continues with researching another web service method argument of a method signature at block 410.
In one embodiment, period or dot CLI arguments, like A.B.P, are deconstructed back into being web service method arguments that are used to call their corresponding web service methods of web services being executed at web servers. This is the reverse of constructing CLI arguments from web service method arguments as described in
In the illustrated embodiment, when a user types in CLI-based commands, they are received by the utility module at block 605. Upon receiving the commands, the deconstruction module of the communication mechanism is invoked, at block 610, to deconstruct CLI arguments associated with the received commands into web service method arguments for web servers to comprehend. This deconstruction process is further described with reference to
At block 620, in one embodiment, each CLI argument is deconstructed into a web service method argument. The deconstruction may include generating web service method variables associated with a corresponding web service method by collapsing the CLI argument into objects and primitive type properties and then, assigning CLI argument values obtained from these objects and properties and, if any, provided by the user to the web service method variables to generate a corresponding web service method argument. At block 625, the corresponding web service method is called using the web service method argument via SUDS/SOAP. In case of the web server responding back to the user, the web server's response may be displayed back to the user using the CLI console on the host machine.
In one embodiment, a CLI argument 705 is researched at block 710 to determine whether it contains an object 715 and/or a primitive type property 720. If the CLI argument is determined to contain a primitive type property 720, it is used to construct a web service method argument at block 725 and an applicable value of the property 720 and/or as defined by the user is assigned to the web service method argument at block 730. The web service method argument is then stored, at block 735, in a web service method argument container 740.
Referring back to block 710, if the CLI argument includes an object, the object is further researched, at block 745, to determine whether there is another object 750 within the object 715 or a primitive type property 755. This process continues by accessing the objects in the period-based CLI argument by moving from one period to another period at block 760. For example, in case of A.B.C.P (where, A, B and C are all objects, while P is a primitive type property), the process first finds primitive type property P and then moves a period over to discover object C and so forth until it reaches object A. At block 730, any known values are first used to construct the web service method argument, such as placing the value of the primitive type property 755 (such as property P and/or any other values defined by the user) in its proper location within its object, such as object C, and the process continues until the last object, such as object A, is reached. The web service method argument is then saved at block 735 in the web service method argument container 740. The web service method argument is then used to call the corresponding web service method of a web service running at a web server. At block 770, a determination is made as to whether the period is the last period of the argument. If not, the process continues with block 745. If yes, the process goes further back to continue at block 710.
The exemplary computer system 900 includes a processing device 902, a main memory 904 (e.g., read-only memory (ROM), flash memory, random access memory (RAM), dynamic RAM (DRAM) such as synchronous DRAM (SDRAM), DRAM (RDRAM), etc.), a static memory 906 (e.g., flash memory, static random access memory (SRAM), etc.), and a secondary memory 918 (e.g., a data storage device in the form of a drive unit, which may include fixed or removable machine-accessible or computer-readable storage medium), which communicate with each other via a bus 930.
Processing device 902 represents one or more general-purpose processing devices such as a microprocessor, central processing unit, or the like. More particularly, the processing device may be complex instruction set computing (CISC) microprocessor, reduced instruction set computer (RISC) microprocessor, very long instruction word (VLIW) microprocessor, or processor implementing other instruction sets, or processors implementing a combination of instruction sets. Processing device 902 may also be one or more special-purpose processing devices such as an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a digital signal processor (DSP), network processor, or the like. Processing device 902 is configured to execute the processing logic 926 for performing the operations and methods discussed herein.
The computer system 900 may further include a network interface device 908. The computer system 900 also may include a video display unit 910 (e.g., a liquid crystal display (LCD) or a cathode ray tube (CRT)) connected to the computer system through a graphics port and graphics chipset, an alphanumeric input device 912 (e.g., a keyboard), a cursor control device 914 (e.g., a mouse), and a signal generation device 916 (e.g., a speaker).
The data storage device 918 may include a machine-accessible storage medium (or a computer-readable storage medium) 928 on which is stored one or more sets of instructions 922 (e.g., communication mechanism) embodying any one or more of the methodologies or functions described herein. The communication mechanism may also reside, completely or at least partially, within the main memory 904 (e.g., communication mechanism (instructions) 922) and/or within the processing device 902 (e.g., communication mechanism (processing logic) 926) during execution thereof by the computer system 900, the main memory 904 and the processing device 902 also constituting machine-readable storage media. Further, for example, the communication mechanism instructions 922 may be transmitted or received over a network 920 via the network interface device 908. As aforementioned with reference to
The machine-readable storage medium 928 may also be used to store the communication mechanism (instructions) 922 persistently. While the machine-accessible storage medium 928 is shown in an exemplary embodiment to be a single medium, the term “machine-accessible storage medium” should be taken to include a single medium or multiple media (e.g., a centralized or distributed database, and/or associated caches and servers) that store the one or more sets of instructions. The term “machine-accessible storage medium” shall also be taken to include any medium that is capable of storing, encoding or carrying a set of instruction for execution by the machine and that cause the machine to perform any one or more of the methodologies of the present invention. The term “machine-accessible storage medium” shall accordingly be taken to include, but not be limited to, solid-state memories, and optical and magnetic media.
Communication mechanism modules 932, components and other features described herein (for example in relation to
In the above description, numerous details are set forth. It will be apparent, however, to one skilled in the art, that the present invention may be practiced without these specific details. In some instances, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring the present invention.
Some portions of the detailed descriptions above are presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here, and generally, conceived to be a self-consistent sequence of steps leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.
It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise, as apparent from the following discussion, it is appreciated that throughout the description, discussions utilizing terms such as “accessing”, “establishing”, “communicating”, “maintaining”, “finding”, “locating”, “obtaining”, “researching”, “searching”, “storing”, “saving”, “referencing”, “providing”, “receiving”, “invoking”, “constructing”, “deconstructing”, “initiating”, “generating”, “translating”, “determining”, displaying”, “linking”, “performing”, or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
The present invention also relates to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, or it may comprise a general purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a machine readable storage medium, such as, but not limited to, any type of disk including floppy disks, optical disks, magnetic-optical disks, ROMs, compact disk ROMs (CD-ROMs), RAMs, erasable programmable ROMs (EPROMs), electrically EPROMs (EEPROMs), magnetic or optical cards, or any type of media suitable for storing electronic instructions, each coupled to a computer system bus.
The algorithms and displays presented herein are not inherently related to any particular computer or other apparatus. Various general purpose systems may be used with programs in accordance with the teachings herein, or it may prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will appear as set forth in the description below. In addition, the present invention is not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the invention as described herein.
The present invention may be provided as a computer program product, or software, that may include a machine-readable medium having stored thereon instructions, which may be used to program a computer system (or other electronic devices) to perform a process according to the present invention. A machine-readable medium includes any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer). For example, a machine-readable (e.g., computer-readable) medium includes a machine (e.g., a computer) readable storage medium (e.g., ROM, RAM, magnetic disk storage media, optical storage media, flash memory devices, etc.), a machine (e.g., computer) readable transmission medium (non-propagating electrical, optical, or acoustical signals), etc.
Whereas many alterations and modifications of the present invention will no doubt become apparent to a person of ordinary skill in the art after having read the foregoing description, it is to be understood that any particular embodiment shown and described by way of illustration is in no way intended to be considered limiting. Therefore, references to details of various embodiments are not intended to limit the scope of the claims, which in themselves recite only those features regarded as the invention.
Patent | Priority | Assignee | Title |
Patent | Priority | Assignee | Title |
7111053, | May 20 2000 | Ciena Corporation | Template-driven management of telecommunications network via utilization of operations support services clients |
7502999, | Apr 02 2004 | Oracle America, Inc | Automatically exposing command line interface commands as web services |
7581190, | Jul 19 2006 | Microsoft Technology Licensing, LLC | Constructing user interfaces on top of cmdlets |
7668836, | Sep 02 2005 | TWITTER, INC | IMS SOAP gateway deployment utility |
7694140, | Dec 30 2003 | SAP SE | Web service client extensions |
20040163090, | |||
20070055678, | |||
20080016143, | |||
20090271472, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Aug 26 2010 | PASTERNAK, MICHAEL | RED HAT ISRAEL LTD | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 024919 | /0367 | |
Aug 31 2010 | Red Hat Israel, Ltd. | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Oct 19 2018 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Oct 18 2022 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Date | Maintenance Schedule |
Apr 28 2018 | 4 years fee payment window open |
Oct 28 2018 | 6 months grace period start (w surcharge) |
Apr 28 2019 | patent expiry (for year 4) |
Apr 28 2021 | 2 years to revive unintentionally abandoned end. (for year 4) |
Apr 28 2022 | 8 years fee payment window open |
Oct 28 2022 | 6 months grace period start (w surcharge) |
Apr 28 2023 | patent expiry (for year 8) |
Apr 28 2025 | 2 years to revive unintentionally abandoned end. (for year 8) |
Apr 28 2026 | 12 years fee payment window open |
Oct 28 2026 | 6 months grace period start (w surcharge) |
Apr 28 2027 | patent expiry (for year 12) |
Apr 28 2029 | 2 years to revive unintentionally abandoned end. (for year 12) |