I'm using org.springframework.ws.client.core.WebServiceTemplate to subscribe
/ unsubscribe to servicemix-wsn2005 like this:

String subMessage = "<wsnt:Subscribe\n" +
  "      xmlns:wsnt=\"http://docs.oasis-open.org/wsn/b-2\"\n"; +
  "      xmlns:wsa=\"http://www.w3.org/2005/08/addressing\";>\n" +
  "      <wsnt:ConsumerReference>\n" +
  "        <wsa:Address>\n" +
  "          endpoint:http://test/MyS1PojoService/myS1PojoSu"; +
  "        </wsa:Address>\n" +
  "      </wsnt:ConsumerReference>\n" +
  "      <wsnt:Filter>\n" +
  "        <wsnt:TopicExpression
Dialect=\"http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple\";>"
 + "my topic +
  "</wsnt:TopicExpression>\n" +
  "      </wsnt:Filter>\n" +
  "    </wsnt:Subscribe>";
webServiceTemplate.setDefaultUri(http://localhost:8192/Broker/);
StreamSource source = new StreamSource(new StringReader(message));
StringResult result = new StringResult();
webServiceTemplate.sendSourceAndReceiveToResult(source, result);

It works fine, I got <SubscribeResponse> back and can retrieve endpoint
information as:
<ns4:SubscriptionReference><ns2:Address>http://servicemix.org/wsnotification/Subscription/ID-JWANG-4103-1238249208692-3-11
</ns2:Address></ns4:SubscriptionReference>

then I change URI and message to unsubscribe, but got 404 back.

webServiceTemplate.setDefaultUri(http://localhost:8192/ID-JWANG-4103-1238249208692-3-11);
String unsubMessage =    "<wsnt:Unsubscribe\n" +
        "      xmlns:wsnt=\"http://docs.oasis-open.org/wsn/b-2\";>\n" +
        "   </wsnt:Unsubscribe>";
source = new StreamSource(new StringReader(unsubMessage));
webServiceTemplate.sendSourceAndReceiveToResult(source, result);

Can you help?  thanks a lot



gnodet wrote:
> 
> I think the unsubscribe request corresponding to the scenario would be:
> 
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/";
>       xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2";
>       xmlns:wsa="http://www.w3.org/2005/08/addressing";>
>       <env:Header>
>               <wsa:To>
>               
> http://servicemix.org/wsnotification/Subscription/ID-some-host-38972-1188922931357-3-1
>               </wsa:To>
>       </env:Header>
>       <env:Body>
>               <wsnt:Unsubscribe />
>       </env:Body>
> </env:Envelope>
> 
> Note that the wsa:To content comes from the SubscribeResponse.
> 
> On Fri, Sep 12, 2008 at 6:37 PM, kai0411 <[email protected]>
> wrote:
>>
>> It was given a message format to 'subscribe' an endpoint for a topic in
>> http://servicemix.apache.org/example-scenario.html.
>> What is the format to 'un-subscribe' an endpoint?
>> I tried tags <Unsubscribe> and <unSubscribe>, but got 'HTTP 500' error.
>>
>>
>>
>> gnodet wrote:
>>>
>>> This is the default behaviour if you don't use a PulPoint.  When you
>>> register a subscription, you give the address of the JBI endpoint in
>>> the request so that the broker can send you notifications on the
>>> specified topic.
>>>
>>> On Thu, Sep 4, 2008 at 6:36 PM, kai0411 <[email protected]>
>>> wrote:
>>>>
>>>> there is example in http://servicemix.apache.org/example-scenario.html
>>>> for a
>>>> 'Pull' notification. Users have to 'pull' their notification from the
>>>> Broker.
>>>> How to implement a 'Push' notification, ie. when WSN2005 gets a
>>>> notification, it would 'push' the notification to a service engine?
>>>>
>>>> thanks for help
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Servicemix-wsn2005-tp19314625p19314625.html
>>>> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Servicemix-wsn2005-tp19314625p19459687.html
>> Sent from the ServiceMix - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Servicemix-wsn2005-tp19314625p22759481.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.

Reply via email to