The WsnTestClient should not be necessary in your real world scenario - it's just a driver to get the sample going. In your situation, you can just have the consumer resource subscribe to the producer itself - the code to do that would be very similar to what's in WsnTestClient (the use of NotificationProducerClient), but you would package it in your consumer resource instead of a command line app. You could perform the subscription work in the initialize() method of one of your capabilities on the consumer side.
Alternatively, in a more complex scenario, you might have an "orchestrator" service that is subscribing all of the consumers to the events they need to handle. This scenario would be a lot like the sample in that a third service would call subscribe() and tell the producer which consumer resource to send the messages to. This is just like the WsnTestClient app, except it would probably be a web service as well. If you want to forward messages received by one consumer to another consumer(s), like a broker would, you just have to use the NotificationMessageListener API - you can implement a listener that listens for all notifications and then uses NotificationConsumerClient to forward the messages to other resources. Dan "Callner, David A." <[EMAIL PROTECTED]> wrote on 02/13/2007 09:36:37 AM: > Ok thanks. Let's say for instance that I have two different types of > clients. One type of clients that are within the same firewall as my > web server and are on the same network. The other is a client that is > outside the firewall and not on the same network. I can see that the > later would need a consumer web service running and the incoming > requests would have to be forwarded to the user of the consumer web > service. > > First question, when I use the API's to create the subscription between > the publisher and consumer are there methods I can call that would > subscribe from the consumer to the (WsnTestClient) a forwarded message > or is this something I have to do manually i.e create a socket from the > consumer to the WsnTestClient or is this already built into MUSE/AXIS? > > > Second question, when I am within the same network is there a way for > me to set up a publisher/consumer without creating a consumer web > service or is this not what is intended with MUSE and I would still > need a consumer web server and some mechanism to forward messages from > the consumer web service to the (WsnTestClient). > > Thanks again for all your answers and help!! > > > -----Original Message----- > From: Vinh Nguyen (vinguye2) [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 07, 2007 1:04 PM > To: [email protected] > Subject: RE: wsn-producer/consumer example > > Each resource must be a web service resource with a URI address that > identifies its location. So your consumer cannot be a java program > sitting outside of a webserver environment. What you can do is have a > consumer resource which routes calls to your java program. > > > -----Original Message----- > From: Callner, David A. [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 07, 2007 7:21 AM > To: [email protected] > Subject: RE: wsn-producer/consumer example > > Makes sense. I would like to set up a publisher / consumer service > were > the publish is a web service and the consumer is java program (no > web server running). Is this possible? > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 07, 2007 10:17 AM > To: [email protected] > Subject: RE: wsn-producer/consumer example > > I'm not really sure, if I understand your initial question, so I'll try > to explain it based on the assumption, that it's unclear why you need > to > deploy 2 servlets to make the sample work. > > > For the producer/consumer example, they're mimicking a service > (producer) on a separate machine, which will inform the client machine > (consumer) about changes in its state via a WSDM SOAP message. > The WsnTestClient-file is just setting up the subscription between the > producer/consumer via the SubscriptionManager. > The actual consumer is the ConsumerCapability/ConsumerCapabilityImpl. > > As for the error you're getting, I'm not sure if you deployed both the > producer/consumer wars given the earlier assumption I made. But it > seems > that your WsnTestClient is trying to subscribe to your producer service > and getting denied as the service is not available at the specified > location (according to the WsnTestClient.java property and the involved > WSDL-files). > > I don't have a clue yet about the error from you Tomcat log files. > > > Not really sure if this made any sense. > > -----Original Message----- > From: Callner, David A. [mailto:[EMAIL PROTECTED] > Sent: 07 February 2007 13:43 > To: [email protected] > Subject: RE: wsn-producer/consumer example > > I'm using the official release and have performed step 2 and here are > the errors I'm getting. Also could someone explain to me why I need to > run to web servlets (Wsn-Producer) and (Wsn-Consumer). The > WsnTestClient should be the "Consumer". > > In my tomcat5 log file: > > 2007-02-07 08:34:31 StandardWrapperValve[ApacheMuseServlet]: > Servlet.service() for servlet ApacheMuseServlet threw exception > java.lang.NoSuchMethodError: javax.xml.namespace.QName: method > <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V not > found > at > org.apache.muse.ws.addressing.soap.SoapConstants.<clinit>(SoapConstants > .java:46) > at > org.apache.muse.ws.addressing.soap.SoapFault.<init>(SoapFault.java:40) > at > org.apache.muse.ws.addressing.soap.SoapUtils.convertToFault(SoapUtils.j > ava:32) > at > org.apache.muse.core.platform.AbstractIsolationLayer.initialize(Abstrac > tIsolationLayer.java:183) > at > org.apache.muse.core.platform.mini.MiniServlet.createIsolationLayer(Min > iServlet.java:36) > at > org.apache.muse.core.platform.mini.MiniServlet.doPost(MiniServlet.java: > 50) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic > ationFilterChain.java:237) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil > terChain.java:157) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal > ve.java:214) > at > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC > ontext.java:104) > at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: > 520) > at > org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCo > ntextValve.java:198) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal > ve.java:152) > at > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC > ontext.java:104) > at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: > 520) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav > a:137) > at > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC > ontext.java:104) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav > a:118) > at > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC > ontext.java:102) > at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: > 520) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve > .java:109) > at > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC > ontext.java:104) > at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: > 520) > at > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) > at > org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:7 > 99) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process > Connection(Http11Protocol.java:705) > at > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:5 > 77) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPoo > l.java:683) > at java.lang.Thread.run(Thread.java:570) > > > Output from WsnTestClient: > > CLIENT TRACE] SOAP envelope contents (outgoing): > > <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> > <soap:Header> > <wsa:To > xmlns:wsa="http://www.w3.org/2005/08/addressing">http://128.29.35.11:80 > 80/wsn-producer/services/WsResource</wsa:To> > <wsa:Action > xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open > .org/wsn/bw-2/NotificationProducer/SubscribeRequest</wsa:Action> > <wsa:MessageID > xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:1c80b0af-b583-736 > f-066b-ff60b581802c</wsa:MessageID> > <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing"> > > <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:A > ddress> > </wsa:From> > </soap:Header> > <soap:Body> > <wsnt:Subscribe > xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"> > <wsnt:ConsumerReference> > <wsa:Address > xmlns:wsa="http://www.w3.org/2005/08/addressing">http://128.29.35.11:80 > 80/wsn-consumer/services/consumer</wsa:Address> > </wsnt:ConsumerReference> > </wsnt:Subscribe> > </soap:Body> > </soap:Envelope> > > org.apache.muse.ws.addressing.soap.SoapFault: Server returned HTTP > response code: 500 for URL: > http://128.29.35.11:8080/wsn-producer/services/WsResource > at > org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClie > nt.java:279) > at > org.apache.muse.core.AbstractResourceClient.invoke(AbstractResourceClie > nt.java:235) > at > org.apache.muse.ws.notification.remote.NotificationProducerClient.subsc > ribe(NotificationProducerClient.java:96) > at org.apache.muse.test.wsn.WsnTestClient.main(Unknown Source) > > -----Original Message----- > From: Rosberg Mattias [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 06, 2007 4:14 AM > To: [email protected] > Subject: RE: wsn-producer/consumer example > > Thank you for your support. I downloaded the nightly build and ran > update_install.bat. The wsn-producer/consumer example worked at once. > > /Mattias > > > -----Original Message----- > From: Daniel Jemiolo [mailto:[EMAIL PROTECTED] > Sent: Mon 2/5/2007 3:18 PM > To: [email protected] > Subject: RE: wsn-producer/consumer example > > Good catch on the port number - make sure the port you're using for > Tomcat uses the one that's specified in the WsnTestClient.java client. > The port is part of the wsa:Address in the producer and consumer EPRs, > so if it's wrong, you need to change it (you can do this on the command > line or by > > modifying the test client code). > > I'd also advise against building the source and trying to add the > latest > bits incrementally - if you want to do a full build, follow the > instructions on: > > http://ws.apache.org/muse/source-code.html > > If you want the latest nightly build, you can get it here: > > http://ws.apache.org/muse/nightly/latest > > Of course, except for the "step 2" that was added, neither of those > samples has changed in quite a while. You should be able to get them > working by taking the official release and performing step 2 - let me > know if the port number issue was indeed the problem. > > Dan > > > > <[EMAIL PROTECTED]> wrote on 02/05/2007 08:48:58 AM: > > > I'm not sure why you would want to make the whole thing that > > complicated. > > I seem to have no problem getting the producer/consumer example to > work > > with these simple steps. > > > > 1) Download the nightly build (with the latest bug fixes) from > > http://ws.apache.org/muse/nightly/latest/bin/ > > > > 2) Run update-install > > > > 3) Double-check the WsResourcePort in the WsResource.wsdl > (wsn-producer) > > and the WsnTestClient portType properties (producer_port & > > consumer_port) are pointing to the right serviceport (according to > your > > Tomcat specs). > > > > 4) Use the ant build file to build both project-wars > > > > 5) Deploy and enjoy > > > > But that said did you have a look in the wsn-consumer > WsnTestClient.java > > and the wsn-producer WsREsource.wsdl to see if the portTypes match > your > > Tomcat setup? To me it sounds like it's looking for a consumer that's > > > not listening on the given port. I could be wrong. > > > > I know the portTypes have been a cause of some of my problems in the > > past. > > > > /Lenni > > > > -----Original Message----- > > From: Rosberg Mattias [mailto:[EMAIL PROTECTED] > > Sent: 05 February 2007 12:59 > > To: [email protected] > > Subject: RE: wsn-producer/consumer example > > > > If you follow the instructions for "Eclipse Development" described > here > > > > http://ws.apache.org/muse/source-code.html > > > > you get a separate project in Eclipse for every muse jar-file. You > can > > then export each project as a jar-file and replace the ones found in > > your MUSE_HOME/modules subdirectories. This way you get the latest > > bugfixes and updates. > > > > -----Original Message----- > > From: Callner, David A. [mailto:[EMAIL PROTECTED] > > Sent: Mon 2/5/2007 1:45 PM > > To: [email protected] > > Subject: RE: wsn-producer/consumer example > > > > You seemed to get farther than I did with the example. I been able > to > > find on the internet that you need to add (#2) below, but your #3. > > Created new snapshot from SVN. Could you explain? > > > > -----Original Message----- > > From: Rosberg Mattias [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 05, 2007 2:40 AM > > To: [email protected] > > Subject: wsn-producer/consumer example > > > > I have tried to get the wsn-producer/consumer sample to work without > > success. I have done the following: > > > > 1. Downloaded 2.1.0 distribution and ran update_install. > > > > 2. Added row <resource-type use-router-persistence="true"> in > > wsn-consumer muse.xml > > > > 3. Created new muse.xxx-snapshot-2.2.0.jars from SVN. Replaced old > > (2.1.0) jars in modules folders with snapshot 2.2.0 jars. > > > > 4. Rebuild wars for wsn-consumer and wsn-producer. > > > > 5. Deploy wars on Tomcat without any error messages. Run > WsnTestClient > > > > I still get the following error: > > > > INFO: [ID = 'LastPublishFailed'] The last notification published via > > wsnt:Notify failed to reach its destination. The consumer may be > > unavailable. > The > > original > > error was: null > > 2007-feb-05 08:17:37 org.apache.ws.muse.test.wsrf.MyCapabilityImpl$1 > > run > > INFO: Waiting 10 seconds before sending message... > > > > Any ideas? > > > > /Mattias > > > > > > --------------------------------------------------------------------- > > 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] > > > > > --------------------------------------------------------------------- > 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] > > > --------------------------------------------------------------------- > 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] > > --------------------------------------------------------------------- > 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] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
