You would need to add the WSRP Set capability (
http://docs.oasis-open.org/wsrf/rpw-2/Set), with impl class 
org.apache.muse.ws.resource.properties.set.impl.SimpleSetCapability. It 
will probably be easier if you add the WSRP SetResourceProperties 
operation to your WSDL and have wsdl2java handle all of the code/artifact 
generation. The SetResourceProperties WSDL content can be found in the 
'wsrf' sample app (see /wsdl/WsResource.wsdl).

However, no one has ever tried to switch a subscription filter 
mid-lifecycle, and so I believe a serializer for the Filter type will also 
be needed. Let me work on this for a few minutes and assuming I can fix 
the scenario, I'll write back and have you try the nightly build (you'll 
still need to add SetResourceProperties to your WSDL).

Dan



dnguyen <[EMAIL PROTECTED]> wrote on 02/28/2007 04:39:00 PM:

> 
> I am trying to update the filter in the SubscriptionClient through the
> updateResourceProperty() method but not having any success.  I get the 
error
> below:
> 
> 
> ******************************
> org.apache.muse.ws.addressing.soap.SoapFault: [ID = 
'ActionNotSupported']
> The re
> source at 'SubscriptionManager' does not expose an operation with the
> WS-Action
> 'http://docs.oasis-open.
> org/wsrf/rpw-2/SetResourceProperties/SetResourcePropertiesRequest'
> through any of its capabilities.
>         at
> 
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:279)
>         at
> 
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClient.java:235)
>         at
> org.apache.muse.ws.resource.remote.WsResourceClient.
> setResourceProperties(WsResourceClient.java:175)
>         at
> org.apache.muse.ws.resource.remote.WsResourceClient.
> updateResourceProperty(WsResourceClient.java:202)
>         at org.apache.muse.test.wsn.WsnTestClient2.main(Unknown Source)
> ************************************
> 
> 
> I then added this to the SubscriptionManager resource in the 
wsn-producer
> muse.xml file:
> 
> 
> *************************************
>         <capability>
> 
> 
<capability-uri>http://docs.oasis-open.org/wsrf/rpw-2/Get</capability-uri>
> 
> <java-capability-class>org.apache.muse.ws.resource.properties.get.impl.
> SimpleGetCapability</java-capability-class>
>         </capability>
> ************************************
> 
> 
> But I still get the same exception.  I looked in the source code for
> anything related to SetResourceProperties but didn't find anything 
helpful. 
> I read that the WS-N spec states that the impl can throw an exception in
> this case, but it also says this is allowed.  I am not sure if this is
> allowable in Muse, but the error message indicates it is possible by 
adding
> the correct capability.  Also, I am not sure I am doing this right.  The
> example I am using is below
> 
> 
> *******************************
> package org.apache.muse.test.wsn;
> 
> import javax.xml.namespace.QName;
> 
> import java.net.InetAddress;
> import java.net.URI;
> import java.net.UnknownHostException;
> 
> import org.apache.muse.ws.addressing.EndpointReference;
> import 
org.apache.muse.ws.notification.remote.NotificationProducerClient;
> import org.apache.muse.ws.notification.remote.SubscriptionClient;
> import org.apache.muse.ws.notification.impl.*;
> import org.apache.muse.ws.notification.WsnConstants;
> import org.apache.muse.util.xml.*;
> 
> 
> public class WsnTestClient2
> {
>     public static URI getLocalAddress(String contextPath, int port)
>         throws UnknownHostException
>     {
>         String ip = InetAddress.getLocalHost().getHostAddress();
> 
>         StringBuffer address = new StringBuffer();
>         address.append("http://";);
>         address.append(ip);
>         address.append(':');
>         address.append(port);
> 
>         if (contextPath.charAt(0) != '/')
>             address.append('/');
> 
>         address.append(contextPath);
> 
>         return URI.create(address.toString());
>     }
> 
>     public static void main(String[] args)
>     {
>         try
>         {
>             //
>             // change these to point to different applications/servers
>             //
>             String webAppRoot = "/isr-producer/services";
>             int producer_port =
> Integer.parseInt(System.getProperty("producer_port","8080"));
>             int consumer_port =
> Integer.parseInt(System.getProperty("consumer_port","8080"));
> 
>             //
>             // create producer EPR/client, and use it to subscribe
>             // the consumer to all messages
>             //
> 
>             String contextPath = webAppRoot + "/IsrResource";
>             URI address = (args.length == 0) ? 
getLocalAddress(contextPath,
> producer_port) : URI.create(args[0] + contextPath);
>             EndpointReference epr = new EndpointReference(address);
> 
>             webAppRoot = "/isr-consumer/services";
>             contextPath = webAppRoot + "/IsrConsumer";
>             address = getLocalAddress(contextPath, consumer_port);
>             EndpointReference consumer = new EndpointReference(address);
> 
>             //
>             // null filter == send all messages to consumer
>             //
>             NotificationProducerClient producer = new
> NotificationProducerClient(epr);
>             producer.setTrace(true);
> 
>             SubscriptionClient subscription = null;
> 
>             while( true )
>             {
>                 System.out.println( "s - subscribe, u - unsubscribe, v -
> view, q - quit" );
> 
>                 char choice = (char)System.in.read();
> 
>                 if( choice == 's' )
>                 {
>                     subscription = producer.subscribe(consumer, null, 
null);
>                 }
>                 else if( choice == 'u' )
>                 {
>                     subscription.destroy();
>                 }
>                 else if( choice == 'v' )
>                 {
> 
> System.out.println(XmlUtils.toString(subscription.
> getResourceProperty(WsnConstants.FILTER_QNAME)[0]));
>                 }
>                 else if( choice == 'f' )
>                 {
>                     QName messageName = new
> QName("http://ws.apache.org/muse/test/wsrf";, "MyTopic", "tns");
> 
> subscription.updateResourceProperty(WsnConstants.FILTER_QNAME, new 
Object[]
> { new TopicFilter(messageName) });
>                 }
>                 else if( choice == 'q' )
>                 {
>                     break;
>                 }
>             }
>         }
> 
>         catch (Throwable error)
>         {
>             error.printStackTrace();
>         }
>     }
> }
> 
> -- 
> View this message in context: http://www.nabble.com/Problem-updating-
> subscription-resource-property.-tf3323382.html#a9239032
> Sent from the Muse User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to