WsdlToPhp / PackageGenerator

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

set the url for sent the request #237

Closed pcualmac closed 3 years ago

pcualmac commented 3 years ago

Sorry for this question. :)

How do i set the url for send the request

mikaelcom commented 3 years ago

Please read the AbstractSoapClientBase usage from which the ServiceType classes inherit. You'll find the setLocation method that allows to set the location where the request must be sent if not defined in the WSDL.

pcualmac commented 3 years ago
public function getStreamContextOptions()
pcualmac commented 3 years ago

TESTING_URL = 'https://wsbeta.fedex.com:443/web-services/ship';

mikaelcom commented 3 years ago

You must call setLocation on the ServiceType instance:

$do = new ServiceType\Do([]);
$do->setLocation(...);

$result = $do->do($parameters);
pcualmac commented 3 years ago

there is a way to output the wsdl before is send?

mikaelcom commented 3 years ago

there is a way to output the wsdl before is send?

You mean the XML request? If so, yes, you need to use the soapclient option such as in https://github.com/WsdlToPhp/PackageEws365/blob/develop/generate.sh and copy classes from https://github.com/WsdlToPhp/PackageEws365/tree/develop/SoapClient, then you can do whatever you need in the https://github.com/WsdlToPhp/PackageEws365/blob/develop/SoapClient/SoapClient.php class that extends the native PHP SoapClient class.

If you need more information, please open a discussion in the Discussions tab.