Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
form_section_action_soap_call.inc
1 <?php
18 require_once SQ_PACKAGES_PATH.'/cms/form/form_section_action/form_section_action.inc';
19 require_once SQ_FUDGE_PATH.'/general/text.inc';
20 require_once dirname(dirname(dirname(__FILE__))).'/lib/soap_common.inc';
21 require_once dirname(dirname(dirname(__FILE__))).'/lib/soap_form_based_common.inc';
22 
23 
37 {
38 
43  function __construct()
44  {
45  parent::__construct();
46 
47  }//end constructor
48 
49 
55  public static function paintInlineInterface(Form_Section $form_section, $settings, Backend_Outputter $o, $prefix)
56  {
57  ?>
58 
59  <p class="sq-backend-section-subheading">Connection Details</p>
60 
61  <div id="<?php echo $prefix ?>_connection_div" style="padding: 0.5em 0px 2em 30px;">
62  <table class="sq-backend-table" >
63  <tr>
64  <td width="120"><p>WSDL</p></td>
65  <td><p><?php text_box($prefix.'_wsdl', array_get_index($settings, 'wsdl', ''), 120); ?></p></td>
66  </tr>
67  <tr>
68  <td><?php echo translate('login'); ?></td>
69  <td><p><?php text_box($prefix.'_login', array_get_index($settings, 'login', ''), 35); ?><br />
70  </p></td>
71  </tr>
72  <tr>
73  <td><?php echo translate('password'); ?></td>
74  <td><p><?php password_box($prefix.'_password', array_get_index($settings, 'password', ''), 35); ?></p></td>
75  </tr>
76  <tr>
77  <td colspan="2"><?php echo translate('use_http_authentication'); ?></td>
78  </tr>
79  <tr>
80  <td><?php echo translate('mute_exceptions'); ?></td>
81  <td><p><?php check_box($prefix.'_mute_exceptions', 1, array_get_index($settings, 'mute_exceptions', 0)); ?></p></td>
82  </tr>
83  </table>
84  </div>
85 
86  <div id="<?php echo $prefix ?>_https_div" style="padding: 0.5em 0px 2em 30px;">
87  <table class="sq-backend-table" >
88  <tr>
89  <td><p><?php echo translate('local_cert'); ?></p></td>
90  <td><p><?php asset_finder($prefix.'_local_cert', array_get_index($settings, 'local_cert', ''), Array('file'=>'D')); ?><br/>
91  </tr>
92  <tr>
93  <td><p><?php echo translate('passphrase'); ?></p></td>
94  <td><p><?php password_box($prefix.'_passphrase', array_get_index($settings, 'passphrase', ''), 35); ?></p></td>
95  </tr>
96  <tr>
97  <td colspan="2"><?php echo translate('use_https'); ?></td>
98  </tr>
99  </table>
100  </div>
101 
102  <p class="sq-backend-section-subheading">Test Response</p>
103  <div id="<?php echo $prefix ?>_test_request_response" style="padding: 0.5em 0px 2em 30px;">
104  <table class="sq-backend-table" >
105  <tr>
106  <td width="120">Run Test</td>
107  <td><p>
108  <?php
109  $run_test = array_get_index($settings, 'run_test', 0);
110  check_box($prefix.'_run_test', 1, $run_test);
111  ?>
112  </p></td>
113  </tr>
114  <tr>
115  <td colspan="2">The test will be based on the request content in the "SOAP Request Message" below</td>
116  </tr>
117  </table>
118  </div>
119 
120  <div width="120">
121  <?php
122  if ($run_test && !empty($settings['test_results'])) {
123  foreach($settings['test_results'] as $soap_func => $info) {
124  echo "<b><u>$soap_func</u></b><br /><br />";
125  echo "<b>Request:</b><br />";
126  echo (nl2br(str_replace(' ', '&nbsp;&nbsp;', htmlentities($info['request']))));
127  echo "<br />";
128  echo "<b>Response:</b><br />";
129  echo (nl2br(str_replace(' ', '&nbsp;&nbsp;', htmlentities($info['response']))));
130  echo "<br />";
131 
132  }
133  echo "<br />";
134  }
135  ?>
136  </div>
137 
138 
139  <?php if(!isset($settings['actions']) || empty($settings['actions'])) return;?>
140 
141  <p class="sq-backend-section-subheading"><?php echo translate('request_message'); ?></p>
142 
143  <div id="<?php echo $prefix ?>_action_selection" style="padding: 0.5em 0px 2em 30px;">
144  <table class="sq-backend-table" >
145  <tr>
146  <td><strong><?php echo translate('action');?></strong><br /><br /></td>
147  <td>
148  <?php
149  foreach ($settings['actions'] as $name => $detail) {
150  $action_list[$name] = $name;
151  }
152  combo_box($prefix.'_action', $action_list, FALSE, array_get_index($settings, 'action', ''));
153  ?>
154  <br /><br />
155  </td>
156  </tr>
157  <tr>
158  <td><span style="padding-top:10px;"><strong><?php echo translate('params');?></strong></span></td>
159  <td>
160  <?php
161  $i = 0;
162  if(isset($settings['actions'][$settings['action']])) {
163  foreach ($settings['actions'][$settings['action']] as $parameter_xml) {
164  text_area($prefix.'_'.$settings['action'].'parameters'.$i, array_get_index($settings,$settings['action'].'parameters'.$i, $parameter_xml), 80, 15);
165  echo '<br/>';
166  $i++;
167  }
168  }
169  ?>
170  <br />
171  </td>
172  </tr>
173  <tr>
174  <td colspan="2"><?php echo translate('question_keyword_example'); ?></td>
175  </tr>
176  </table>
177  </div>
178 
179 
180 
181  <p class="sq-backend-section-subheading"><?php echo translate('response_message'); ?></p>
182 
183  <div id="<?php echo $prefix ?>_response" style="padding: 0.5em 0px 2em 30px;">
184  <table class="sq-backend-table" >
185  <tr>
186  <td>
187  <?php
188  if(isset($settings['responses'][$settings['action']])) {
189  // echo the response xml, with style
190  echo (nl2br(str_replace(' ', '&nbsp;&nbsp;', htmlentities(str_replace('[ARRAY_ELEMENT]', '', $settings['responses'][$settings['action']])))));
191  }
192  ?>
193  <br />
194  </td>
195  </tr>
196  <tr>
197  <td>
198  <?php echo translate('response_message_note'); ?>
199  </td>
200  </tr>
201  <tr>
202  </tr>
203  </table>
204  </div>
205 
206  <p class="sq-backend-section-subheading">Check Response</p>
207 
208  <div id="<?php echo $prefix ?>_response_error" style="padding: 0.5em 0px 2em 30px;">
209  <table class="sq-backend-table" >
210  <tr width="120">
211  <td>
212  <?php
213  $selected_fields = isset($settings[$settings['action'].'_response_error_fields']) ? $settings[$settings['action'].'_response_error_fields'] : Array();
214  if (empty($selected_fields)) {
215  echo "No SOAP response fields selected";
216  } else {
217  ?>
218  <table class="sq-backend-table">
219  <tr>
220  <td class="sq-backend-table-header"><?php echo translate('field_name'); ?></td>
221  <td class="sq-backend-table-header"><?php echo translate('error_text'); ?></td>
222  <td class="sq-backend-table-header"><?php echo translate('delete_question'); ?></td>
223  </tr>
224  <?php
226  foreach ($selected_fields as $selected_field => $rule) {
227  $error_msg = array_get_index($rule, 'error_msg', '');
228  $rule_value = array_get_index($rule, 'value', '');
229  $rule_type = array_get_index($rule, 'type', 'must_contain');;
230 
231  $sf_prefix = $prefix.'_'.$settings['action'].'_'.$selected_field;
232  ?>
233  <tr>
234  <td class="sq-backend-table-cell"><?php echo $selected_field; ?></td>
235  <td class="sq-backend-table-cell">
236  <table>
237  <tr>
238  <td>Rule</td>
239  <td><?php
240  combo_box($sf_prefix.'_type', $rules, FALSE, $rule_type);
241  ?>
242  </td>
243  </tr>
244  <tr>
245  <td>Value</td><td><?php text_box($sf_prefix.'_value', $rule_value, 40); ?></td>
246  </tr>
247  <tr>
248  <td>Error Message</td><td><?php text_box($sf_prefix.'_error_msg', $error_msg, 110); ?></td>
249  </tr>
250  </table>
251  </td>
252 
253  <td class="sq-backend-table-cell">
254  <?php check_box($sf_prefix.'_delete_field['.$selected_field.']'); ?>
255  </td>
256  </tr>
257  <?php
258  }//end foreach
259  ?>
260  </table>
261  <?php
262  }//end else
263  ?>
264  <br />
265  <?php
266  echo translate('add_new_field');
267  $response_fields = Array('' => '-- Select Field --');
268  if (isset($settings['response_keywords'][$settings['action']])) {
269  $response_keywords = explode('<br/>', $settings['response_keywords'][$settings['action']]);
270  foreach($response_keywords as $val) {
271  $val = trim($val, '%');
272  $val = substr_replace($val, '', 0, strlen('globals_session_'.$form_section->id.'_soap_'));
273 
274  if ($val) {
275  $response_fields[$val] = $val;
276  }
277  }//end foreach
278  }
279  combo_box($prefix.'_'.$settings['action'].'_response_error_field', $response_fields, FALSE);
280  ?>
281  </td>
282  </tr>
283 
284  <tr>
285  <td><?php translate('fail_validation_error_msg'); ?></td>
286  </tr>
287  </table>
288  </div>
289 
290 
291  <p class="sq-backend-section-subheading"><?php echo translate('response_keywords'); ?></p>
292 
293  <div id="<?php echo $prefix ?>_response_keywords" style="padding: 0.5em 0px 2em 30px;">
294  <table class="sq-backend-table" >
295  <tr>
296  <td>
297  <?php
298  if(isset($settings['response_keywords'][$settings['action']])) {
299  // echo the response xml, with style
300  echo ($settings['response_keywords'][$settings['action']]);
301  }
302  ?>
303  <br />
304  </td>
305  </tr>
306  <tr>
307  <td><?php echo translate('response_keyword_note'); ?></td>
308  </tr>
309  </table>
310  <p class="sq-backend-section-subheading"><?php echo translate('response_to_download_as_file'); ?></p>
311  <table class="sq-backend-table">
312  <tr>
313  <td class="sq-backend-table-header"><?php echo translate('field_keyword_tags'); ?></td>
314  </tr>
315  <?php
316  $response_to_file = array_get_index($settings, $settings['action'].'_file_response_to_save', Array());
317  $currently_configured = count($response_to_file);
318 
319  foreach ($response_to_file as $i => $response) { ?>
320  <tr>
321  <td>
322  <?php
323  text_box($prefix.'_'.$settings['action'].'_file_response_to_save['.$i.']', $response, 50);
324 
325  if (in_array($response, $settings[$settings['action'].'_invalid_keywords_for_file'])) {
326  // let the user know if one of the keywords entered was invalid
327  echo "<span style=\"color:#FF0000\"><b> *invalid keyword</b></span>";
328  }
329  ?>
330  </td>
331  </tr>
332  <?php } ?>
333  <tr>
334  <td>
335  <?php
336  $count = $currently_configured++;
337  text_box($prefix.'_'.$settings['action'].'_file_response_to_save['.$count.']', '', 50);
338  ?>
339  </td>
340  </tr>
341  <tr>
342  <td><?php echo translate('response_to_download_as_file_note'); ?></td>
343  </tr>
344  </table>
345  </div>
346 
347  <?php
348 
349  }//end paintInlineInterface()
350 
351 
358  public static function processInlineInterface(Form_Section $form_section, &$settings, Backend_Outputter $o, $prefix)
359  {
360  $settings['local_cert'] = isset($_POST[$prefix.'_local_cert']['assetid']) ? $_POST[$prefix.'_local_cert']['assetid']: NULL;
361  $settings['wsdl'] = array_get_index($_POST, $prefix.'_wsdl', NULL);
362  $settings['login'] = array_get_index($_POST, $prefix.'_login', NULL);
363  $settings['password'] = array_get_index($_POST, $prefix.'_password', NULL);
364  $settings['mute_exceptions'] = array_get_index($_POST, $prefix.'_mute_exceptions', NULL);
365  $settings['run_test'] = array_get_index($_POST, $prefix.'_run_test', NULL);
366  $settings['passphrase'] = array_get_index($_POST, $prefix.'_passphrase', NULL);
367  $settings['action'] = array_get_index($_POST, $prefix.'_action', NULL);
368 
369  // This submission needs to be executed before form get submitted
370  $settings['before_submit'] = TRUE;
371 
372  if(isset ($settings['wsdl']) && !empty($settings['wsdl'])) {
373 
374  $options = SOAP_Common::_getSoapOptions($settings);
375  try {
376  $client = new SoapClient($settings['wsdl'], $options);
377  $functions = $client->__getFunctions();
378  $types = $client->__getTypes();
379  }
380  catch (Exception $e) {
381  trigger_error($e->getMessage());
382  return TRUE;
383  }
384 
385  if(!empty($functions)) {
386  foreach ($functions as $function) {
387  $function_name = preg_replace('/^\w+ (\w+)\(.*\)/', '$1', $function);
388  $function_params = explode(', ', preg_replace('/^\w+ \w+\((.*)\)/', '$1', $function));
389  $function_response = preg_replace('/^(\w+) \w+\(.*\)/', '$1', $function);
390 
391  // Fixed duplicate function definition issue of PHP SoapClient
392  if(isset($function_list[$function_name])) continue;
393 
394  // parse parameters
395  $parsed_params = Array();
396  foreach ($function_params as $param) {
397  if (!trim($param)) continue;
398 
399  // Get XML representation of params of the functions
400  $xml_param = SOAP_Common::_parse_type($param, $types);
401  $parsed_params[$param] = SOAP_Common::_formatXmlString(empty($xml_param) ? $param : $xml_param->asXML());
402  }
403  $function_list[$function_name] = $parsed_params;
404 
405  // parse response
406  $xml_response = SOAP_Common::_parse_type($function_response, $types);
407  if ($xml_response === TRUE || $xml_response === FALSE) {
408  $response_list[$function_name] = SOAP_Common::_formatXmlString('<?xml version=\"1.0\"?'.'>'."<$function_name>??</$function_name>");
409  $keywords = 'globals_session_'.$form_section->id.'_soap'.($xml_response ? '0' : '');
410  } else {
411  $response_list[$function_name] = SOAP_Common::_formatXmlString(empty($xml_response) ? '' : $xml_response->asXML());
412  $keywords = SOAP_Common::_parse_response_keywords ($xml_response, 'globals_session_'.$form_section->id.'_soap_');
413  }
414  // parse response keywords
415  $keywords_list[$function_name] = str_replace('[ARRAY_ELEMENT]', '0', $keywords);
416 
417  }//end foreach
418 
419  $settings['actions'] = $function_list;
420  $settings['responses'] = $response_list;
421  $settings['response_keywords'] = $keywords_list;
422  }//end if
423  }//end foreach
424 
425  // Currently selected "Check response" fields
426  $current_selected_fields = isset($settings[$settings['action'].'_response_error_fields']) ? $settings[$settings['action'].'_response_error_fields'] : Array();
427  $field_rule = Array();
428 
429  // String containg all the SOAP response keywords
430  $keywords_string = '';
431  if (isset($settings['response_keywords'])) {
432  $keywords_string = implode(';',$settings['response_keywords']);
433  }
434 
435  foreach ($current_selected_fields as $selected_field => $rule) {
436  $sf_prefix = $prefix.'_'.$settings['action'].'_'.$selected_field;
437 
438  // If the field is deleted or dosen't exists in SOAP response anymore
439  if ((!isset($_POST[$sf_prefix.'_delete_field'][$selected_field]) || !$_POST[$sf_prefix.'_delete_field'][$selected_field]) && strpos($keywords_string, '%globals_session_'.$form_section->id.'_soap_'.$selected_field.'%') !== FALSE) {
440  if (isset($_POST[$sf_prefix.'_error_msg'])) {
441  $field_rule[$selected_field] = Array(
442  'type' => $_POST[$sf_prefix.'_type'],
443  'value' => $_POST[$sf_prefix.'_value'],
444  'error_msg' => trim($_POST[$sf_prefix.'_error_msg']),
445  );
446  } else {
447  $field_rule[$selected_field] = $rule;
448  }//end else
449  }//end if
450  }//end foreach
451 
452  // Add new "Check response" field
453  if (isset($_POST[$prefix.'_'.$settings['action'].'_response_error_field']) && !empty($_POST[$prefix.'_'.$settings['action'].'_response_error_field'])) {
454  $new_field = $_POST[$prefix.'_'.$settings['action'].'_response_error_field'];
455  $field_rule[$new_field] = Array();
456  }
457 
458  // Set up current params for current action
459  if(isset($settings['actions'][$settings['action']])) {
460  $settings[$settings['action'].'_response_error_fields'] = $field_rule;
461  for($i = 0; $i < count($settings['actions'][$settings['action']]); $i++) {
462  if(isset($_POST[$prefix.'_'.$settings['action'].'parameters'.$i]))
463  $settings[$settings['action'].'parameters'.$i] = $_POST[$prefix.'_'.$settings['action'].'parameters'.$i];
464  }
465  }
466 
467  $settings[$settings['action'].'_invalid_keywords_for_file'] = Array();
468  if (isset($settings['actions'][$settings['action']])) {
469  $save_file_response = array_get_index($_POST, $prefix.'_'.$settings['action'].'_file_response_to_save', Array());
470  foreach ($save_file_response as $index => $response_kwd) {
471  // see if the keyword mentioned here is blnk or not from current response
472  // if so remove it and also let user know of any invalid keywords put in
473  if (trim($response_kwd) == '') {
474  unset($save_file_response[$index]);
475  continue;
476  }
477 
478  if (strpos($settings['response_keywords'][$settings['action']], $response_kwd) === FALSE) {
479  $settings[$settings['action'].'_invalid_keywords_for_file'][] = $response_kwd;
480  }
481  }
482  $settings[$settings['action'].'_file_response_to_save'] = $save_file_response;
483  }
484 
485  // Run test request
486  $test_results = Array();
487  if ($settings['run_test']) {
488  foreach($functions as $function) {
489  $function_name = preg_replace('/^\w+ (\w+)\(.*\)/', '$1', $function);
490  if($function_name != $settings['action']) continue;
491  $test_results[$function_name] = SOAP_Common::testSoapRequest($client, $settings, $function_name, $form_section);
492  }
493  }//end if
494  $settings['test_results'] = $test_results;
495 
496  return TRUE;
497 
498  }//end processInlineInterface()
499 
500 
507  public static function paintSummary(Form_Section $form_section, $settings, Backend_Outputter $o, $prefix)
508  {
509 
510  ?><table class="no-borders">
511  <colgroup>
512  <col width="80" />
513  <col/>
514  </colgroup>
515  <tbody>
516  <tr>
517  <td class="sq-backend-table-cell" style="vertical-align: top"><p><strong><?php echo translate('action');?></strong></p></td>
518  <td class="sq-backend-table-cell" style="vertical-align: top"><p><?php
519  if (isset ($settings['action'])) {
520  echo $settings['action'];
521  } else {
522  ?><span class="sq-backend-warning"><?php echo translate('no_soap_action');?></span><?php
523  }
524 
525  if (!isset ($settings[$settings['action'].'parameters0'])) {
526  ?><br/><span class="sq-backend-warning"><?php echo translate('no_parameter');?></span><?php
527  }
528  ?></p></td>
529  </tr>
530  </tbody>
531  </table>
532  <?php
533 
534  }//end paintSummary()
535 
536 
543  public static function execute(Form_Section $form_section, Form $form, $settings)
544  {
545  $success = TRUE;
546 
547  if(!isset($form->submission_errors)) {
548  $form->submission_errors = Array();
549  }
550 
551  if(!isset($settings['actions'][$settings['action']])) {
552  $form->submission_errors = array_merge($form->submission_errors, Array(translate('no_soap_action')));
553  return FALSE;
554  }
555  if(!isset($settings['wsdl'])) {
556  $form->submission_errors = array_merge($form->submission_errors, Array(translate('no_wsdl')));
557  return FALSE;
558  }
559 
560  $function = $settings['action'];
561  $wsdl = $settings['wsdl'];
562  $options = SOAP_Common::_getSoapOptions($settings);
563 
564  // Work out the parameters of that soap function
565  for($i = 0, $param = Array(); $i < count($settings['actions'][$settings['action']]); $i++) {
566  if(isset($settings[$settings['action'].'parameters'.$i])) {
567 
568  $soap_message = SOAP_Form_Based_Common::getKeywordReplacementsFromForm($settings[$settings['action'].'parameters'.$i], $form);
569  $object = @simplexml_load_string($soap_message, 'SimpleXMLElement' , LIBXML_NOCDATA);
570 
571  if($object === FALSE) {
572  // Just string argument, replace file content keywords
573  $object = SOAP_Form_Based_Common::getFileContentReplacementsFromForm($soap_message, $form);
574  } else {
575  // Convert XML to array, replace file content keywords, xml is not friendly for binary data
576  $object = SOAP_Form_Based_Common::toArray($object, $form);
577  }
578 
579  $param[] = $object;
580  }
581  }
582 
583  // Get an array of parameters
584  $eval_string = '';
585  foreach ($param as $index => $object) {
586  $eval_string .= $index == 0 ? '' : ', ';
587  $eval_string .= '$param['.$index.']';
588  }
589 
590  // Enable backtrace option
591  $options['trace'] = 1;
592 
593  // If SOAP exceptions are to be silenced
594  if ($settings['mute_exceptions']) {
595  $options['exceptions'] = 0;
596  }
597 
598  // Make SOAP call
599  try {
600  $client = new SoapClient($wsdl, $options);
601  eval('$data = $client->$function('.$eval_string.');');
602  }
603  catch (Exception $e) {
604  // SOAP error should be treated as normal form error
605  $form->submission_errors = array_merge($form->submission_errors, Array($e->getMessage()));
606  return FALSE;
607  }
608 
609  if ($settings['mute_exceptions'] && get_class($data) == 'SoapFault') {
610  $soap_response = $client->__getLastResponse();
611  $data = NULL;
612  // Create the SOAP call return object from last SOAP request
613  if (preg_match('|<([^:]+:)?Body>(.*)</([^:]+:)?Body>|msi', $soap_response, $match)) {
614  $data = simplexml_load_string($match[2]);
615  }
616  }
617 
618  // Store results in session
619  $soap_response_keywords = Array();
620  $file_saving_keywords = array_get_index($settings, $settings['action'].'_file_response_to_save', Array());
621  SOAP_Common::_store_results($data, $form_section->id.'_soap_', $soap_response_keywords, $file_saving_keywords);
622 
623  // Store all the session keywords vars in each form step
624  if (empty($_SESSION[SQ_SESSION_SANDBOX_INDEX][$form_section->id.'_soap_response_keywords'])) {
625  $_SESSION[SQ_SESSION_SANDBOX_INDEX][$form_section->id.'_soap_response_keywords'] = Array();
626  }
627 
628  $_SESSION[SQ_SESSION_SANDBOX_INDEX][$form_section->id.'_soap_response_keywords'] = array_merge($_SESSION[SQ_SESSION_SANDBOX_INDEX][$form_section->id.'_soap_response_keywords'], array_keys($soap_response_keywords));
629 
630 
631  // Remove prefix from response keywords
632  foreach($soap_response_keywords as $key => $val) {
633  $soap_response_keywords[substr_replace($key, '', 0, strlen($form_section->id.'_soap_'))] = $val;
634  unset($soap_response_keywords[$key]);
635  }
636  // If the SOAP response has one of the non-empty "Check Response" fields, return error
637  if (!empty($settings[$settings['action'].'_response_error_fields'])) {
638  foreach($settings[$settings['action'].'_response_error_fields'] as $check_field => $rule) {
639  if (!isset($soap_response_keywords[$check_field]) || !SOAP_Form_Based_Common::validateValue($soap_response_keywords[$check_field], $rule)) {
640  $form->submission_errors = array_merge($form->submission_errors, Array($rule['error_msg']));
641  $success = FALSE;
642  }
643  }//end foreach
644  }//end if
645 
646  return $success;
647 
648  }//end execute()
649 
650 
661  public static function finalise(Form $form)
662  {
663  // Clear all the keywords var set in the session by previous SOAP action steps
664  if (!empty($_SESSION[SQ_SESSION_SANDBOX_INDEX][$form->id.'_soap_response_keywords'])) {
665  $session_keywords = array_unique($_SESSION[SQ_SESSION_SANDBOX_INDEX][$form->id.'_soap_response_keywords']);
666  foreach($session_keywords as $session_keyword) {
667  if (isset($_SESSION[SQ_SESSION_SANDBOX_INDEX][$session_keyword])) {
668  unset($_SESSION[SQ_SESSION_SANDBOX_INDEX][$session_keyword]);
669  }
670  }//end foreach
671  unset($_SESSION[SQ_SESSION_SANDBOX_INDEX][$form->id.'_soap_response_keywords']);
672  unset($session_keywords);
673  }
674 
675  }//end finalise()
676 
677 
684  public static function isValid(Form_Section $form_section, $settings)
685  {
686  // Must have a wsdl
687  if (empty($settings['wsdl'])) {
688  return FALSE;
689  }
690 
691  // The SOAP service must have actions
692  if (empty($settings['actions'])) {
693  return FALSE;
694  }//end if
695 
696  // The action we try to use must be specified
697  if (!isset($settings['action'])) {
698  return FALSE;
699  }//end if
700 
701  // Expect at least one parameter
702  if (!isset ($settings[$settings['action'].'parameters0'])) {
703  return FALSE;
704  }//end if
705 
706  return TRUE;
707 
708  }//end isValid()
709 
710 
711 }//end class
712 
713 ?>