Web design portfolio - CHAPTER 20 WEB SERVICES Prerequisites PHP s SOAP
CHAPTER 20 WEB SERVICES Prerequisites PHP s SOAP extension requires the GNOME XML library. You can download the latest stable libxml2 package from http://www.xmlsoft.org/. Binaries are also available for the Windows platform. Version 2.5.4 or greater is required. You ll also need to configure PHP with the –enable-soap extension. Creating a SOAP Client Creating a SOAP client with the new native SOAP extension is easier than you think. Although several client-specific methods are provided with the SOAP extension, only SoapClient() is required to create a complete WSDL-enabled client object. Once created, it s just a matter of calling the SOAP server s exposed functions. The SoapClient() method and several others are introduced next, guiding you through the process of creating a functional SOAP client as the section progresses. In the later section, SOAP Client and Server Interaction, you ll find a complete working example of interaction between a client and server created using this extension. SoapClient() object SoapClient->SoapClient (mixed wsdl [, array options]) The SoapClient() constructor instantiates a new instance of the SoapClient class. The wsdl parameter determines whether the class will be invoked in WSDL or non-WSDL mode. If the former, then the parameter will point to the WSDL file; otherwise, it will be set to null. The discretionary options parameter is an array that accepts the following parameters: actor: This parameter specifies the name, in URI format, of the role that a SOAP node must play in order to process the header. compression: This parameter specifies whether data compression is enabled. Presently, gzip and x-gzip are supported. According to the TODO document, support is planned for HTTP compression. exceptions: Enabling this parameter turns on the exception-handling mechanism. It is enabled by default. login: If HTTP authentication is used to access the SOAP server, this parameter specifies the username. password: If HTTP authentication is used to access the SOAP server, this parameter specifies the password. proxy_host: This parameter specifies the name of the proxy host when connecting through a proxy server. proxy_login: This parameter specifies the proxy server username if one is required. proxy_password: This parameter specifies the proxy server password if one is required. proxy_port: This parameter specifies the proxy server port when connecting through a proxy server.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.