WsdlToPhp / PackageGenerator

Generates a PHP SDK based on a WSDL, simple and powerful, WSDL to PHP
https://providr.io
MIT License
422 stars 73 forks source link

SoapClient #236

Closed pcualmac closed 3 years ago

pcualmac commented 3 years ago

RateService_v28.txt

Sorry for this question.

I got a problem in initialize the SoapClient.

$this->setResult($this->getSoapClient()->__soapCall('getRates', array(
                $rateRequest,
            ), array(), array(), $this->outputHeaders));
mikaelcom commented 3 years ago

Can you paste the whole script instantiating the Service class? Did you look to the tutorial.php file at first?

pcualmac commented 3 years ago
use WsdlToPhp\PackageGenerator\ConfigurationReader\GeneratorOptions;
use WsdlToPhp\PackageGenerator\Generator\Generator;

$generator = new Generator();
$files = Storage::disk('public')->allFiles('_wsdl');
foreach ($files as $key => $value) 
{                                         
    $options->setOrigin(storage_path().'/app/public/'.$value)
        ->setDestination('./sd-FedExRateService')
        ->setComposerName('sdsomersetdesign/sdfedexrateservice');                                                                            
    $generator = new Generator($options);                                        
    $generator->setOptionNamespacePrefix("FedexRateService");                    
    $generator->generatePackage();  
}

the only file in _wdsl folder is RateService_v28.wdsl.

Thanks for your time.

Sorry where is tutorial.php?

mikaelcom commented 3 years ago

To resume your script and its result:

Do you actually have the listed classes, files and directories?

pcualmac commented 3 years ago

The Classes generated under the ./sd-FedExRateService/src directory with at least: ./sd-FedExRateService/src/StructType/: containing StructType classes ./sd-FedExRateService/src/ServiceType/: containing ServiceType classes ./sd-FedExRateService/src/ClassMap.php: containing the ClassMap class

Yes

The tutorial.php file is generated under the ./sd-FedExRateService directory. It's the boilerplate to send requests using the generated classes.

Yes

The composer.json file is generated under the ./sd-FedExRateService directory The composer.lock file should be present in the ./sd-FedExRateService directory The vendor directory should be present in the ./sd-FedExRateService directory

Yes

Fixed now i got an Authentication Failed error but this is on me.

Thanks