php2wsdl icon indicating copy to clipboard operation
php2wsdl copied to clipboard

Usage oh php2wsdl

Open fregian opened this issue 8 years ago • 2 comments

I not use one php framework and have never used composer to install php packeges. Now on my linux box i have installed composer and i go to my project dir and exec

$ composer require php2wsdl/php2wsdl

this create one dir structure: ./vendor --- composer

       ----- php2wsdl

       ------ wingu

autolad.php

In the file mysoapclass.php i insert

require DIR . '/vendor/autoload.php';

and at end of this file i insert:

line 261-268

$class = 'ibr';

$serviceURI = "http://127.0.0.1/soap/finale"; $wsdlGenerator = new PHPClass2WSDL($class, $serviceURI); // Generate thw WSDL from the class adding only the public methods that have @soap annotation. $wsdlGenerator->generateWSDL(true); $wsdlXML = $wsdlGenerator->dump();

file_put_contents ( 'finale.wsdl', $wsdXML );

running 'php mysoapclass.php' i get

PHP Fatal error: Uncaught Error: Class 'PHPClass2WSDL' not found in /var/www/html/soap/finale/mysoapclass.php:263

I have try some require/include modification without success.

Thank's for your reply

Gian Luca

fregian avatar Mar 09 '17 19:03 fregian

I had the same problem. Try with: " $wsdlGenerator = new PHP2WSDL\PHPClass2WSDL($class, $serviceURI); "

bmichaux avatar Mar 16 '17 16:03 bmichaux

Make sure you import the class before

dragosprotung avatar Mar 22 '17 13:03 dragosprotung