Universal Messaging 9.10 | Universal Messaging Developer Guide | Enterprise APIs | Enterprise Developer's Guide for Python | Enterprise Client Development | Creating a Session
 
Creating a Session
To interact with a Universal Messaging Server, the first thing to do is initialize a Universal Messaging Session object, which is effectively your logical and physical connection to one or more Universal Messaging Realms.
Creating a Universal Messaging Session Object
A Universal Messaging Session object (called Universal MessagingSession) is contained within the Universal MessagingPython library so you must first include the library and then initiate a new Universal MessagingSession.

from Universal MessagingPython import *
Universal MessagingModule = Universal MessagingSession()
If the Universal MessagingPython library is not in the same directory as the application you are writing then you will need to make sure the directory containing the library is in the Python sys path:

import sys
sys.path.append('..\\bin\\Win32\\Python26\\')
If you have problems importing the Universal MessagingPython library then it may be that one of the other dependencies are missing. Please make sure you have dealt with the prerequisites (see Environment Configuration)
Connecting to a Universal Messaging Realm
Once the Universal MessagingSession object has been initialised, you can connect to a Universal Messaging Realm as follows:

rname="nsp://localhost:9000"
Universal MessagingModule.connect(rname)
For information of the parameters you can pass to the connect() function e.g a user name, you can enter:

help(Universal MessagingModule.connect)

Copyright © 2013-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.