Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

add SOAP options to base client #20

Closed
messageagency opened this issue Sep 14, 2012 · 3 comments
Closed

add SOAP options to base client #20

messageagency opened this issue Sep 14, 2012 · 3 comments

Comments

@messageagency
Copy link
Contributor

It would be really useful for me to be able to send options to the SoapClient() call in SforceBaseClient::createConnection, especially for wsdl_cache

http://php.net/manual/en/soapclient.soapclient.php

I'm adding a minor commit that implements this feature.

@messageagency
Copy link
Contributor Author

As I try to figure out how to create a pull request, here's an old fashioned patch:

--- SforceBaseClient.php (saved version)
+++ (current document)
@@ -98,17 +98,22 @@
     * Connect method to www.salesforce.com
     *
     * @param string $wsdl   Salesforce.com Partner WSDL
+    * @param object $proxy  (optional) proxy settings with properties host, port,
+    *                       login and password
+    * @param array $soap_options (optional) Additional options to send to the
+    *                       SoapClient constructor. @see
+    *                       http://php.net/manual/en/soapclient.soapclient.php
     */
-   public function createConnection($wsdl, $proxy=null) {
+   public function createConnection($wsdl, $proxy=null, $soap_options=array()) {
        $phpversion = substr(phpversion(), 0, strpos(phpversion(), '-'));

-       $soapClientArray = array (
+       $soapClientArray = array_merge(array (
            'user_agent' => 'salesforce-toolkit-php/'.$this->version,
            'encoding' => 'utf-8',
            'trace' => 1,
            'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
            'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP
-       );
+       ), $soap_options);

        // We don't need to parse out any subversion suffix - e.g. "-01" since
        // PHP type conversion will ignore it

@messageagency
Copy link
Contributor Author

closing duplicate on pull request:
#21

@metadaddy
Copy link
Contributor

Thanks for the pull request - makes it super easy to merge the change in!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant