Accessing WebSphere MQ objects using COM or URL addresses" /> Accessing WebSphere MQ objects using COM or URL addresses

 

Accessing WebSphere MQ objects using COM or URL addresses

We 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