wsdl2php Generate soap client proxy classes from wsdl url

  1. Requirements
  2. Usage
  3. Resources
  4. Changelog

This extension wraps easywsdl2php as gii module.

It's an easy to use WSDL to PHP code generator. Just enter the address of the WSDL and the application will generate the library that you will use to write your code.

I did some minor changes to the original EasyWsdl2PHP.php code (formatting, 'extends' params) but did't change the code generation.

No warrenty that easywsdl always will be able to generate valid code, but for my purpose it works (tested with Silverlight/Delphi/Yii soap servers).

Requirements

  • Yii 1.6 or above
  • PHP SOAP extension installed

Usage

  • Extract the content of the zipfile to /protected/gii
  • Enable gii in config/main.php
  • Call index.php/gii and select 'Wsdl2Php Generator'

Example:

gii will generate the class file 'GeoIpService.php' in protected/components (=default). This file contains all necessary classes generated from wsdl.

Create a controller action:

public function actionMyIp()
	{
		$geoIpService = new GeoIpService;
		$response = $geoIpService->GetGeoIPContext(new GetGeoIPContext);
		$geoIp = $response->GetGeoIPContextResult;
		echo sprintf('Your IP: %s (%s, %s)',$geoIp->IP,$geoIp->CountryName,$geoIp->CountryCode);
	}

If you want you can

  • Change the destination directory (Yii path alias syntax)
  • Add base classnames that the (param and main) classes should extend.

Resources

Changelog

v.0.5.2

  • fixed another Lower/Uppercase issue: see comment 8019 and 7706 below. Thanks to robdlyon.

v.0.5.1

  • fixed the issue that the extension was not displayed in gii (non windows users)
  • no code changed, only renamed the files/classes from Wsdl2PhpGenerator.php to Wsdl2phpGenerator.php ...
7 0
18 followers
1 625 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Web Service
Tags: soap, wsdl
Developed by: Joblo
Created on: Sep 18, 2011
Last updated: 12 years ago

Downloads

show all

Related Extensions