play-project / play

The main repository, used for website and issues
2 stars 0 forks source link

Add subscription ID to event cloud WSN API #34

Open chamerling opened 11 years ago

chamerling commented 11 years ago

@lpellegr looks like the event cloud does not return a subscription ID as response of the subscribe request. If yes, maybe the format is wrong since the governance is not able to get it. Can you check the response? Thanks

lpellegr commented 11 years ago

A response is returned and looks like the following:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
            <ns2:SubscribeResponse xmlns="http://www.w3.org/2005/08/addressing"
                xmlns:ns2="http://docs.oasis-open.org/wsn/b-2" xmlns:ns3="http://docs.oasis-open.org/wsrf/bf-2"
                xmlns:ns4="http://docs.oasis-open.org/wsrf/rp-2" xmlns:ns5="http://docs.oasis-open.org/wsn/t-1"
                xmlns:ns6="http://docs.oasis-open.org/wsn/br-2" xmlns:ns7="http://docs.oasis-open.org/wsrf/r-2">
                <ns2:SubscriptionReference>
                    <Address>http://46.105.181.221:8084/petals/services/NotificationConsumerPortService</Address>
                    <ReferenceParameters />
                </ns2:SubscriptionReference>
                <ns2:TerminationTime xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:nil="true" />
                <ns8:SubscriptionId xmlns:ns8="http://evencloud.inria.fr">E6B9E37AE7E94CB2AC6F5D70950C9F25</ns8:SubscriptionId>
            </ns2:SubscribeResponse>
        </soap:Body>
    </soap:Envelope>

Do you see something which is wrong or missing? Could you provide an example of a valid SubscribeResponse?

chamerling commented 11 years ago

Got this one which is different from yours:

<?xml version="1.0" encoding="UTF-8"?>
<wsnt:SubscribeResponse xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
    <wsnt:SubscriptionReference>
        <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">http://dsb.petalslink.com/notification/::Service@Enpoint</wsa:Address>
        <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing">
            <rpimpl:SubscriptionId
                xmlns:rpimpl="http://www.ebmwebsourcing.com/wsstar/wsnb/ws-resource">123456789</rpimpl:SubscriptionId>
        </wsa:ReferenceParameters>
    </wsnt:SubscriptionReference>
    <wsnt:CurrentTime>2012-02-01T14:44:55.593+01:00</wsnt:CurrentTime>
    <wsnt:TerminationTime xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:nil="true" />
</wsnt:SubscribeResponse>

Even if I am not really agree to use the ebm NS, let's say we should use it...

You should be able to retrieve ID from : org.petalslink.dsb.notification.commons.NotificationHelper.getSubscriptionID(SubscribeResponse)

lpellegr commented 11 years ago

The SubscriptionId element is not part of the spec. We will try to update our payload according to the example you provided.

lpellegr commented 11 years ago

Could you please give an example of an UnsubscribeRequest and UnsubscribeResponse?

lpellegr commented 11 years ago

@chamerling It should be fixed with the current version of the Eventcloud that is deployed. Please check and close the issue if it is resolved.