Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix wsdl generator

  • Loading branch information...
commit dc0503625d96cc4527418fb899e21a52baad163c 1 parent 990cce4
@nineinchnick nineinchnick authored
Showing with 21 additions and 14 deletions.
  1. +21 −14 framework/web/services/CWsdlGenerator.php
View
35 framework/web/services/CWsdlGenerator.php
@@ -300,7 +300,20 @@ protected function processMethod($method)
$n=preg_match_all('/^@header\s+([\w\.]+(\[\s*\])?)\s*?(.*)$/im',$comment,$matches);
for($i=0;$i<$n;++$i)
- $headers[$matches[1][$i]]=array($this->processType($matches[1][$i]),trim($matches[3][$i])); // name => type, doc
+ {
+ $name = $matches[1][$i];
+ $type = $this->processType($matches[1][$i]);
+ $doc = trim($matches[3][$i]);
+ if ($this->bindingStyle == self::STYLE_RPC)
+ {
+ $headers[$name]=array($type,$doc);
+ }
+ else
+ {
+ $this->elements[$name][$name]=array('type'=>$type);
+ $headers[$name] = array('element'=>$type);
+ }
+ }
if ($headers !== array())
{
@@ -314,13 +327,7 @@ protected function processMethod($method)
$firstHeader = null;
}
- if(preg_match('/^@return\s+([\w\.]+(\[\s*\])?)\s*?(.*)$/im',$comment,$matches))
- $return=array($this->processType($matches[1]),trim($matches[2])); // type, doc
- else
- $return=null;
- $this->messages[$methodName.'Response']=array('return'=>$return);
-
- if ($this->bindingStyle == self:STYLE_RPC)
+ if ($this->bindingStyle == self::STYLE_RPC)
{
if(preg_match('/^@return\s+([\w\.]+(\[\s*\])?)\s*?(.*)$/im',$comment,$matches))
$return=array(
@@ -750,9 +757,9 @@ protected function createOperationElement($dom,$name,$headers=null)
if (isset($headers['input']) && is_array($headers['input']) && count($headers['input'])==2)
{
$soapHeader = $dom->createElement('soap:header');
- $soapHeader->setAttribute('use', 'encoded');
- $soapHeader->setAttribute('namespace', $this->namespace);
- $soapHeader->setAttribute('encodingStyle', 'http://schemas.xmlsoap.org/soap/encoding/');
+ foreach($operationBodyStyle as $attributeName=>$attributeValue) {
+ $soapHeader->setAttribute($attributeName, $attributeValue);
+ }
$soapHeader->setAttribute('message', $headers['input'][0]);
$soapHeader->setAttribute('part', $headers['input'][1]);
$input->appendChild($soapHeader);
@@ -760,9 +767,9 @@ protected function createOperationElement($dom,$name,$headers=null)
if (isset($headers['output']) && is_array($headers['output']) && count($headers['output'])==2)
{
$soapHeader = $dom->createElement('soap:header');
- $soapHeader->setAttribute('use', 'encoded');
- $soapHeader->setAttribute('namespace', $this->namespace);
- $soapHeader->setAttribute('encodingStyle', 'http://schemas.xmlsoap.org/soap/encoding/');
+ foreach($operationBodyStyle as $attributeName=>$attributeValue) {
+ $soapHeader->setAttribute($attributeName, $attributeValue);
+ }
$soapHeader->setAttribute('message', $headers['output'][0]);
$soapHeader->setAttribute('part', $headers['output'][1]);
$output->appendChild($soapHeader);

0 comments on commit dc05036

Please sign in to comment.
Something went wrong with that request. Please try again.