public function addPortOperation(DOMElement $portType, $name, $inputMessage = null, $outputMessage = null)
    {
        $operation = $this->dom->createElement('operation');
        $operation->setAttribute('name', $name);

        if (is_string($inputMessage) && (strlen(trim($inputMessage)) >= 1)) {
            $inputElement = $this->dom->createElement('input');
            $inputElement->setAttribute('message', $inputMessage);
            $operation->appendChild($inputElement);
        }

        if (is_string($outputMessage) && (strlen(trim($outputMessage)) >= 1)) {
            $outputElement = $this->dom->createElement('output');
            $outputElement->setAttribute('message', $outputMessage);
            $operation->appendChild($outputElement);
        }

        $portType->appendChild($operation);

        return $operation;
    }