Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wsdl2php - PHP Class Generator

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
I have come across this tool and have decided to give it a try. I most say, very nice gadget but, I cannot figure out what to do with the classes it generated.

I used composer to install it - I then ran this script
Code:
include 'vendor/autoload.php';
$generator = new \Wsdl2PhpGenerator\Generator();
$generator->generate(
    new \Wsdl2PhpGenerator\Config(array(
        'inputFile' => '[URL unfurl="true"]https://connect16.basyspro.net/connect.asmx?WSDL',[/URL]
        'outputDir' => 'classes/basys'
    ))
);

I now have a number of PHP scripts (Classes) in classes/basys. Question is, now what? how do I use them?

I like to think that all I have to do is include "classes/basys/autoload.php" and start calling the classes but really, I'm not exactly sure about this.

Are you familiar with wsdl2phpgenerator?

Any and all suggestions will be greatly appreciated.





--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
OK, so I was correct in that all I needed to do was include the autoload.php script with a minor exception.

Here is how it works:
(a) I renamed autoload.php to basys.php so, include basys.php, which in turn, will load all subsequent classes
(b) I instantiated each class I needed to work with and, well, here is a sample
Code:
$link = new Connect();
$trx = new Transaction();

/* set the parameter values */
$trx->setSyn_Act('');
$trx->setSyn_Pwd('');
...
...
...
$send = new Submit($trx);
$resp = $link->Submit($send);
Now, I have successfully captured the results ... Hope this helps the next guy/gal!


--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top