コード例 #1
0
 /**
  * Adds a message tag to the WSDL document
  * @param string Message name
  * @param Array[string=>string] Array with variables & types
  */
 private function addMessage($name, $parts)
 {
     $this->addToDebug("Adding message: '{$name}'");
     $msg = $this->addElement("message", $this->definitions);
     $msg->setAttribute("name", $name);
     foreach ((array) $parts as $partName => $partType) {
         $this->addToDebug("Adding Message part: '{$partName} => {$partType}'");
         $part = $this->addElement("part", $msg);
         $part->setAttribute("name", $partName);
         //check if it is a valid XML Schema datatype
         if ($t = IPXMLSchema::checkSchemaType(strtolower($partType))) {
             $part->setAttribute("type", "xsd:" . $t);
         } else {
             //If it is an associative array, change the type name
             if (substr($partType, -4) == "[=>]") {
                 $partType = substr($partType, 0, strlen($partType) - 4);
                 if (!IPXMLSchema::checkSchemaType(strtolower($partType))) {
                     $partName = $partType;
                     $this->xmlSchema->addComplexType($partType, $partName);
                 }
                 $part->setAttribute("type", "apache:Map");
             } else {
                 $partName = substr($partType, -2) == "[]" ? substr($partType, 0, strpos($partType, "[")) . "Array" : $partType;
                 $part->setAttribute("type", "tns:" . $partName);
                 $this->xmlSchema->addComplexType($partType, $partName);
             }
         }
     }
 }
コード例 #2
0
 /**
  * Adds a message tag to the WSDL document.
  *
  * @param string Message name
  * @param Array[string=>string] Array with variables & types
  */
 private function addMessage($name, $parts)
 {
     $this->addToDebug("Adding message: '{$name}'");
     $msg = $this->addElement('message', $this->definitions);
     $msg->setAttribute('name', $name);
     foreach ((array) $parts as $partName => $partType) {
         $this->addToDebug("Adding Message part: '{$partName} => {$partType}'");
         $part = $this->addElement('part', $msg);
         $this->xmlSchema->addType($partType, $partName, $part);
     }
 }