Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get PHP SOAP location and uri from existing wsdl

which attributes from existing WSDL do I have to use in order to get the same functionality in non-wsdl mode? I would like to use non wsdl SoapClient in PHP but I can't get the correct configuration. I want to use Salesforce SOAP API but I don't want to store the wsdl file localy. I created that wsdl file and it works when i use it like this

$soap = new \SoapClient("enterprise.wsdl.xml"); 

but I would prefer this way

$soap = new \SoapClient(null, [
     "location" => "#SomeValueThatICanFindInTheActualWSDL#",
     "uri" => "#SomeOtherValueThatICanFindInTheActualWSDL#",
]);

which wsdl attributes should I use as location and uri?

like image 945
yunicz Avatar asked Nov 20 '22 14:11

yunicz


1 Answers

If you paste the WSDL url into your web browser, this will give you a large XML document (you may need to add ?wsdl to the url), which has the 2 variables you are looking for.

To find the location, search for the following node:

<wsdl:import namespace="http://www.[some namespaceurl]" location="https://[the location url you want]" /> 

For the URI, you generally just remove the file name and/or folder structure off the URL. For example if your service is:

https://somedomain.com/folder1/folder2/somefile.svc?wsdl

Then the URI could be:

https://somedomain.com/folder1/folder2

or

https://somedomain.com/folder1

or

https://somedomain.com

You'll just need to trial and error until you find what works. Hope this helps.

like image 76
Michael Avatar answered Dec 25 '22 21:12

Michael