7.5 – PHP Development Definition

Slides:



Advertisements
Similar presentations
» PHP arrays are lists of values stored in key-value pairs. » Uses of arrays: Many built-in PHP environment variables. Database functions use arrays.
Advertisements

Intesar G Ali IT DepartmentPalestinian Land Authority Web services Prepared by: Intesar Ali IT Department PLA August 2010.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 11: Advanced Web Technologies.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
1 Web Wizards Guide To PHP David Lash Chapter 1 Introduction to PHP.
Guide To UNIX Using Linux Third Edition
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Introduction to PHP. PHP PHP is the Hypertext Pre-processor –Script language –Embedded into HTML –Runs as Apache module –Can use DB (MySQL, Oracle, Microsoft.
PHP: Hypertext Processor Fred Durao
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
Web Services Week 7 Aims: A detailed look at the underlying mechanisms for communication between web services Objectives: SOAP, WSDL, UDDI.
Class 1Intro to Databases Goals of this class Understand the architecture behind web database applications Gain a basic understanding of what relational.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
1 Chapter 4 – Breaking It Up: Functions spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Creating PHP Pages Chapter 5 PHP Structure and Syntax.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
JavaScript Introduction inf385t Semantic Web 2/20/2006.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
XML 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SAMPLE XML SCHEMA (XSD) 2 Schema is a record definition, analogous to the.
Introduction to PHP. PHP Origins Rasmus LerdorfRasmus Lerdorf (born Greenland, ed Canada) PHP originally abbreviation for ‘Personal Home Pages’, now ‘PHP.
Presented By Sushil K. Chaturvedi Assistant Professor SRCEM,Banmore 1.
PHP using MySQL Database for Web Development (part II)
Web Database Programming Using PHP
Topic 2: Hardware and Software
Module 1 Introduction to JavaScript
Introduction to Dynamic Web Programming
Section 6.3 Server-side Scripting
Chapter 5 Scripting Language
WWW and HTTP King Fahd University of Petroleum & Minerals
Tutorial 10 Programming with JavaScript
CSC 301 Web Programming Charles Frank.
Web Database Programming Using PHP
Chapter 2 Client/Server Applications
DBW - PHP DBW2017.
PHP (PHP: Hypertext Preprocessor)
Chapter 5 Scripting Language
Programming Concepts and Languages
PHP / MySQL Introduction
Server-Side Application and Data Management IT IS 3105 (Spring 2010)
Intro to PHP & Variables
Tutorial 8 Objectives Continue presenting methods to import data into Access, export data from Access, link applications with data stored in Access, and.
Database Driven Websites
Distributed Computing, M. L. Liu
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
Java Applets.
PHP.
Web DB Programming: PHP
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
IntroductionToPHP Static vs. Dynamic websites
Lecture 5: Functions and Parameters
Chapter 42 Web Services.
An Introduction to JavaScript
PHP: Hypertext Preprocessor
Client-Server Model: Requesting a Web Page
Hypertext Preprocessor
Web Application Development Using PHP
Presentation transcript:

7.5 – PHP Development Definition PHP (PHP: Hypertext Pre-processor) is a reflective programming language originally designed for producing dynamic Web pages. PHP is used mainly in server-side application software, but can be used from a command line interface or in standalone graphical applications. In a web page context, PHP runs on the web server, taking PHP code as its input and creating web pages as output. The actual code may be embedded into html pages and vice-versa (PHP pages may include html elements). SAFE X3 - Web Services 29 November 2018 SAFE X3 - Web Services

7.5 – PHP Development Connecting to the Web Service No class import or class generation is needed to connect to a web service in PHP. The PHP processor dynamically analyses the web service wsdl definition and creates needed structures. The SoapClient structure is used to connect to the web service wsdl: <?php // Get the SOAP structures from the Web Service $client = new SoapClient('http://localhost/adxwsvc/services/CAdxWebServiceXmlCC?wsdl'); SAFE X3 - Web Services 29 November 2018 SAFE X3 - Web Services

7.5 – PHP Development The Calling Context The next step in calling the web service is building the Calling Context structure. It is a string structure that must conform to the wsdl definition published for the web service: // Build Calling Context array for connecting to the Web Service $CContext["codeLang"] = "BRI"; $CContext["codeUser"] = "ADMIN"; $CContext["password"] = ""; $CContext["poolAlias"] = "WS_DEMOBRI"; $CContext["requestConfig"] = "adxwss.trace.on=on&adxwss.trace.size=16384 &adonix.trace.on=on&adonix.trace.level=3&adonix.trace.size=8"; SAFE X3 - Web Services 29 November 2018 SAFE X3 - Web Services

7.5 – PHP Development Calling the run method (Subprograms) Most of the code for running a subprogram will be dedicated to constructing the XML input: // XML string to be passed to the web service $xmlInput = <<<EOD <PARAM> <FLD NAME="ITSSTR" >$itsstr</FLD> <FLD NAME="ITSEND" >$itsend</FLD> <FLD NAME="NBITS" >10</FLD> </PARAM> EOD; // Run the subprogram using the SoapClient variable and Calling Context defined earlier $result = $client->run($CContext,"GETITMPRI",$xmlInput); SAFE X3 - Web Services 29 November 2018 SAFE X3 - Web Services

7.5 – PHP Development Calling the save method (Objects) As described in earlier sections, the save method takes the calling context, the public web service name and the XML input as arguments: // XML string to be passed to the web service $xmlInput = <<<EOD <PARAM> <GRP ID="SOH0_1" > <FLD NAME="BPCORD" >$custid</FLD> </GRP> <TAB ID="SOH4_1" > <LIN> <FLD NAME="ITMREF" >$product</FLD> <FLD NAME="QTY" >$qty</FLD> </TAB> </PARAM> EOD; // Run save method $result = $client->save($CContext,"SOH",$xmlInput); SAFE X3 - Web Services 29 November 2018 SAFE X3 - Web Services

7.5 – PHP Development The result XML stream The result XML stream returned by the web service contains the usual structures, as described in the wsdl definition: $result->resultXml: The result XML data (String) $result->status: Return status (String) $result->messages: X3 messages (Array of message structure) $result->messages[i]->message: X3 message (String) $result->messages[i]->type: X3 message type (String) … SAFE X3 - Web Services 29 November 2018 SAFE X3 - Web Services

7.5 – PHP Development Interpreting the results: An example // store the returned XML string $xml = simplexml_load_string($result->resultXml); // Get status $status = (int)$result->status; if ($status == 1) { // loop through the XML and extract the Sales Order Number foreach ($xml->GRP->FLD as $name) { switch((string) $name['NAME']) case 'SOHNUM': $order = $name; break; } } else { // Return array of messages $messages = $result->messages; // First message will be error message $message = $messages[0]->message; // Message type $type = $messages[0]->type; $parse_error = True; $err_text = "ERROR: ($type) $message \n"; $err_mesg .= "   1. $err_text<br />"; … SAFE X3 - Web Services 29 November 2018 SAFE X3 - Web Services