I'm still trying to sort out ServiceMix support for WS-Notification.  We have
a use case that requires remote service consumers to be intermittently
disconnected from the network.  This requires that we implement a pull-style
notification pattern to publish updates for the clients.  It seems that
ServiceMix has the components in place to support this, but I haven't been
able to put together a proof of concept to demonstrate that it works.  I
don't mind trudging forward, but I guess I should first confirm that the
ServiceMix WS-Notification implementation can support my use case.  Any
feedback is much appreciated.



KBerthelot wrote:
> 
> I'm trying to prototype a WS-Notification client that uses a pull style
> notification.  What I've done so far is to add another http:endpoint for
> the CreatePullPoint service to xbean.xml in the wsn-http-binding example
> so that it looks like:
> 
> <?xml version="1.0"?>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0";
>        xmlns:wsn="http://servicemix.org/wsnotification";>
> 
>   <http:endpoint service="wsn:NotificationBroker"
>                  endpoint="http-binding"
>                  targetService="wsn:NotificationBroker"
>                  targetEndpoint="Broker"
>                  role="consumer"
>                  locationURI="http://localhost:8192/Broker/";
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"; 
>                  soap="true"/>
>   
>   <http:endpoint service="wsn:CreatePullPoint"
>                  endpoint="http-binding2"
>                  targetService="wsn:CreatePullPoint"
>                  targetEndpoint="Broker"
>                  role="consumer"
>                  locationURI="http://localhost:8192/CreatePullPoint/";
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"; 
>                  soap="true"/>
> </beans>
> 
> 
> I can then get the wsdl for CreatePullPoint using
> http://localhost:8192/CreatePullPoint/main.wsdl which returns:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://servicemix.org/wsnotification";
> xmlns:tns="http://servicemix.org/wsnotification";
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:wsa="http://www.w3.org/2005/08/addressing";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2";
> xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2";
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:wsn-bw="http://docs.oasis-open.org/wsn/bw-2";
> xmlns:wsn-brw="http://docs.oasis-open.org/wsn/brw-2";
> xmlns:wsn-b="http://docs.oasis-open.org/wsn/b-2";
> xmlns:tnspt="http://docs.oasis-open.org/wsn/bw-2";
> xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2";
> xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2";
> xmlns:wsn-br="http://docs.oasis-open.org/wsn/br-2";
> xmlns="http://schemas.xmlsoap.org/wsdl/";>
>   <wsdl:import namespace="http://docs.oasis-open.org/wsn/bw-2";
> location="porttypedef.wsdl"/>
>   <wsdl:binding name="http-binding2Binding" type="wsntw:CreatePullPoint">
>     <wsdlsoap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>     <wsdl:operation name="CreatePullPoint">
>       <wsdlsoap:operation soapAction=""/>
>       <wsdl:input name="CreatePullPointRequest">
>         <wsdlsoap:body use="literal"/>
>       </wsdl:input>
> 
>       <wsdl:output name="CreatePullPointResponse">
>         <wsdlsoap:body use="literal"/>
>       </wsdl:output>
>       <wsdl:fault name="UnableToCreatePullPointFault">
>         <wsdlsoap:fault name="UnableToCreatePullPointFault"
> use="literal"/>
>       </wsdl:fault>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:service name="CreatePullPoint">
> 
>     <wsdl:port name="http-binding2" binding="tns:http-binding2Binding">
>       <wsdlsoap:address
> location="http://localhost:8192/CreatePullPoint/"/>
>     </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
> 
> 
> 
> When I invoke the CreatePullPoint operation using this wsdl, I get this
> exception:
> 
> java.lang.RuntimeException: Could not create PullEndpoint
>         at
> org.apache.servicemix.wsn.jms.JmsPullPoint.<init>(JmsPullPoint.java:58)
>         at
> org.apache.servicemix.wsn.jms.JmsCreatePullPoint.createPullPoint(JmsCreatePullPoint.java:43)
>         at
> org.apache.servicemix.wsn.AbstractCreatePullPoint.handleCreatePullPoint(AbstractCreatePullPoint.java:78)
>         at
> org.apache.servicemix.wsn.AbstractCreatePullPoint.createPullPoint(AbstractCreatePullPoint.java:70)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at
> org.apache.servicemix.wsn.component.WSNEndpoint.process(WSNEndpoint.java:136)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:397)
>         at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:42)
>         at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:619)
>         at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:168)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:175)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:226)
>         at
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:291)
>         at
> EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown Source)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.xml.bind.JAXBException
>  - with linked exception:
> [java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]
>         at
> javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:195)
>         at javax.xml.bind.ContextFinder.find(ContextFinder.java:381)
>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:561)
>         at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:508)
>         at
> org.apache.servicemix.wsn.jms.JmsPullPoint.<init>(JmsPullPoint.java:56)
> 
> 
> It looks like the required Jaxb jars are in the classpath (as configured
> in the wsn-http-binding example), so I'm confused as to why the
> classloader can't find this class.
> 

-- 
View this message in context: 
http://www.nabble.com/Creating-PullPoints-using-WS-Notificatino-tf2154620.html#a6041352
Sent from the ServiceMix - User forum at Nabble.com.

Reply via email to