Asaf Lahav wrote:
> How can a notification producer invoke the Notify
operation on the
> notification consumer if the notification producer
doesn't have the
> notification consumer resource identifier?
>
>
>
>
>
> **Asaf Lahav**
>
> **VP R&D, Prima Grid LTD.**
>
> Cellular: 972-54-4717955
>
> Phone: 972-3-6540255
>
> Fax: 972-3-6540254
>
>
------------------------------------------------------------
------------
>
> *From Asaf Lahav
[mailto:asaf.lahav primagrid.com]
> *Sent Monday, May
29, 2006 6:08 PM
> *To
wsrf-user ws.apache.org; 'Campana Jr., Salvatore J'
> *Subject
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.EndpointReferenc
eType
> 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_SIMP
LE.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
>
>
>
Asaf,
Basically we receive an epr in the subscribe request which
points us at
the resource to send notifications to....
This is as per spec...
If you want to look at code, then take a look at
SubscriptionHome in the
.../v2004_06 package (too long to write
)....There you will see us
extract the EPR from the request.....
-S
------------------------------------------------------------
---------
To unsubscribe, e-mail: wsrf-user-unsubscribe ws.apache.org
For additional commands, e-mail: wsrf-user-help ws.apache.org
|