You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Andrea Gazzarini <a....@gmail.com> on 2009/01/25 10:20:31 UTC

WS-DM Examples

Hi all,
I added an example source folder (not yet committed).
I think that it should be better to release this folder as is, without
binaries.
Reason is that you don't need to effectively run this examples because :

- Unit test already do that;
- They must run in a predefined context (Qpid must up and running, QMan
too);
- User would simply have a look about how to do something (with code); About
that point on source code there's (between examples) a lot of code
duplication. This is due to the fact that the example should be IMO
immediately clear and I tried to isolate code that is not related with the
core of the example. You can find what I mean (when I will submit :) ) in
the executeExample of each class.
- Examples are written in Java so they are reporting how a Java client
connects to WS-DM. What is important is IMO is to describe the exchanged
messages (SOAP request & response) that are needed to conversate with WS-DM.
For that reason I will include, together with the examples, a set of xml
files that contains WS-DM conversations.

Anyway , if the use wants to run the example this will be possible. An
opportune README (or wiki howto) will be included and the example will
articulate in the following way.

*> java  <example_class> <host> <port>*

     GetQManResourceMembersExample
-------------------------------------------------------------------

This example shows the usage of WS-DM
GetResourcePropertyRequest / Response on a
Group service.
The target resource is the WS-DM Adapter itself
and the requested property is "ws-rp:Entry".
WS-DM Adapter is a special WS-Resource (is a Group)
that  acts as the main entry point for retrieving
all other managed resources.
So clients that want to deal with QMan WS-Resources
must first get resource identifiers sending
a GetResourcePropertyRequest to WS-DM Adapter
with "ws-rp:Entry" as target target property.

-------------------------------------------------------------------

Type enter to proceed...

[CLIENT TRACE] SOAP envelope contents (outgoing):

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://romagazzarini:8080/qman/services/adapter</wsa:To>
        <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/GetResourcePropertyRequest
</wsa:Action>
        <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing
">uuid:024c678b-1fab-cb6a-0992-30027817fb92</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
            <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous
</wsa:Address>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <wsrf-rp:GetResourceProperty
            xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
xmlns:wsrf-sg="http://docs.oasis-open.org/wsrf/sg-2
">wsrf-sg:Entry</wsrf-rp:GetResourceProperty>
    </soap:Body>
</soap:Envelope>

[CLIENT TRACE] SOAP envelope contents (incoming):

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
        <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">
http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/GetResourcePropertyResponse
</wsa:Action>
        <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing
">uuid:62f50bef-269a-7a52-712a-3196dc78d37a</wsa:MessageID>
        <wsa:RelatesTo RelationshipType="wsa:Reply" xmlns:wsa="
http://www.w3.org/2005/08/addressing
">uuid:11c98e8b-1420-96fa-809b-89d64ce908eb</wsa:RelatesTo>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
            <wsa:Address>http://localhost:8080/qman/services/adapter
</wsa:Address>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <wsrf-rp:GetResourcePropertyResponse xmlns:wsrf-rp="
http://docs.oasis-open.org/wsrf/rp-2">
            <wsrf-sg:Entry xmlns:wsrf-sg="
http://docs.oasis-open.org/wsrf/sg-2">
                <wsrf-sg:ServiceGroupEntryEPR>
                    <wsa:Address xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://localhost:8080/qman/services/ServiceGroupEntry</wsa:Address>
                    <wsa:ReferenceParameters xmlns:wsa="
http://www.w3.org/2005/08/addressing">
                        <muse-wsa:ResourceId xmlns:muse-wsa="
http://ws.apache.org/muse/addressing
">uuid:44bb636c-0cbf-97e2-fb16-976b357f2d7f</muse-wsa:ResourceId>
                    </wsa:ReferenceParameters>
                </wsrf-sg:ServiceGroupEntryEPR>
                <wsrf-sg:MemberServiceEPR>
                    <wsa:Address xmlns:wsa="
http://www.w3.org/2005/08/addressing">
http://localhost:8080/qman/services/QManWsResource</wsa:Address>
                    <wsa:ReferenceParameters xmlns:wsa="
http://www.w3.org/2005/08/addressing">
                        <qman-wsa:ResourceId xmlns:qman-wsa="
http://amqp.apache.org/qpid/management/qman/addressing">Q-MAN:
brokerID=a5fc470e-7697-462d-9005-2fa3d809dde7,class=queue,name=1232874803766,objectId=468a62ea-dccc-4a9d-84bd-06c1d50c83e0,package=org.apache.qpid</qman-wsa:ResourceId>
                    </wsa:ReferenceParameters>
                </wsrf-sg:MemberServiceEPR>
                <wsrf-sg:Content/>
            </wsrf-sg:Entry>
        </wsrf-rp:GetResourcePropertyResponse>
    </soap:Body>
</soap:Envelope>

--------------------------------------------------------------------------
QMan has at the moment 1 registered resources.
--------------------------------------------------------------------------

Regards,
Andrea