From fa8af03a0f1d1afd1528bfcd67471bfe30d20c3c Mon Sep 17 00:00:00 2001 From: Google Code Exporter Date: Mon, 15 Feb 2016 14:00:11 -0500 Subject: [PATCH] Migrating wiki contents from Google Code --- AJAX_proxy_usage.md | 34 ++++ ComplexType.md | 39 ++++ JavaScript.md | 14 ++ PhpWsdl.md | 11 + ProjectHome.md | 105 ++++++++++ Servers_extension_usage.md | 217 ++++++++++++++++++++ SoapClient.md | 18 ++ SoapServer.md | 15 ++ Usage.md | 405 +++++++++++++++++++++++++++++++++++++ 9 files changed, 858 insertions(+) create mode 100644 AJAX_proxy_usage.md create mode 100644 ComplexType.md create mode 100644 JavaScript.md create mode 100644 PhpWsdl.md create mode 100644 ProjectHome.md create mode 100644 Servers_extension_usage.md create mode 100644 SoapClient.md create mode 100644 SoapServer.md create mode 100644 Usage.md diff --git a/AJAX_proxy_usage.md b/AJAX_proxy_usage.md new file mode 100644 index 0000000..cffbff6 --- /dev/null +++ b/AJAX_proxy_usage.md @@ -0,0 +1,34 @@ +# Introduction # + +Whenever you want to make SOAP requests from an AJAX SOAP client, you'll note +that AJAX requests are restricted to the server that serves the SOAP client. +To make an AJAX request to a foreign server, you need a proxy. + +# Details # + +PhpWsdlAjax provides two methods to act as proxy. + +## A simple forwarder ## + +This will simply forward all requests to another URI: + +``` +require_once('class.phpwsdlajax.php'); +PhpWsdlAjax::RunForwarder('http://target-server.com/'); +``` + +The parameter is the URI to the target SOAP endpoint. + +## A real SOAP proxy ## + +PhpWsdlAjax can also act as a real SOAP webservice proxy: + +``` +require_once('class.phpwsdlajax.php'); +PhpWsdlAjax::RunProxy('http://target-server.com/?WSDL'); +``` + +The parameter is the URI to the target WSDL. + +**Note**: The proxy can only handle webservices that have WSDL like the PhpWsdl +framework can produce it. \ No newline at end of file diff --git a/ComplexType.md b/ComplexType.md new file mode 100644 index 0000000..2179298 --- /dev/null +++ b/ComplexType.md @@ -0,0 +1,39 @@ +# Introduction # + +A WSDL complex type. + +# Details # + +Currently PhpWsdl supports complex types with sequenced elements of mixed types. PhpWsdl also supports simple arrays. + +To create a complex type: + +``` +/** + * The description + * + * @pw_element string $name An element with type "string" + * @pw_element string $email Another element with type "string" + * @pw_complex SampleComplex End the definition+ + */ +``` + +To create an array simply add "Array" to the type name: + +``` +/** + * The description + * + * @pw_complex stringArray An array of string + */ +/** + * The description + * + * @pw_complex arrayOfInt[] int An array of int + */ +/** + * The description + * + * @pw_complex SampleComplexArray An array of SampleComplex + */ +``` \ No newline at end of file diff --git a/JavaScript.md b/JavaScript.md new file mode 100644 index 0000000..7159f7c --- /dev/null +++ b/JavaScript.md @@ -0,0 +1,14 @@ +# Introduction # + +I prefer using http://code.google.com/p/soa2ui/ as JavaScript SOAP client. But requesting foreign SOAP webservices won't work with JavaScript because of security restrictions of the browser. PhpWsdl has a solution for you. + +# Details # + +Example PHP code: + +``` +require_once('class.phpwsdlajax.php'); +PhpWsdlAjax::RunForwarder('http://www.webservicex.net/geoipservice.asmx'); +``` + +These two lines of code will serve the foreign webservice for your AJAX SOAP clients. The proxy will simply forward any SOAP request to another SOAP webservice. \ No newline at end of file diff --git a/PhpWsdl.md b/PhpWsdl.md new file mode 100644 index 0000000..4983211 --- /dev/null +++ b/PhpWsdl.md @@ -0,0 +1,11 @@ +# Introduction # + +A simple, thin and fast WSDL generator for PHP. + +# Details # + +Create a SOAP server from an existing PHP class with only a single line of code: + +``` +PhpWsdl::RunQuickMode(); +``` \ No newline at end of file diff --git a/ProjectHome.md b/ProjectHome.md new file mode 100644 index 0000000..2d5902f --- /dev/null +++ b/ProjectHome.md @@ -0,0 +1,105 @@ + + +# PhpWsdl # + +I started to develop my own WSDL generator for PHP because the ones I saw +had too many disadvantages for my purposes. The main problem - and the main +reason to make my own WSDL generator - was receiving NULL in parameters +that leads the PHP SoapServer to throw around with "Missing parameter" +exceptions. F.e. a C# client won't send the parameter, if its value is +NULL. But the PHP SoapServer needs the parameter tag with 'xsi:nil="true"' to +call a method with the correct number of parameters. I found a solution for +this problem and developed a complex type supporting WSDL generator that can +also run the PHP SoapServer with only a single line of code. I hope my +solution is helpful for you, too. + +## Example usage ## + +**The fastest usage (ever? ;):** + +``` +require_once ( 'class.phpwsdl.php' ); +PhpWsdl::RunQuickMode ( ); +``` + +This will run the PHP SoapServer and determine all the configuration, if your webservice handler class is within the same file or in a file named 'class.webservice.php'. + +**If the webservice handler _class is in another file_:** + +``` +require_once ( 'class.phpwsdl.php' ); +PhpWsdl::RunQuickMode ( 'class.yourwebservice.php' ); +``` + +**If your webservice _needs more files_:** + +``` +require_once ( 'class.phpwsdl.php' ); +PhpWsdl::RunQuickMode ( Array ( 'class.yourwebservice.php', 'class.yourcomplextype.php' ) ); +``` + +Quick, isn't it? + +But PhpWsdl can do a lot more for you. See the demos in the downloads for some examples. + +## Features ## + + * parsing of WSDL definitions from comment blocks + * creating WSDL even without definitions in comments + * caching of the generated WSDL for more performance + * support for complex types and arrays + * create optimized or human readable WSDL + * create WSDL with inline documentation + * output HTML documentation + * downloadable PDF documentation for your webservice including attached WSDL files and PHP SOAP client proxy code + * create PHP client proxy code + * create JavaScript client proxy code + * highly and easy extendable with hooks + * support for adding more complex or simple type support with plugins + * works with PHP SoapServer or any other SOAP server (NuSOAP or Zend f.e.) + * easy to handle SOAP client included (works with PHPs native SoapClient) + * fully documented source code + * http Auth protection for your SOAP webservice + * mixing global and class methods within one webservice + * NuSOAP adapter + * AJAX proxy to foreign SOAP webservices for JavaScript SOAP clients + * run SOAP, XML RPC, JSON, http and REST webservices with the same code base + +## Online demonstration ## + +### Webservice HTML documentation output ### + +At this location you see a demonstration of the HTML output from PhpWsdl. The documentation may be downloaded as PDF file with the WSDL files as inline attachments. This will help you to provide your webservice details well documented. + +http://wan24.de/test/phpwsdl2/demo.php + +### Webservice WSDL output ### + +In this online demonstration the documentation is within the WSDL XML. If you show the source, the XML is formatted. But PhpWsdl can also produce WSDL without inline documentation and optimized for a better performance. + +http://wan24.de/test/phpwsdl2/demo.php?WSDL + +### Endpoint for testing ### + +Use this location for your preferred SOAP client to test the compatibility of the WSDL produced by PhpWsdl: + +http://wan24.de/test/phpwsdl2/demo.php + +This demo location supports also the XML RPC, JSON, http and REST protocol. + +### Sample auto-generated client proxy classes for PHP and JavaScript ### + +**SOAP**: +http://wan24.de/test/phpwsdl2/demo.php?PHPSOAPCLIENT + +**XML RPC**: +http://wan24.de/test/phpwsdl2/demo.php?PHPRPCCLIENT + +**JSON**: +http://wan24.de/test/phpwsdl2/demo.php?PHPJSONCLIENT (PHP) or http://wan24.de/test/phpwsdl2/demo.php?JSJSONCLIENT (JavaScript) + +**http**: +http://wan24.de/test/phpwsdl2/demo.php?PHPHTTPCLIENT + +**REST**: +http://wan24.de/test/phpwsdl2/demo.php?PHPRESTCLIENT \ No newline at end of file diff --git a/Servers_extension_usage.md b/Servers_extension_usage.md new file mode 100644 index 0000000..1139959 --- /dev/null +++ b/Servers_extension_usage.md @@ -0,0 +1,217 @@ +# Introduction # + +PhpWsdlServers enabled you to run a JSON, http, XML RPC and REST webservice +with one codebase. + +# Details # + +If you are already running a SOAP webservice with PhpWsdl, you can extend +it by simply installing the PhpWsdlServers extension. The download package +contains some working examples. + +## JSON webservice ## + +To serve a running PhpWsdl SOAP webservice as JSON webservice, you don't need +to modify your code. It will run out of the box. + +To get a PHP JSON client proxy for your webservice, call this URI: + +``` +http://your-server.com/webservice.php?PHPJSONCLIENT +``` + +To get a JavaScript JSON client proxy for your webservice, call this URI: + +``` +http://your-server.com/webservice.php?JSJSONCLIENT +``` + +To get a compressed JavaScript JSON client proxy for your webservice, call this +URI: + +``` +http://your-server.com/webservice.php?JSJSONCLIENT&min +``` + +The webservice request is done by giving a JSON array/object as parameter +"json" or "JSON" with POST or GET: + +``` +{ + "call":"MethodName", + "param":[ + "Parameter1", + 123, + true + ] +} +``` + +This example needs the webservice to export the method "MethodName" that can +be called with three parameters: A string, an integer and a boolean value. +That's all :) + +It's possible to attach the JavaScript clients to the PDF documentation, too. +But you should know that users won't be able to save them with Adobe Acrobat +Reader since the security permissions won't allow that. If you want to force +the JavaScript client attachments in PDF: + +``` +PhpWsdlServers::$AttachJsInPdf=true; +``` + +**Note**: To enable PDF attachments in the PDF documentation download you need +to set up a valid HTML2PDF license key in PhpWsdl. + +To fully disable serving JSON: + +``` +PhpWsdlServers::$EnableJson=false; +``` + +## http webservice ## + +To serve a running PhpWsdl SOAP webservice as http webservice, you don't need +to modify your code. It will run out of the box. + +To get a PHP http client proxy for your webservice, call this URI: + +``` +http://your-server.com/webservice.php?PHPHTTPCLIENT +``` + +A client needs to submit the name of the exported method in the parameter +"call". Every parameter that is required by this method needs to be submitted +with the parameter name. Requests can be done with the GET or POST http method. + +For example, if your webservice exports the method "MethodName" that requires +three parameters ($string is a string, $int is an integer, $bool is an boolean +value) a GET request URI would look like this: + +``` +http://your-server.com/webservice.php?call=MethodName&string=Parameter1&int=123&boolean=1 +``` + +If a parameters type is not listed in the PhpWsdl::$BasicTypes array, it needs +JSON encoding. The same for the response: If the return values type is not a +basic type, it will be returned JSON encoded! A parameter can't be NULL. The +response may be NULL if it requires JSON encoding. + +To fully disable serving http: + +``` +PhpWsdlServers::$EnableHttp=false; +``` + +## REST webservice ## + +To serve a running PhpWsdl SOAP webservice as REST webservice, you don't need +to modify your code. It will run out of the box. + +To get a PHP REST client proxy for your webservice, call this URI: + +``` +http://your-server.com/webservice.php?PHPRESTCLIENT +``` + +But since REST offers some more features, you can extend your webservices with +special REST configuration by using the @pw\_rest keyword in a comment block +for an exported method: + +``` +/** + * Summarize two numbers + * + * @param int $a A number + * @param int $b Another number + * @return int The result of $a+$b + * @pw_rest GET /sum/:a/:b Summarize two numbers + */ +public function Add($a,$b=0){ + return $a+$b; +} +``` + +As you can see you have to use ":" as identifier for a named parameter. The +parameter order may be different from the function declaration. + +Of course the method will be exported for SOAP, JSON and http clients, too. +But with the REST protocol you can now access the method like this: + +``` +http://your-server.com/webservice.php/sum/1/2 +http://your-server.com/webservice.php/sum/1 +http://your-server.com/webservice.php/Add/1/2 +http://your-server.com/webservice.php/Add/1 +``` + +This will result in the following output: + +``` +3 +1 +3 +1 +``` + +As you can see, the method will be exported with a default REST path that has +this syntax: + +``` +/[method]/[parameter1]/[parameter2]/... +``` + +[method](method.md) is the case sensitive method name. All parameters are added in the +order of the declaration in the comment block. + +A client has to provide every parameter that is required to call the method. +In this example the method "Add" may be called with one or two parameters in a +PHP script - the same for calling with REST. + +If a method has more that one parameter, the last parameter may be submitted +in the POST http request body. + +By the way: REST works with global methods (=not in a class), too. + +To fully disable serving REST: + +``` +PhpWsdlServers::$EnableRest=false; +``` + +## XML RPC webservice ## + +To serve a running PhpWsdl SOAP webservice as XML RPC webservice, you don't +need to modify your code. It will run out of the box. + +To get a PHP XML RPC client proxy for your webservice, call this URI: + +``` +http://your-server.com/webservice.php?PHPRPCCLIENT +``` + +Per default the XML RPC webservice will consume the given parameters as +simple array. To enable the support for named parameters: + +``` +PhpWsdlServers::$EnableRpcNamedParameters=true; +``` + +If named parameters are enabled you have to use named parameters. There is no +way to support both calling methods. + +To fully disable serving XML RPC: + +``` +PhpWsdlServers::$EnableRpc=false; +``` + +## Enable client cache ## + +Per default the client cache will be disabled by sending some http headers. +But if you want your clients to be enabled caching your webservices response, +you can do that with: + +``` +PhpWsdlServers::$DisableClientCache=false; +``` \ No newline at end of file diff --git a/SoapClient.md b/SoapClient.md new file mode 100644 index 0000000..4775a89 --- /dev/null +++ b/SoapClient.md @@ -0,0 +1,18 @@ +# Introduction # + +The WSDL produced by PhpWsdl is independent from the used SOAP client. And PhpWsdl brings its own SOAP client solution. + +# Details # + +PhpWsdl wraps the native PHP SoapClient object. Example usage: + +``` +require_once('class.phpwsdlclient.php'); +$client=new PhpWsdlClient('http://wan24.de/test/phpwsdl2/demo4.php?WSDL'); +echo $client->SayHello('you'); +``` + +But the client can do quiet more for you: + + * cache the target SOAP webservices WSDL + * create a PHP SOAP client proxy class from a foreign webservice \ No newline at end of file diff --git a/SoapServer.md b/SoapServer.md new file mode 100644 index 0000000..c44aeeb --- /dev/null +++ b/SoapServer.md @@ -0,0 +1,15 @@ +# Introduction # + +A PHP SoapServer object. + +# Details # + +See the [PHP online documentation](http://www.php.net/manual/en/book.soap.php): PhpWsdl uses the PHP SoapServer per default. + +But you may use any other SOAP server with PhpWsdl, too - NuSOAP or Zend for example. + +The NuSOAP adapter is ready and tested, but C# clients won't work with NuSOAP as SOAP server. + +The Zend adapter is still in progress. + +I recommend using the native PHP SoapServer. It's running ok, is fast and doesn't need too much ressources. \ No newline at end of file diff --git a/Usage.md b/Usage.md new file mode 100644 index 0000000..a0f49ab --- /dev/null +++ b/Usage.md @@ -0,0 +1,405 @@ +# Introduction # + +PhpWsdl can produce WSDL of course. But did you know that PhpWsdl can also run +a SOAP server for you? + +# Details # + +PhpWsdl was designed to produce WSDL from PHP. The WSDL definitions can be +defined in comment blocks or from PHP code. The final WSDL can be used with +the native PHP SoapServer. + +## Why NuSOAP or Zend? ## + +Adapters for NuSOAP or Zend can run the NuSOAP or Zend SOAP server. But f.e. +the NuSOAP SOAP server can't handle the WSDL produced by PhpWsdl. If you use +this adapter, PhpWsdl will only produce the HTML documentation and make type +and method registrations to the soap\_server object for you. The WSDL needs +then to be created by the NuSOAP framework. + +So why would you use the NuSOAP adapter f.e.? I found creating a SOAP +webservice using the NuSOAP framework was too complex for my purposes. I +didn't want to write too much code that would only work with NuSOAP - I want +to keep my applications mostly independent. But I already run SOAP webservices +using NuSOAP. To change to PHPs native SOAP support I'd have to change a lot +of old code and to write a lot of new code. But PhpWsdl makes it easy to +support both: NuSOAP and PHP SoapServer. Since I always use comment blocks to +comment my code, PhpWsdl was able to serve my webservices from scratch. Now I +have two webservices: One with PhpWsdl and the NuSOAP adapter and another +endpoint with PhpWsdl and native PHP SoapServer. Any changes to my webservices +are now served with both WSDL definitions (from NuSOAP and from PhpWsdl), so +my existing customers don't need to rewrite their client applications. + +The same is for the webservices I've created using the Zend SOAP server. + +Of course I recommend changing to the new endpoint for existing customers and +consuming only the new endpoint, because at the right time I want to get rid +of Zend and NuSOAP. + +## Basic usage ## + +If you develop your PHP application with Eclipse f.e. it's very easy to +produce comment blocks since Eclipse will create them for you if you just type +"/" and hit enter. PhpWsdl defined a rule: One WSDL type or method +definition per comment block. AND: All methods must be within one webservice +handler class! OR: You mix class methods and global methods. + +There is an option to use global methods (not using a handler class). You may +also mix class and global methods (what is not possible in PHP SoapServer per +default!). + +### WSDL definitions in comment blocks ### + +#### Service #### + +PhpWsdl is able to determine the webservice name when using a handler class. +But if you have no handler class, there are two ways to tell PhpWsdl the +webservice name: + +1. Using the PhpWsdl->Name property +You can give a name in the constructor or you set the property in your code. +If you're using a handler class, PhpWsdl can determine the name. + +2. Using a comment block and the @service keyword +Since version 2.2 you can set the webservice name with the @service keyword +within a comment block: + +``` +/** + * Documentation, may be multiline + * + * @service ServiceName + */ +``` + +Then "ServiceName" would be the name of your service. + +If you only have global methods in your webservice, you don't need to define a +webservice name. PhpWsdl will then use "SoapWebService" per default. + +**Note**: If you use a handler class, the name of the service has to match the +name of this class! + +#### Methods #### + +This is an example for a comment block of a method: + +``` +/** + * Say hello demo + * + * @param string $name Some name (or an empty string) + * @return string Response string + */ +public function SayHello($name){ + $name=utf8_decode($name);// Because a string parameter is UTF-8 encoded... + if($name=='') + $name='unknown'; + return utf8_encode('Hello '.$name.'!');// Because the return value is expected to be UTF-8 encoded +} +``` + +If the method has no parameters, the @param isn't required. The same for the +return value. This will only work for public methods. + +The basic syntax for a comment block is: + +``` +/** + * Documentation, may be multiline + * + * @param [type] [parameter] Some single line documentation + * @return [type] Some single line documentation + */ +``` + +[type](type.md) may be any type that is predefined by the W3C (and included in the list +of basic types in PhpWsdl::$BasicTypes) or defined as complex type within your +application. [parameter](parameter.md) is always the parameter name of the method. + +To hide a public method from WSDL, simply use the keyword @ignore to jump over +the next method: + +``` +/** + * @ignore Next method should be hidden even if it's public! + */ +``` + +##### Global methods ##### + +Because the PhpWsdlParser don't know if a method is within or outside of a +class, you have to tell the parser how to handle a method. This can be done +with a setting: + +``` +/** + * Say hello demo + * + * @param string $name Some name (or an empty string) + * @return string Response string + * @pw_set global=1 <- Declare this method as global (=not within a class) + */ +function SayHello($name){ + $name=utf8_decode($name);// Because a string parameter is UTF-8 encoded... + if($name=='') + $name='unknown'; + return utf8_encode('Hello '.$name.'!');// Because the return value is expected to be UTF-8 encoded +} +``` + +By default methods are declared as class methods. If you want PhpWsdl to add +all methods as global methods per default, change the +PhpWsdlMethod::$IsGlobalDefault property to TRUE, before PhpWsdl runs: + +``` +PhpWsdlMethod::$IsGlobalDefault=true; +``` + +Then you don't need "@pw\_set global=1" for your global methods anymore. But if +you want to mix class and global methods, you need to declare class methods as +non-globals: + +``` +class SoapDemo{ + /** + * Say hello demo + * + * @param string $name Some name (or an empty string) + * @return string Response string + * @pw_set global=0 <- Declare this method as non-global (=within a class) + */ + function SayHello($name){ + $name=utf8_decode($name);// Because a string parameter is UTF-8 encoded... + if($name=='') + $name='unknown'; + return utf8_encode('Hello '.$name.'!');// Because the return value is expected to be UTF-8 encoded + } +} +``` + +#### Complex types #### + +To support complex type definitions from comment blocks, PhpWsdl defined new +keywords: + + * @pw\_element defines an element of a complex type + * @pw\_complex creates the complex type + +The comment block syntax is for example: + +``` +/** + * This is how to define a complex type f.e. - the class ComplexTypeDemo doesn't need to exists, + * but it would make it easier for you to return that complex type from a method + * + * @pw_element string $StringA A string with a value + * @pw_element string $StringB A string with a NULL value + * @pw_set nillable=false Not NULL + * @pw_element int $Integer An integer + * @pw_set nillable=false Not NULL + * @pw_element boolean $Boolean A boolean + * @pw_complex ComplexTypeDemo The complex type name definition + */ +class ComplexTypeDemo{ + public $StringA='String A'; + public $StringB=null; + public $Integer=123; + public $Boolean=true; +} +``` + +This will define a complex type that matches the ComplexTypeDemo so your +method can return a ComplexTypeDemo object. + +The basic syntax is: + +``` +/** + * Documentation, may be multiline + * + * @pw_element [type] [name] Some single line documentation + * @pw_complex [name] Some single line documentation + */ +``` + +#### Arrays #### + +Arrays can be defined from any type. Example: + +``` +/** + * @pw_complex stringArray A string array type + */ +/** + * @pw_complex ComplexTypeDemoArray An array of ComplexTypeDemo + */ +``` + +The basic syntax is: + +``` +/** + * Documentation, may be multiline + * + * @pw_complex [type]Array Some single line documentation + */ +``` + +The only thing you have to do is to append the postfix "Array" to the original +type name. + +Another way to define an array without a name restriction is to add [.md](.md) to its +name. The [.md](.md) is only required for parsing: + +``` +/** + * @pw_complex arrayOfInt[] int An int array type + */ +``` + +You can find and use this example array type with the name "arrayOfInt". + +The basic syntax is: + +``` +/** + * Documentation, may be multiline + * + * @pw_complex [name][] [type] Some single line documentation + */ +``` + +### Create an instance of PhpWsdl ### + +Full example: + +``` +require_once('class.phpwsdl.php'); +$soap=PhpWsdl::CreateInstance( + null, // Set this to your namespace or let PhpWsdl find one + null, // Set this to your SOAP endpoint or let PhpWsdl determine it + null, // Set this to a writeable folder to enable caching + null, // Set this to the filename or an array of filenames of your + // webservice handler class(es) (be sure to add the file that + // contains the handler class as first class definition at + // first) + null, // Set this to the webservice handler class name or let + // PhpWsdl determine it + null, // If you want to define some methods from code, give an array + // of PhpWsdlMethod here + null, // If you want to define some types from code, give an array of + // PhpWsdlComplex here + false, // Set this to TRUE to output WSDL on request and exit after + // WSDL has been sent + false // Set this to TRUE to run the SOAP server and exit +); +``` + +In this example all constructor parameters have their default values, so you +could also use this code that has the same effect: + +``` +require_once('class.phpwsdl.php'); +$soap=PhpWsdl::CreateInstance(); +``` + +### Create WSDL ### + +``` +$wsdl=$soap->CreateWsdl(); +``` + +### Create HTML ### + +``` +$html=$soap->OutputHtml(false,false); +``` + +### Create PHP ### + +``` +$php=$soap->OutputPhp(false,false); +``` + +### Run the SOAP server ### + +``` +$soap->RunServer(); +``` + +### The quick mode ### + +The quick mode will handle all this with a single line of code: + + * create HTML documentation + * create a PHP SOAP client proxy + * output WSDL on request + * run a SOAP server + +To enable the quick mode: + +``` +require_once('class.phpwsdl.php'); +PhpWsdl::RunQuickMode(); +``` + +This requires the WSDL definitions and the webservice handler class to be in +the same file. Or in the file "class.webservice.php" in the same folder. + +To define the webservice handler class file: + +``` +require_once('class.phpwsdl.php'); +PhpWsdl::RunQuickMode('class.handlerclass.php'); +``` + +Or to define multiple files: + +``` +require_once('class.phpwsdl.php'); +PhpWsdl::RunQuickMode(Array('class.soapdemo.php','class.complextypedemo.php')); +``` + +### Autorun ### + +The quick mode can be combined with autorun, so PhpWsdl will run and exit +after the class has been loaded: + +``` +$PhpWsdlAutoRun=true; +require_once('class.phpwsdl.php'); +``` + +The autorun can be done by setting the global variable $PhpWsdlAutoRun to TRUE +or by editing the source of class.phpwsdl.php and setting the static property +PhpWsdl::$AutoRun to TRUE. + +The autorun will use the quick mode. Any code after the "require\_once" won't +be executed. + +## Advanced usage and full examples ## + +PhpWsdl has many static properties and many properties that are only available +in an instance. The same for methods. The source of PhpWsdl is fully +documented, so you may get the usage documentation from IntelliSense of your +PHP development IDE or from the source code. + +Some advanced usage examples are also included in the `demo*.php` files that +are provided within the PhpWsdl downloads. The downloads also includes +demonstrations for the basic usages. + +## Plugins and extensions ## + +PhpWsdl supports developing plugins and extensions. This is not documented +yet, but if you need to make a plugin or extension, please use the hooking. +Contact me if you need an additional hook for your plugin. Of course I'm +interested in what you do with plugins and extensions - maybe you want to +distribute them here within this project on Google Code, too? + +There are already some plugins and extensions available for download in this +Google Code project in the Downloads section. If there is a new version of +PhpWsdl, I try to make all changes compatible to the existing versions of the +plugins and extensions. Sometimes this isn't possible. Then I will also +provide a new version of a plugin or extension for the new version of PhpWsdl +that matches the current PhpWsdl version number in the download filename. \ No newline at end of file