public function addMessage($name, array $parts)
    {
        $message = $this->dom->createElement('message');
        $message->setAttribute('name', $name);

        foreach ($parts as $name => $type) {
            $part = $this->dom->createElement('part');
            $part->setAttribute('name', $name);
            if (is_array($type)) {
                foreach ($type as $key => $value) {
                    $part->setAttribute($key, $value);
                }
            } else {
                $part->setAttribute('type', $type);
            }

            $message->appendChild($part);
        }

        $this->wsdl->appendChild($message);

        return $message;
    }