You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pubscribe-user@ws.apache.org by Asaf Lahav <as...@primagrid.com> on 2006/05/30 16:34:46 UTC

Notifications related question

I have been going through the pubscribe sample code and ran into (the
attached) "RequestUtils.java".

 

RequestUtils.java has the following function:

 

    public static boolean invokeSubscribe(String consumerURL, String
serviceEPRURL, String topicName)

    {

        QName topic = QName.valueOf(topicName);

        SubscribeDocument requestDoc =
SubscribeDocument.Factory.newInstance();

        SubscribeDocument.Subscribe subscribe =
requestDoc.addNewSubscribe();

        subscribe.setUseNotify(true);

        Calendar instance = Calendar.getInstance();

        instance.setTimeInMillis(instance.getTimeInMillis() + 2000000);

        subscribe.setInitialTerminationTime(instance);

        org.xmlsoap.schemas.ws.x2003.x03.addressing.EndpointReferenceType
consumerRef = subscribe.addNewConsumerReference();

        org.xmlsoap.schemas.ws.x2003.x03.addressing.AttributedURI address =
consumerRef.addNewAddress();

        address.setStringValue(createEpr(consumerURL).getAddress());

        TopicExpressionType topicExpr = subscribe.addNewTopicExpression();

 
topicExpr.setDialect(TopicsConstants.TOPIC_EXPR_DIALECT_SIMPLE.toString());

        XmlBeanUtils.setValueAsQName(topicExpr, topic);

        XmlObject response = sendRequest(requestDoc,
"http://xyz.com/action/Subscribe", createEpr(serviceEPRURL));

        if (!(response instanceof
SubscribeResponseDocument.SubscribeResponse))

        {

            return false;

        }

        else

        {

            return true;

        }

    }

 

My question is whether the events provider (which is sending the
notifications) supposed to send the notifications to a specific consumer
service instance?

I simply can't see anywhere in the subscribed document where a consumer
resource identifier is put in.

 

 

 

Asaf Lahav

VP R&D, Prima Grid LTD.

Cellular:  972-54-4717955

Phone:   972-3-6540255

Fax:       972-3-6540254