Whoops! Sorry about that...I copied the wrong thing from the muse.xml file.
I did use the Get capability, which is what the original post should have
had. That did not work for me. It looked like this:
*********************************************
<resource-type>
<context-path>SubscriptionManager</context-path>
<wsdl>
<wsdl-file>wsdl/WS-BaseNotification-1_3.wsdl</wsdl-file>
<wsdl-port-type>wsntw:SubscriptionManager</wsdl-port-type>
</wsdl>
<java-id-factory-class>org.apache.muse.core.routing.CounterResourceIdFactory</java-id-factory-class>
<java-resource-class>org.apache.muse.ws.resource.impl.SimpleWsResource</java-resource-class>
<capability>
<capability-uri>http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata</capability-uri>
<java-capability-class>org.apache.muse.ws.metadata.impl.SimpleMetadataExchange</java-capability-class>
</capability>
<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>
<capability>
<capability-uri>http://docs.oasis-open.org/wsrf/rpw-2/Set</capability-uri>
<java-capability-class>org.apache.muse.ws.resource.properties.set.impl.SimpleSetCapability</java-capability-class>
</capability>
<capability>
<capability-uri>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager</capability-uri>
<java-capability-class>org.apache.muse.ws.notification.impl.SimpleSubscriptionManager</java-capability-class>
<init-param>
<param-name>trace-notifications</param-name>
<param-value>true</param-value>
</init-param>
</capability>
<capability>
<capability-uri>http://docs.oasis-open.org/wsrf/rlw-2/ImmediateResourceTermination</capability-uri>
<java-capability-class>org.apache.muse.ws.resource.lifetime.impl.SimpleImmediateTermination</java-capability-class>
</capability>
<capability>
<capability-uri>http://docs.oasis-open.org/wsrf/rlw-2/ScheduledResourceTermination</capability-uri>
<java-capability-class>org.apache.muse.ws.resource.lifetime.impl.SimpleScheduledTermination</java-capability-class>
</capability>
<init-param>
<param-name>validate-wsrp-schema</param-name>
<param-value>false</param-value>
</init-param>
</resource-type>
************************************************
Vinh Nguyen (vinguye2) wrote:
>
> 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]
>
>
>
--
View this message in context:
http://www.nabble.com/Problem-updating-subscription-resource-property.-tf3323382.html#a9239571
Sent from the Muse User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]