def to_dict(self):
        '''Save this service port connector into a dictionary.'''
        d = {'connectorId': self.connector_id,
                'name': self.name,
                'sourceServicePort': self.source_service_port.to_dict(),
                'targetServicePort': self.target_service_port.to_dict()}
        if self.visible != True:
            d[RTS_EXT_NS_YAML + 'visible'] = self.visible
        if self.trans_method:
            d['transMethod'] = self.trans_method
        if self.comment:
            d[RTS_EXT_NS_YAML + 'comment'] = self.comment
        props = []
        for name in self.properties:
            p = {'name': name}
            if self.properties[name]:
                p['value'] = str(self.properties[name])
            props.append(p)
        if props:
            d[RTS_EXT_NS_YAML + 'properties'] = props
        return d
Save this service port connector into a dictionary.