Skip to content

Commit fb28545

Browse files
committed
Added 'use' option. Fix for PHP Strict (2048) error when calling listSources without data. Usage instructions enhanced and clarified.
1 parent 55ba8e1 commit fb28545

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

README.md

+19-7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Add a configuration to your database.php in app/config/
2727
'ns' => 'namespace',
2828
'container' => 'session_key',
2929
)
30+
'use' => SOAP_ENCODED // optional - used only for non wsdl mode
3031
);
3132

3233
Then in your model set:
@@ -37,18 +38,29 @@ Then in your model set:
3738

3839
And you're ready to go.
3940

40-
In your controller you can now use
41+
Asuming that you parameters are:
4142

42-
$this->Model->query('SoapMethod', array('mySoapParams'));
43+
$params = array('param1' => 'value1', 'param2' => 'value2');
4344

44-
or
45+
In your controller you can now use
4546

46-
$this->Model->SoapMethod(array('mySoapParams'));
47+
$this->Model->query('SoapMethod', array($params));
48+
49+
**Important**: notice the *array()* enclosing your params array.
4750

4851
or with header data
4952

50-
$this->Model->query('SoapMethod', array('mySoapParams'), array('mySoapHeaderParams'));
51-
53+
$headerParams = array('headerParam1' = 'value1', 'headerParam2' => 'value2');
54+
55+
$this->Model->query('SoapMethod', array($params), array($headerParams);
56+
57+
**Important**: again, notice the *array()* enclosing your params and header params arrays.
58+
59+
or
60+
61+
$this->Model->SoapMethod($params);
62+
63+
**Important**: notice the difference with the previous examples. In this case DON'T enclose the params with *array()*.
5264

5365
## Thanks for updating
5466

@@ -77,4 +89,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
7789
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
7890
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
7991
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
80-
SOFTWARE.
92+
SOFTWARE.

SoapSource.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public function connect() {
106106
if(!empty($this->config['proxy_port'])) {
107107
$options['proxy_port'] = $this->config['proxy_port'];
108108
}
109+
if(!empty($this->config['use'])) {
110+
$options['use'] = $this->config['use'];
111+
}
109112

110113
/** Workaround to prevent SoapClient throwing a RuntimeException **/
111114
if (extension_loaded('curl') && Configure::read('debug') > 0 && !empty($this->config['wsdl']) && empty($this->config['curl_off']))
@@ -149,7 +152,7 @@ public function close() {
149152
*
150153
* @return array List of SOAP methods
151154
*/
152-
public function listSources() {
155+
public function listSources($data = NULL) {
153156
return $this->client->__getFunctions();
154157
}
155158

@@ -179,7 +182,7 @@ public function query() {
179182
$headerData = $args[2];
180183
} elseif(count($args) > 2 && !empty($args[1])) {
181184
$method = $args[0];
182-
$queryData = $args[1][0];
185+
$queryData = $args[1];
183186
}
184187

185188
if (!empty($headerData)) {
@@ -241,4 +244,4 @@ public function showError($result = null) {
241244
}
242245

243246
}
244-
?>
247+
?>

0 commit comments

Comments
 (0)