Permalink
Browse files

[UPDATE] bug fix

[UPDATE] bug fix when generating calls to unclean operation name
  • Loading branch information...
1 parent a37f1f4 commit 9e5caace512a60d459ea6940fcb9fa8b9100efaf @mikaelcom committed Jan 14, 2013
Showing with 8 additions and 8 deletions.
  1. +8 −8 WsdlToPhpFunction.php
View
16 WsdlToPhpFunction.php
@@ -58,7 +58,7 @@ public function __construct($_name,$_parameterType,$_returnType)
public function getComment($_part = '')
{
$comments = array();
- array_push($comments,'Method to call the operation named ' . $this->getName());
+ array_push($comments,'Method to call the operation originally named ' . $this->getName());
if($this->getDocumentation() != '')
array_push($comments,'Documentation : ' . $this->getDocumentation());
$this->addMetaComment($comments,false,true);
@@ -173,11 +173,6 @@ public function getBody(&$_body)
$responseAsObjStart = ((WsdlToPhpGenerator::getOptionResponseAsWsdlObject() && $returnModel)?'new ' . $returnModel->getPackagedName() . '(':'');
$responseAsObjEnd = ((WsdlToPhpGenerator::getOptionResponseAsWsdlObject() && $returnModel)?')':'');
/**
- * Soap call
- */
- $soapCallStart = 'self::getSoapClient()->' . ($this->nameIsClean()?$this->getName() . '(':'__soapCall(' . $this->getName() . ',');
- $soapCallEnd = ')' . (WsdlToPhpGenerator::getOptionSendParametersAsArray()?'->parameters':'');
- /**
* Soap parameters
*/
if($parameterModel)
@@ -218,9 +213,14 @@ public function getBody(&$_body)
else
$soapParametersStart = $soapParametersEnd = '';
/**
+ * Soap call
+ */
+ $soapCallStart = 'self::getSoapClient()->' . ($this->nameIsClean()?$this->getName() . '(':'__soapCall(\'' . $this->getName() . '\'' . ((!empty($soapParametersStart) || !empty($soapParametersEnd))?',array(':''));
+ $soapCallEnd = ((!$this->nameIsClean() && (!empty($soapParametersStart) || !empty($soapParametersEnd)))?')':'') . ')' . (WsdlToPhpGenerator::getOptionSendParametersAsArray()?'->parameters':'');
+ /**
* Send parameters in parameters array
*/
- if(!empty($soapParametersStart))
+ if(!empty($soapParametersStart) && $this->nameIsClean())
{
$sendParametersAsArrayStart = (WsdlToPhpGenerator::getOptionSendParametersAsArray()?'array(\'parameters\'=>':'');
$sendParametersAsArrayEnd = (WsdlToPhpGenerator::getOptionSendParametersAsArray()?')':'');
@@ -230,7 +230,7 @@ public function getBody(&$_body)
/**
* Send an array
*/
- if(!empty($soapParametersStart))
+ if(!empty($soapParametersStart) && $this->nameIsClean())
{
$sendArrayAsParameterStart = (WsdlToPhpGenerator::getOptionSendArrayAsParameter()?'array(':'');
$sendArrayAsParameterEnd = (WsdlToPhpGenerator::getOptionSendArrayAsParameter()?')':'');

0 comments on commit 9e5caac

Please sign in to comment.