Working with WSDL Support

Prerequisites

How do I install plugins in Zend Studio?

Incorporating a WSDL File

Incorporating a WSDL file is the process of taking a service or services from an existing WSDL file and integrating their capabilities (functions) into your PHP code.

To reference a WSDL file and benefit from full integration into Zend Studio (code completion and function display in the PHP Project Outline tab) the file must be present in your local file system (Method 1), or can be referenced by using the WSDL file's URL (Method 2).

Creating a SOAP Client

 

 

Instructions on how to complete a procedure

To create a SOAP Client:

Method 1

  1. Use an external browser to open the URL.

  2. Save the contents of the URL as a WSDL file. e.g "C:\GoogleSearch.wsdl".

  3.   Create the soap client by referencing the WDSL file in your PHP script.
    e.g:

$a = new SoapClient("C:\GoogleSearch.wsdl")

The WSDL file's methods, classes, functions, etc. will now be available in the Code Assist Menu and the SOAP Client now appears in the PHP Project Outline tab.

Instructions on how to complete a procedure

To create a SOAP Client:

Method 2

  1. Create a new SoapClient instance in your PHP code, containing the URL of the WSDL file which you want to incorporate.
    e.g.:

$a = new SoapClient("http://dic.googlecode.com/files/GoogleSearch.wsdl")

  1. Save the file.

The WSDL file's methods, classes, functions, etc. will now be available in the Code Assist Menu and the SOAP Client now appears in the PHP Project Outline tab.

After Referencing a WSDL File

Once a WSDL file has been referenced in your project, the following will be affected:

Outline and PHP Project Outline views

The PHP Project Outline will now include all the functions from the referenced WSDL file.

PHP Project Outline view - with the GoogleSearch classes

Content Assist

Code completion is automatically updated with all the functions included in the referenced WSDL file.

Note:

Code completion for Web Services is supported for PHP 5.

Auto Link to WSDL files

Transform the name of the referenced WSDL file into a link by hovering over the file's name and pressing CTRL. Clicking the link (while CTRL is still pressed) will jump to the WSDL file if it is already open in the editor. Auto Link to Files exists for every string containing a file name in the editor.

 

Creating a WSDL File

Instead of referencing to an existing WSDL file, you can create a new WSDL file to reference to.

Instructions on how to complete a procedure

To create a WSDL file:

  1. Go to File | New | Other.
    The New Wizard's Select a wizard dialog is displayed.

  1. Enter WSDL in the Wizards field, select WSDL File and click Next.
    The New WSDL File dialog is displayed.

  1. Enter or select the parent folder for the new WSDL file you wish to create and the file name.

  2. Click on Advanced to open the Advanced area and link the file to an existing file..

  1. In the Advanced area, mark the checkbox and click Browse to find the existing file, or Variables to define path variables.

Note:

Click on the Choose file system dropdown menu to select a different file system.

  1. Click Next.
    The Options dialog is displayed.

  1. Specify the attributes for the new WSDL file, and click Finish.
    The new WSDL file is created and is displayed in the Editor view.

 

You can now start describing the Web service. For more information, see the Eclipse knowledge Center.