The operation you are calling is SetResourceProperties, but you are
adding a Get operation to muse.xml.  You need to add the correct "Set"
operation to muse.xml.  If you are using Axis2, you also need to add the
appropriate action to services.xml.


-----Original Message-----
From: dnguyen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 28, 2007 1:39 PM
To: [email protected]
Subject: Problem updating subscription resource property.


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/SetResource
PropertiesRequest'
through any of its capabilities.
        at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.java:279)
        at
org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClien
t.java:235)
        at
org.apache.muse.ws.resource.remote.WsResourceClient.setResourcePropertie
s(WsResourceClient.java:175)
        at
org.apache.muse.ws.resource.remote.WsResourceClient.updateResourceProper
ty(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-ur
i>
           
<java-capability-class>org.apache.muse.ws.resource.properties.get.impl.S
impleGetCapability</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(Ws
nConstants.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.-t
f3323382.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