|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TOP LINKS YOU MUST CLICK ON Features PHP 5: Open Source Scripting for the Heterogeneous Enterprise
Existing Java and J2EE application development tools are complex and sophisticated
By: Rick Fleischman
Sep. 3, 2005 01:00 PM
Here is a short example. Consider the following short XML file (people.xml):
<people> This is the PHP code that accesses and prints the contents of the file (print_people.php):
<?php The resulting output of this code is:
Joe is male The PHP code simply exposes the contents of the XML file as if they were elements in a standard PHP array. By iterating through the array with a simple loop, the content of the XML file is read and the output is created without any need to further parse the XML file. There has never been an easier way to access and manipulate XML data. If there is some special XML manipulation that needs to be done in DOM, most of the basic work can be done in SimpleXML, and then the result converted to DOM and additional manipulations run without having to write and reread the XML data to some kind of temporary or permanent storage.
Web Services Support PHP 5 features new native support for SOAP and WSDL making it incredibly easy to create and consume Web services within the enterprise or on the Internet. For example, all that is required to access a Web service is to point to a relevant WSDL file describing that service and then simply invoke a function exposed in that Web service interface. Only two lines of code are required! Here is a specific example of the PHP code required to access a Web service exposed on the Internet to print the current stock quote for Microsoft:
<?php All that was required was to create an object by passing in the relevant WSDL, and then access a function in the Web service by invoking a method within the object. It's similarly easy to publish Web services. The services are implemented as PHP-based classes, and then described in a WSDL file. PHP 5 has built-in capabilities to publish that service, provide the WSDL on request, and execute the functionality and return a result (if needed) when invoked.
Rapid Prototyping and Assembly Using Web Services
PHP Integration with Existing Code and Data
C/C++ and COM/.NET Microsoft COM (Component Object Model) defines a common calling convention that enables code written in any language to call and interoperate with code written in any other language. Microsoft .NET is an overall strategy for providing individuals and businesses with a seamlessly interoperable and Web-enabled interface for applications and computing devices based on XML and Web services. It supports over 20 programming languages and allows for interoperability between these languages. Microsoft intends to offer a range of Web-based services and application building blocks via .NET. COM and .NET access are built in to PHP 5 and are available to any PHP code running on the Microsoft Windows platform. The COM class in PHP allows you to instantiate a COM object, call its methods, and access its properties. The DOTNET class allows you to instantiate a class from a .NET assembly, call its methods, and access its properties. PHP does this via the COM interoperability layer for .NET. In implementation terms, PHP sees .NET objects as though they were COM objects.
Java YOUR FEEDBACK
LATEST LINUX STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||