..., 'name' => ...) * @return object The new operation's XML_Tree_Node */ public function addPortOperation($portType, $name, $input = false, $output = false, $fault = false) { $operation = parent::addPortOperation($portType, $name, $input, $output, false); if (is_array($fault)) { $isMessageValid = isset( $fault['message'] ) && is_string( $fault['message'] ) && strlen( trim($fault['message']) ); $isNameValid = isset($fault['name']) && is_string($fault['name']) && strlen(trim($fault['name'])); if ($isNameValid && $isMessageValid) { $node = $this->toDomDocument()->createElement('fault'); $node->setAttribute('name', $fault['name']); $node->setAttribute('message', $fault['message']); $operation->appendChild($node); } } return $operation; } }