Automation of the Client Side of Web Services Using PHP
Total Page:16
File Type:pdf, Size:1020Kb
University of New Orleans ScholarWorks@UNO University of New Orleans Theses and Dissertations Dissertations and Theses 12-20-2009 Automation of the Client Side of Web Services Using PHP Menad Medjkane University of New Orleans Follow this and additional works at: https://scholarworks.uno.edu/td Recommended Citation Medjkane, Menad, "Automation of the Client Side of Web Services Using PHP" (2009). University of New Orleans Theses and Dissertations. 1096. https://scholarworks.uno.edu/td/1096 This Thesis is protected by copyright and/or related rights. It has been brought to you by ScholarWorks@UNO with permission from the rights-holder(s). You are free to use this Thesis in any way that is permitted by the copyright and related rights legislation that applies to your use. For other uses you need to obtain permission from the rights- holder(s) directly, unless additional rights are indicated by a Creative Commons license in the record and/or on the work itself. This Thesis has been accepted for inclusion in University of New Orleans Theses and Dissertations by an authorized administrator of ScholarWorks@UNO. For more information, please contact [email protected]. Automation of the Client Side of Web Services Using PHP A Thesis Submitted to the Graduate Faculty of the University of New Orleans In partial fulfillment of the Requirements for the degree of Master of Science in Computer Science by Menad Medjkane B.S. University of Sciences and Technologies of Oran (Algeria), 1995 December, 2009 Acknowledgment I would like to express my deep gratitude toward everyone who has helped me during my graduate study at the University of New Orleans. Especially, I am truly grateful for my advisor, Dr. Shengru Tu, for his constant guidance and continued support that go far above and beyond the call of duty. I thank Dr. Mahdi Abdelguerfi and Dr. Adlai DePano for their encouragement and help during the course of my degree curriculum. Finally, I wish to thank my parents for sacrificing so much for me to have a better life. Most importantly, I wish to thank my wife and my children for their patience, their understanding, and for always standing by me. ii Table of Contents List of Figures .................................................................................................................................v Abstract ...................................................................................................................................... vii Chapter 1 Introduction ................................................................................................................1 Chapter 2 Background and Related Work ................................................................................3 2.1 XML ......................................................................................................................................3 2.2 Web Service ..........................................................................................................................4 2.3 WSDL ....................................................................................................................................5 2.4 SOAP .....................................................................................................................................6 2.5 DOM .....................................................................................................................................7 2.6 XPATH .................................................................................................................................9 2.7 AJAX .....................................................................................................................................9 Chapter 3 Structure and System Design ..................................................................................10 3.1 Web Service .........................................................................................................................12 3.2 Front end ..............................................................................................................................17 3.3 WS-PHP Middleware component ........................................................................................18 3.3.1 WSDL elements .............................................................................................................19 3.3.2 Service operations ............................................................................................................21 3.3.3 Automating the process that enables PHP to call Web Services .....................................23 3.3.3.1 Existing PHP-WS interactions approaches ....................................................................23 3.3.3 .2 The procedures for PHP to call Web Services operations ...........................................25 3.3.4 The structure of the WS-PHP middleware ........................................................................26 Chapter 4 Implementation ........................................................................................................31 4.1 Client Implementation ..........................................................................................................32 4.2 Class WSDL _Element ........................................................................................................37 4.3 Implementation of WS-PHP Middleware component .........................................................47 4.3.1 Call Without Parameters ...................................................................................................47 4.3.2 Call With Parameters ........................................................................................................50 4.4 Web Service Operation Selector ..........................................................................................58 Chapter 5 Experiments ..............................................................................................................63 5.1 The Car sales application .....................................................................................................65 5.2 The House sales application .................................................................................................71 iii Chapter 6 Conclusion ................................................................................................................74 References ....................................................................................................................................75 Vita ...............................................................................................................................................76 iv List of Figures Figure 2.1: XML ........................................................................................................................................... 3 Figure 2.2: Web Service ............................................................................................................................... 4 Figure 2.3:WSDL Structure .......................................................................................................................... 6 Figure 2.4:System Architecture .................................................................................................................... 7 Figure 2.5: book Store Dom Tree ................................................................................................................. 8 Figure 3.1: System View ............................................................................................................................. 11 Figure 3.2: Class Store Diagram ............................................................................................................... 12 Figure 3.3: Specification of operations in WSDL ....................................................................................... 13 Figure 3.4: Class Car Diagram .................................................................................................................. 15 Figure 3.5: Class CarArg Diagram ............................................................................................................ 16 Figure 3.6: Ajax Call ................................................................................................................................... 18 Figure 3.7: Operation element in WSDL .................................................................................................... 19 Figure 3.8: message element of WSDL ...................................................................................................... 19 Figure 3.9: message response element of WSDL ....................................................................................... 19 Figure 3.10: element of type WSDL ....................................................................................................... 20 Figure 3.11: operation that has all WSDL elements ................................................................................... 21 Figure 3.12: operation with no parameter ................................................................................................... 22 Figure 3.13: operation without return value ................................................................................................ 23 Figure 3.14: System Details ........................................................................................................................ 27 Figure 3.15:Sequence Diagram HandleParameters....................................................................................