Accessing WebSphere MQ objects using COM or URL addresses

You can gain access to objects within an application namespace by:

  1. Calling the ADsGetObject() and ADsOpenObject() functions provided by Microsoft to access the configuration interfaces supported by the specified object.
  2. Using the IParseDisplayName interface implemented by the WebSphere MQ Provider Object.

COM or URL format strings are used to identify objects within a namespace. COM strings take the following syntax:

@<NamespaceID>!//<ProviderSpecificPath>

URL strings take the following syntax:

<NamespaceID>://<ProviderSpecificPath>

The URL format is recommended.

ADSI stipulates the syntax up to <NamespaceID> only; in this case, WebSphere MQ. This part of the object identifier is treated in the same way for both COM and URL format strings. Individual applications are responsible for the <ProviderSpecificPath>. For more information about the provider specific path, see Structuring WebSphere MQ COM and URL addresses.

The WebSphere MQ namespace consists of object identifiers and instances, as shown in Figure 3. For example, to identify a particular channel the following string is required:

WebSphere MQ://MQHost/heron/MQQueueManager/queue.manager.1/MQChannel/
                                                    SYSTEM.DEFAULT.SENDER

It is possible to shorten identifier strings by following these guidelines:

Note:
Using shortened identifier strings results in a performance impact, so only use them when strictly necessary.

Thus, it is possible to shorten the example URL. For example, if the MQHost instance is not specified in the example above, the default taken is the local host machine. Therefore, to access a channel object for a local queue manager, the following URL address is used:

WebSphere MQ://MQQueueManager/queue.manager.1/MQChannel/
                                  SYSTEM.DEFAULT.SENDER

In the case where the queue manager is the default, the URL address can be shortened further:

WebSphere MQ://MQChannel/SYSTEM.DEFAULT.SENDER

C++ Language invocation

To access the IADs interface on the channel SYSTEM.DEFAULT.SENDER defined on queue manager queue.manager.1 residing on machine heron, use the following:

IADs *pMyObject;
 
ADsGetObject(
TEXT("WebSphere MQ://MQHost/heron/MQQueueManager/queue.manager.1/MQChannel/
                                         SYSTEM.DEFAULT.SENDER")
    , IID_IADs
    , (void**)&pMyObject);

Structuring WebSphere MQ COM and URL addresses

As discussed in Accessing WebSphere MQ objects using COM or URL addresses, ADSI identifier strings consist of a namespace identifier and a provider specific path. TheWebSphere MQ namespace identifier is WebSphere MQ. The provider specific path is described below.

It is possible to generate a provider specific path that uniquely identifies any object within the WebSphere MQ namespace using Figure 3 as a guide.

WebSphere MQ passes messages between queue managers residing on one or more machines. Queue managers of the same name may reside across an organization but not on the same host machine. Consequently, the first element in the tree, MQHost, permits different machines to be identified and hence differentiates between queue managers of the same name. Therefore, the first part of the provider specific path is:

MQHost/<Host>

Having identified a particular host machine, it is necessary to differentiate the many queue managers that may potentially reside there. This is achieved through the MQQueueManager identifier producing a provider specific path of:

MQHost/<Host>/MQQueueManager/<QueueManager>

Each queue manager supports the following objects:

These are represented under a given MQQueueManager by the following paths:

MQHost/Host>/MQQueueManager/<QueueManager>/MQClntConnChannel/<Channel>
MQHost/Host>/MQQueueManager/<QueueManager>/MQClusterReceiverChannel/<Channel>
MQHost/Host>/MQQueueManager/<QueueManager>/MQClusterSenderChannel/<Channel>
MQHost/Host>/MQQueueManager/<QueueManager>/MQReceiverChannel/<Channel>
MQHost/Host>/MQQueueManager/<QueueManager>/MQRequesterChannel/<Channel>
MQHost/Host>/MQQueueManager/<QueueManager>/MQSenderChannel/<Channel>
MQHost/Host>/MQQueueManager/<QueueManager>/MQServerChannel/<Channel>
MQHost/Host>/MQQueueManager/<QueueManager>/MQSvrConnChannel/<Channel>
MQHost/Host>/MQQueueManager/<QueueManager>/MQProcess/<Process>
MQHost/Host>/MQQueueManager/<QueueManager>/MQAliasQueue/<Queue>
MQHost/Host>/MQQueueManager/<QueueManager>/MQClusterQueue/<Queue>
MQHost/Host>/MQQueueManager/<QueueManager>/MQLocalQueue/<Queue>
MQHost/Host>/MQQueueManager/<QueueManager>/MQModelQueue/<Queue>
MQHost/Host>/MQQueueManager/<QueueManager>/MQRemoteQueue/<Queue>


© IBM Corporation 2002. All Rights Reserved