Re: Using CXF in OSGi
Hi Fabian, We use CXF in a bundle with equinox. We just put the CXF jars in a bundle and exported the packages from there. It works like a charm. Just be sure to export/import javax.xml.ws and similar packages or CXF won't detect the annotations (e.g. the ones for jax-ws) Regards Mayank [EMAIL PROTECTED] wrote: Hello! Are there already some working bundles of CXF for OSGi? I found a solved bug (CXF-490) on JIRA which says this is done. Does anyone have some advice on how to use it? Maybe examples? Best regards, Fabian
RE: CXF Osgi bundle problem
When I had tried initially, I got the same error and decided to try a different eclipse package. Changing to Eclipse for RCP/Plug-in Developers worked for me! (I use equinox) Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! -Original Message- From: glebreton [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 23:41 To: cxf-user@incubator.apache.org Subject: CXF Osgi bundle problem Hi, I have some problems for integrating CXF and OSGI. I use Felix for OSGI and this Exception is raised : javax.xml.ws.WebServiceException: Provider com.sun.xml.ws.spi.ProviderImpl not found This exception happend with the following code : fr.cxf.osgi.test.HelloWorld : package fr.cxf.osgi.test; import javax.jws.WebService; @WebService public interface HelloWorld { String sayHi(String text); } fr.cxf.osgi.test.HelloWorldImpl : package fr.cxf.osgi.test; import javax.jws.WebService; @WebService(endpointInterface = fr.cxf.osgi.test.HelloWorld) public class HelloWorldImpl implements HelloWorld { public String sayHi(String text) { return Hello + text; } } fr.cxf.osgi.test.Activator : package fr.cxf.osgi.test; import javax.xml.ws.Endpoint; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; public class Activator implements BundleActivator { public void start(BundleContext arg0) throws Exception { HelloWorldImpl hwi = new HelloWorldImpl(); Endpoint.publish(http://localhost:9000/HelloWorld;, hwi); } public void stop(BundleContext arg0) throws Exception { } } MANIFEST.MF : Manifest-Version: 2.0 Bundle-Name: TestCxfOsgi Bundle-Version: 0.1 Import-Package: org.osgi.framework Bundle-Activator: fr.cxf.osgi.test.Activator Bundle-Classpath: ., libs/aopalliance-1.0.jar, libs/commons-logging-1.1.jar, libs/cxf-2.0.1-incubator.jar, libs/geronimo-activation_1.1_spec-1.0-M1.jar, libs/geronimo-annotation_1.0_spec-1.1.jar, libs/geronimo-javamail_1.4_spec-1.0-M1.jar, libs/geronimo-servlet_2.5_spec-1.1-M1.jar, libs/geronimo-ws-metadata_2.0_spec-1.1.1.jar, libs/jaxb-api-2.0.jar, libs/jaxb-impl-2.0.5.jar, libs/jaxws-api-2.0.jar, libs/jaxws-api.jar, libs/jaxws-rt.jar, libs/neethi-2.0.jar, libs/saaj-api-1.3.jar, libs/saaj-impl-1.3.jar, libs/stax-api-1.0.1.jar, libs/wsdl4j-1.6.1.jar, libs/wstx-asl-3.2.1.jar, libs/xml-resolver-1.2.jar, libs/XmlSchema-1.2.jar I also tried to convert cxf and its dependencies as bundles and to put all the libs in one bundle but it does not change anything. And tested with JRE 5 6. Thank you and sorry for my english :/ -- View this message in context: http://www.nabble.com/CXF---Osgi-bundle-problem-tp15880268p15880268.html Sent from the cxf-user mailing list archive at Nabble.com.
message context is null
Hi, I inject the context into my service impl like this: @Resource private WebServiceContext context; The context is available during invocation, but when I do: MessageContext messageContext = context.getMessageContext(); The messageContext comes up null in Solaris. In Windows it comes fine. What am I doing wrong? Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
RE: message context is null
Found the panga. Seems my custom invoker was eating up the context. Works like a charm after removing the custom invoker. Regards Mayank -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 12, 2008 14:04 To: cxf-user@incubator.apache.org Subject: message context is null Hi, I inject the context into my service impl like this: @Resource private WebServiceContext context; The context is available during invocation, but when I do: MessageContext messageContext = context.getMessageContext(); The messageContext comes up null in Solaris. In Windows it comes fine. What am I doing wrong? Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
Re: Using CXF with an Eclipse RCP Application
if your cxf libs and service sei/impl are in separate bundles then you need to import some non-cxf namespaces also in your service sei/impl bundles. just check the imports used by your sei, those should be imported by your manifest... for e.x. you would need javax.jws, javax.jms, javax.xml.ws, etc. there aren't many... i'll try to send a list On Feb 9, 2008 3:30 AM, Kyle.Bober [EMAIL PROTECTED] wrote: I created a CXF OSGi bundle using the Eclipse Plug-in form Existing JAR archive wizard. I used the latest SNAPSHOT CXF JAR: cxf-2.1-incubator-SNAPSHOT.jar I then added the org.apache.cxf package to the import-packages of my manifest.mf When I try to call my web services from my RCP application I receive the following error: !ENTRY org.eclipse.osgi 4 0 2008-02-08 16:53:50.999 !MESSAGE Application error !STACK 1 javax.xml.ws.WebServiceException: Provider com.sun.xml.ws.spi.ProviderImpl not found at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:38) at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:133) at javax.xml.ws.spi.Provider.provider(Provider.java:83) at javax.xml.ws.Service.init(Service.java:56) at javax.xml.ws.Service.create(Service.java:691) at cxf_client_test.Application.cxf(Application.java:22) at cxf_client_test.Application.start(Application.java:34) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) 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:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447) at org.eclipse.equinox.launcher.Main.run(Main.java:1173) at org.eclipse.equinox.launcher.Main.main(Main.java:1148) Caused by: java.lang.ClassNotFoundException: com.sun.xml.ws.spi.ProviderImpl at java.lang.ClassLoader.findClass(ClassLoader.java:358) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:124) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:34) ... 19 more My understanding is that it should be calling the ProviderImpl provided by CXF. Has anyone had any luck calling Web Services via an Eclikpse RCP application??? If so any advice or help here would be much appreciated!!! -- View this message in context: http://www.nabble.com/Using-CXF-with-an-Eclipse-RCP-Application-tp15364789p15364789.html Sent from the cxf-user mailing list archive at Nabble.com.
RE: Using CXF with an Eclipse RCP Application
These might be enough: javax.annotation javax.jws javax.jws.soap javax.wsdl javax.wsdl.extensions javax.wsdl.extensions.http javax.wsdl.extensions.mime javax.wsdl.extensions.schema javax.wsdl.extensions.soap javax.wsdl.extensions.soap12 javax.wsdl.factory javax.wsdl.xml javax.xml.bind javax.xml.bind.annotation javax.xml.stream javax.xml.ws javax.xml.ws.handler javax.xml.namespace Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: Saturday, February 09, 2008 08:55 To: cxf-user@incubator.apache.org Subject: Re: Using CXF with an Eclipse RCP Application if your cxf libs and service sei/impl are in separate bundles then you need to import some non-cxf namespaces also in your service sei/impl bundles. just check the imports used by your sei, those should be imported by your manifest... for e.x. you would need javax.jws, javax.jms, javax.xml.ws, etc. there aren't many... i'll try to send a list On Feb 9, 2008 3:30 AM, Kyle.Bober [EMAIL PROTECTED] wrote: I created a CXF OSGi bundle using the Eclipse Plug-in form Existing JAR archive wizard. I used the latest SNAPSHOT CXF JAR: cxf-2.1-incubator-SNAPSHOT.jar I then added the org.apache.cxf package to the import-packages of my manifest.mf When I try to call my web services from my RCP application I receive the following error: !ENTRY org.eclipse.osgi 4 0 2008-02-08 16:53:50.999 !MESSAGE Application error !STACK 1 javax.xml.ws.WebServiceException: Provider com.sun.xml.ws.spi.ProviderImpl not found at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:38) at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:133) at javax.xml.ws.spi.Provider.provider(Provider.java:83) at javax.xml.ws.Service.init(Service.java:56) at javax.xml.ws.Service.create(Service.java:691) at cxf_client_test.Application.cxf(Application.java:22) at cxf_client_test.Application.start(Application.java:34) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java: 169) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication( EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAp pLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) 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:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447) at org.eclipse.equinox.launcher.Main.run(Main.java:1173) at org.eclipse.equinox.launcher.Main.main(Main.java:1148) Caused by: java.lang.ClassNotFoundException: com.sun.xml.ws.spi.ProviderImpl at java.lang.ClassLoader.findClass(ClassLoader.java:358) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFin der.java:124) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:34) ... 19 more My understanding is that it should be calling the ProviderImpl provided by CXF. Has anyone had any luck calling Web Services via an Eclikpse RCP application??? If so any advice or help here would be much appreciated!!! -- View this message in context: http://www.nabble.com/Using-CXF-with-an-Eclipse-RCP-Application-tp15364789p1 5364789.html Sent from the cxf-user mailing list archive at Nabble.com.
JMS connect exception, but service published
Hi, When publishing a web service on jms transport, if activemq is not running, an exception log is printed but the service creation is still successful. I checked service got created using this code: Endpoint impl = Endpoint.publish(url, object); if ((impl != null) impl.isPublished()) { // success } How to check that there has been a problem with the service creation in this case? And this is the exception trace: Feb 6, 2008 9:32:52 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL INFO: Creating Service {tmf854.v1.ws}FaultService from WSDL: wsdl/mtosi1.1/wsdl/services/FaultService.wsdl Feb 6, 2008 9:32:53 AM org.apache.cxf.endpoint.ServerImpl initDestination INFO: Setting the server's publish address to be jms://AlarmRetrieval Feb 6, 2008 9:32:53 AM org.apache.cxf.transport.jms.JMSDestination activate INFO: JMSServerTransport activate() Feb 6, 2008 9:32:54 AM org.apache.cxf.transport.jms.JMSDestination activate SEVERE: JMS connect failed with JMSException : javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused: connect at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java :33) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(Activ eMQConnectionFactory.java:280) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(Activ eMQConnectionFactory.java:214) at org.apache.activemq.ActiveMQConnectionFactory.createTopicConnection(ActiveMQ ConnectionFactory.java:191) at org.apache.cxf.transport.jms.JMSProviderHub.connect(JMSProviderHub.java:91) at org.apache.cxf.transport.jms.JMSDestination.activate(JMSDestination.java:109 ) at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObser vable.java:47) at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFac tory.java:166) at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactor y.java:616) at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:122) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:232) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179) at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl. java:74) at javax.xml.ws.Endpoint.publish(Endpoint.java:156) Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:335 ) at org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:303 ) at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:49) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:54) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:54) at org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiato r.java:66) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:54) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:54) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(Activ eMQConnectionFactory.java:265) ... 33 more Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
Re: Leaving CXF for Glasshfish Metro
I found some great cxf related documentation at this page when checking request context recently: http://open.iona.com/docs/framework/2.0/jaxws/index.html?url=http://open.iona.com/docs/framework/2.0/jaxws/JAXWSContextsService.html this kind of stuff will help! On 2/1/08, Daniel Kulp [EMAIL PROTECTED] wrote: OK. Let's flip this around a bit... Describe the type of example that would (or would have) helped you do what you wanted to do. We can work to get one in place. CXF has a bunch of samples already that cover a large variety of different configuations and samples. Knowing where they are deficient can help us get them improved. Dan On Thursday 31 January 2008, Phil Gibbs wrote: Well, I have to agree. The docs seem to be the last thing that a developer thinks about - because it's so obvious right? CXF, like a lot of software, badly needs some end to end examples at the very least. Currently, it's very lacking, as was XFire! Mayank Thakore-2 wrote: well, i have spent a lot of time getting cxf to work. but migrating from xfire, our code reduced from about 1200 lines to 200 lines. and i find cxf to be very extensible but it's not just coincidence that someone was talking about a book on cxf just today... Regards Mayank On Jan 23, 2008 8:36 PM, jonathan doklovic [EMAIL PROTECTED] wrote: The point being that since this is a users list (not a dev list) I thought I'd share my user experience in hopes that it could help the future of the project. If all anyone hears about a project is how great it is and never hears why people choose not to use it, then it never progresses. I was never able to get CXF working properly simply because of the lack of simple docs and end-to-end examples. Maybe it's just that I don't get it or something, but I feel there are probably a lot of me's out there that struggle with getting things up and running. - Jonathan On Wed, 2008-01-23 at 14:47 +, Sergey Beryozkin wrote: After spending about 2 weeks trying to get a very simple service to return JSON in CXF, I found the Glassfish Metro project and it's jaxws-json plugin. What's the point of this post ? Say to the world that you're not happpy with CXF ? Or tell everyone that you could've commited a patch after spending 2 days on it but just didn't get enough time :-) ? Cheers, Sergey - Original Message - From: jonathan doklovic [EMAIL PROTECTED] To: cxfuser cxf-user@incubator.apache.org Sent: Wednesday, January 23, 2008 2:37 PM Subject: Leaving CXF for Glasshfish Metro Hi, After spending about 2 weeks trying to get a very simple service to return JSON in CXF, I found the Glassfish Metro project and it's jaxws-json plugin. I gave it a shot and after 2 hours had my service up and running. Not only that, but the plugin generates pretty api docs at the endpoint for me as well as generates a javascript client on the fly. It was just too easy to make me stick with CXF. I think CXF is probably a good framework, but the docs and examples are in pieces and without real life end-to-end tutorials, it's really hard to get things working. - Jonathan IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: jms header properties
Hi Dan, This worked very well! How can I do this on the client side? Thanks! Mayank On 1/28/08, Daniel Kulp [EMAIL PROTECTED] wrote: On Monday 28 January 2008, Mayank Thakore wrote: Hi Daniel, Will BindingProvider.HTTP_PROTOCOL_HEADERS work for JMS also? With 2.0.4, yes. Internally, we just have a PROTOCOL_HEADERS thing in the message that is completely protocol nuetral. The JAX-WS frontend just maps that onto the HTTP_PROTOCOL_HEADERS thing. With 1st option: At the server side, I had to add interceptor. So what I do (in the service implementation) is to put the jms property in a threadlocal variable. Then in an interceptor (invoked prior to send), I use the code mentioned by Willem to put these properties into the message. Do you think this is ok? Any better way? Yes. Inject the WebServiceContext into your service and just set them there. The key would be the class.getName() of the JMS context class. Dan Thanks! Regards Mayank -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 22:03 To: cxf-user@incubator.apache.org Cc: Mayank Thakore Subject: Re: jms header properties There are two options: 1) the jms context stuff Willem mentioned. 2) The standard protocol header things from JAX-WS. In the second case, the JMS transport maps the headers onto the BindingProvider.HTTP_PROTOCOL_HEADERS map thing. Thus, the normal stuff applies. HOWEVER: that only works with 2.0.4 (to be released tomorrow) and the 2.1 snapshots.There was a bug that prevented that from working in earlier versions. Dan On Sunday 27 January 2008, Mayank Thakore wrote: Hi, How to set header/property fields in outgoing jms messages? There is lot of configuration examples to set jms destination properties. But I didn't find any for message properties. Thanks and Regards Mayank -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: jms header properties
on server side i used the server response context... i noticed that it only copies the jms message properties, not the header... for the header server request context seems to work... but anyway, i needed only the message properties. how to get the context on the client side? i want to set jms properties on a per message basis. On 1/31/08, Ulhas Bhole [EMAIL PROTECTED] wrote: Which option did you use? you can use JAX-WS requstcontext and responsecontext to get the access to JMS headers at client side. Regards, Ulhas Bhole Mayank Thakore wrote: Hi Dan, This worked very well! How can I do this on the client side? Thanks! Mayank On 1/28/08, Daniel Kulp [EMAIL PROTECTED] wrote: On Monday 28 January 2008, Mayank Thakore wrote: Hi Daniel, Will BindingProvider.HTTP_PROTOCOL_HEADERS work for JMS also? With 2.0.4, yes. Internally, we just have a PROTOCOL_HEADERS thing in the message that is completely protocol nuetral. The JAX-WS frontend just maps that onto the HTTP_PROTOCOL_HEADERS thing. With 1st option: At the server side, I had to add interceptor. So what I do (in the service implementation) is to put the jms property in a threadlocal variable. Then in an interceptor (invoked prior to send), I use the code mentioned by Willem to put these properties into the message. Do you think this is ok? Any better way? Yes. Inject the WebServiceContext into your service and just set them there. The key would be the class.getName() of the JMS context class. Dan Thanks! Regards Mayank -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 22:03 To: cxf-user@incubator.apache.org Cc: Mayank Thakore Subject: Re: jms header properties There are two options: 1) the jms context stuff Willem mentioned. 2) The standard protocol header things from JAX-WS. In the second case, the JMS transport maps the headers onto the BindingProvider.HTTP_PROTOCOL_HEADERS map thing. Thus, the normal stuff applies. HOWEVER: that only works with 2.0.4 (to be released tomorrow) and the 2.1 snapshots.There was a bug that prevented that from working in earlier versions. Dan On Sunday 27 January 2008, Mayank Thakore wrote: Hi, How to set header/property fields in outgoing jms messages? There is lot of configuration examples to set jms destination properties. But I didn't find any for message properties. Thanks and Regards Mayank -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
RE: jms header properties
Hi Daniel, Will BindingProvider.HTTP_PROTOCOL_HEADERS work for JMS also? With 1st option: At the server side, I had to add interceptor. So what I do (in the service implementation) is to put the jms property in a threadlocal variable. Then in an interceptor (invoked prior to send), I use the code mentioned by Willem to put these properties into the message. Do you think this is ok? Any better way? Thanks! Regards Mayank -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 22:03 To: cxf-user@incubator.apache.org Cc: Mayank Thakore Subject: Re: jms header properties There are two options: 1) the jms context stuff Willem mentioned. 2) The standard protocol header things from JAX-WS. In the second case, the JMS transport maps the headers onto the BindingProvider.HTTP_PROTOCOL_HEADERS map thing. Thus, the normal stuff applies. HOWEVER: that only works with 2.0.4 (to be released tomorrow) and the 2.1 snapshots.There was a bug that prevented that from working in earlier versions. Dan On Sunday 27 January 2008, Mayank Thakore wrote: Hi, How to set header/property fields in outgoing jms messages? There is lot of configuration examples to set jms destination properties. But I didn't find any for message properties. Thanks and Regards Mayank -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
jms header properties
Hi, How to set header/property fields in outgoing jms messages? There is lot of configuration examples to set jms destination properties. But I didn't find any for message properties. Thanks and Regards Mayank
RE: jms client
Hi, Got it! Extracted the proxy object from the client proxy, the client from the proxy object, the jmstransport conduit from the client, and finally the AddressType from the conduit. Then added all the address info to the AddressType. :) Regards Mayank -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 23, 2008 12:45 To: cxf-user@incubator.apache.org; [EMAIL PROTECTED] Subject: RE: jms client Hi, After getting the service I could add the port to it and then get the service proxy. service.addPort(portName, http://schemas.xmlsoap.org/soap/;, endPointURL); NotificationConsumer consumer = service.getPort(portName, NotificationConsumer.class); But, problem is that this port does not have JMS information which we provide per port in the wsdl. jms:address jndiConnectionFactoryName=ConnectionFactory jndiDestinationName=NotificationConsumerQueue jndiReplyDestinationName=NotificationConsumerReplyQueue jms:JMSNamingProperty name=java.naming.factory.initial value=org.apache.activemq.jndi.ActiveMQInitialContextFactory / jms:JMSNamingProperty name=java.naming.provider.url value=tcp://localhost:61616 / /jms:address Hence, when trying to use the proxy, it fails with exception similar to when wsdl is not provided in the service annotation. So, now that I can add the port, how to provide the jms destination specific information? Thanks! Regards Mayank -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 23, 2008 11:53 To: cxf-user@incubator.apache.org Subject: jms client Hi, I need to write client to contact several JMS service instances. I will know their queue names only at runtime. If I provide wsdl to the client code, then it only contacts the port listed in the wsdl. (In http I could provide the server's wsdl by appending ?wsdl to the url, but this can't be done for jms urls) How to contact server? The service definition is same. The jndi is also same. Only the queue names will differ. Thanks! Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
Re: Leaving CXF for Glasshfish Metro
well, i have spent a lot of time getting cxf to work. but migrating from xfire, our code reduced from about 1200 lines to 200 lines. and i find cxf to be very extensible but it's not just coincidence that someone was talking about a book on cxf just today... Regards Mayank On Jan 23, 2008 8:36 PM, jonathan doklovic [EMAIL PROTECTED] wrote: The point being that since this is a users list (not a dev list) I thought I'd share my user experience in hopes that it could help the future of the project. If all anyone hears about a project is how great it is and never hears why people choose not to use it, then it never progresses. I was never able to get CXF working properly simply because of the lack of simple docs and end-to-end examples. Maybe it's just that I don't get it or something, but I feel there are probably a lot of me's out there that struggle with getting things up and running. - Jonathan On Wed, 2008-01-23 at 14:47 +, Sergey Beryozkin wrote: After spending about 2 weeks trying to get a very simple service to return JSON in CXF, I found the Glassfish Metro project and it's jaxws-json plugin. What's the point of this post ? Say to the world that you're not happpy with CXF ? Or tell everyone that you could've commited a patch after spending 2 days on it but just didn't get enough time :-) ? Cheers, Sergey - Original Message - From: jonathan doklovic [EMAIL PROTECTED] To: cxfuser cxf-user@incubator.apache.org Sent: Wednesday, January 23, 2008 2:37 PM Subject: Leaving CXF for Glasshfish Metro Hi, After spending about 2 weeks trying to get a very simple service to return JSON in CXF, I found the Glassfish Metro project and it's jaxws-json plugin. I gave it a shot and after 2 hours had my service up and running. Not only that, but the plugin generates pretty api docs at the endpoint for me as well as generates a javascript client on the fly. It was just too easy to make me stick with CXF. I think CXF is probably a good framework, but the docs and examples are in pieces and without real life end-to-end tutorials, it's really hard to get things working. - Jonathan IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
RE: Any book written on xfire
I would definitely buy a book if it goes into the details of using cxf. Not just jasws or wsdl or stuff but also about cxf interceptors, arch etc. Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! -Original Message- From: Adrian Trenaman [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 22, 2008 20:15 To: cxf-user@incubator.apache.org Subject: Re: Any book written on xfire Hi Anshul , I've written a 2-day training course on JAX-WS development using CXF; am delivering a cut down version of this at OOP in Munich later this week. I've been toying with the idea of producing a developer's handbook for CXF; would be interested to know if you think there's a market for it! For the minute, I concur with Glen that the online documentation for CXF is a pretty good start. You might also want to take a look at the Fuse Service Framework documentation, available on open.iona.com http://open.iona.com/documentation/fuse-service-framework-documentation Warm regards, Ade. Glen Mazza-2 wrote: I like Hansen's book[1], although it is about JAX-WS in general (either CXF or GlassFish Metro). Presently our online user's guide[2] is the best source for CXF-specific information. HTH, Glen [1] http://www.jroller.com/gmazza/date/20070809 [2] http://cwiki.apache.org/CXF20DOC/index.html Am Dienstag, den 22.01.2008, 09:09 + schrieb Anshul Dutta: Does any one knows about a good book on xfire or cxf? Or any SOA book that includes these topics? Thanks, ad This email has been scanned for all known viruses by the MessageLabs Email Security Service and the Macro 4 plc internal virus protection system. -- View this message in context: http://www.nabble.com/Any-book-written-on-xfire-tp15015038p15019897.html Sent from the cxf-user mailing list archive at Nabble.com.
jms client
Hi, I need to write client to contact several JMS service instances. I will know their queue names only at runtime. If I provide wsdl to the client code, then it only contacts the port listed in the wsdl. (In http I could provide the server's wsdl by appending ?wsdl to the url, but this can't be done for jms urls) How to contact server? The service definition is same. The jndi is also same. Only the queue names will differ. Thanks! Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
RE: jms client
Hi, After getting the service I could add the port to it and then get the service proxy. service.addPort(portName, http://schemas.xmlsoap.org/soap/;, endPointURL); NotificationConsumer consumer = service.getPort(portName, NotificationConsumer.class); But, problem is that this port does not have JMS information which we provide per port in the wsdl. jms:address jndiConnectionFactoryName=ConnectionFactory jndiDestinationName=NotificationConsumerQueue jndiReplyDestinationName=NotificationConsumerReplyQueue jms:JMSNamingProperty name=java.naming.factory.initial value=org.apache.activemq.jndi.ActiveMQInitialContextFactory / jms:JMSNamingProperty name=java.naming.provider.url value=tcp://localhost:61616 / /jms:address Hence, when trying to use the proxy, it fails with exception similar to when wsdl is not provided in the service annotation. So, now that I can add the port, how to provide the jms destination specific information? Thanks! Regards Mayank -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 23, 2008 11:53 To: cxf-user@incubator.apache.org Subject: jms client Hi, I need to write client to contact several JMS service instances. I will know their queue names only at runtime. If I provide wsdl to the client code, then it only contacts the port listed in the wsdl. (In http I could provide the server's wsdl by appending ?wsdl to the url, but this can't be done for jms urls) How to contact server? The service definition is same. The jndi is also same. Only the queue names will differ. Thanks! Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
RE: client connect Xfire server problem
Hi, I am also using client/server across xfire/cxf. I noticed a difference in the wsdl2java generated code (annotation of function params) between the two. While xfire uses name variable in @WebParam, CXF uses name as well as partName. When I tweaked the XFire annotation value of name to match the partName value of CXF, it worked. Maybe you can try something similar with your config in xml files. Cheers Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! -Original Message- From: yulinxp [mailto:[EMAIL PROTECTED] Sent: Monday, January 21, 2008 21:22 To: cxf-user@incubator.apache.org Subject: client connect Xfire server problem I have a Xfire server and cxf client, //Xfire services.xml beans service xmlns=http://xfire.codehaus.org/config/1.0; nameHelloWorldService/name namespacehttp://client.mycompany.com/HelloWorldService/namespace serviceClasscom.mycompany.client.HelloWorld/serviceClass implementationClasscom.mycompany.client.HelloWorldImpl/implementationClas s /service /beans //client-beans.xml bean id=client class=com.mycompany.client.HelloWorld factory-bean=clientFactory factory-method=create/ bean id=clientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=com.mycompany.client.HelloWorld/ property name=address value=http://localhost:8080/root/services/HelloWorldService/ /bean // START SNIPPET: client ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {demo/spring/client/client-beans.xml}); HelloWorld client = (HelloWorld)context.getBean(client); String response; response = port.sayHi(OK, info); System.out.println(response); I am able to see the wsdl in http://localhost:8080/root/services/HelloWorldService?wsdl but when cxf client connects, i got the following exception: Jan 21, 2008 9:39:21 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass INFO: Creating Service {http://client.mycompany.com/}HelloWorldService from class com.mycompany.client.HelloWorld Exception in thread main javax.xml.ws.WebServiceException: Could not find operation info for web method sayHi. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:102) at $Proxy12.sayHi(Unknown Source) at demo.spring.client.Client.main(Client.java:49) -- View this message in context: http://www.nabble.com/client-connect-Xfire-server-problem-tp15000218p1500021 8.html Sent from the cxf-user mailing list archive at Nabble.com.
problem using local transport
Hi, I am trying to use local transport. Like this: String url = local://HelloService; Endpoint.publish(url, new HelloServiceImpl()); This client code I found at bottom of user guide's local transport page: ClientProxyFactoryBean cf = new ClientProxyFactoryBean(); cf.setAddress(url); cf.setServiceClass(HelloService.class); HelloService h = (HelloService) cf.create(); System.out.println(h.inverse(false)); HelloService is defined as below: @WebService public interface HelloService { public boolean inverse( boolean value); } I have placed the client code immediately below the publish code. But I get an exception: Exception in thread main org.apache.cxf.binding.soap.SoapFault: null while invoking public boolean com.huawei.imap.nbiframework.testutil.webservice.HelloServiceImpl.inverse(bo olean) with params [null]. at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessa ge(Soap11FaultInInterceptor.java:70) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessa ge(Soap11FaultInInterceptor.java:35) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain .java:207) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(Abs tractFaultChainInitiatorObserver.java:90) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage (ReadHeadersInterceptor.java:179) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage (ReadHeadersInterceptor.java:56) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain .java:207) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:402) at org.apache.cxf.transport.local.LocalDestination$SynchronousConduit$1.run(Loc alDestination.java:88) at java.lang.Thread.run(Unknown Source) Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
RE: ABR Communication Pattern
Well, customer is king. With all the advantages, customer says it is an overhead to maintain state info. So they want a way to send extra responses from inside the service implementation code :) My boss, already sent me some sample code on how to create an outgoing interceptor chain to do this. Lets see how things turn out. Regards Mayank -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 20:13 To: cxf-user@incubator.apache.org Cc: Mayank Thakore Subject: Re: ABR Communication Pattern On Tuesday 15 January 2008, Mayank Thakore wrote: Actually that is what I had tried initially. I added an interceptor at the end and used a flag on the message to decide on reprocessing. But it didn't work after 2 and half days of effort so I gave in to modifying cxf code. Most likely, the JMSDestination would need to add the JMSMessage to the CXF message and your interceptor would re-dispatch that instead of the CXF message. That still requires changes to the JMSDestination though. It would be great if some of the interceptors could undo the change they did to the message. The problem is that in most cases, actions are not undoable. With HTTP, we stream the data directly to/from the wire. No byte[] things in between like we need to for JMS. Thus, once something is read, it's not undoable. Actually, this brings up another idea that would help performance You COULD take the message and feed it back into the chain, but call the doInterceptStartingAfter(...) method to make the chain start at an interceptor much later in the phase, like after all the objects are unmarshalled, method is determined, etc... Then, we would be able to move the message up and down certain portions of the chain. (It might make the chain heavier or slow down processing, but we could always add an annotation or configuration to put undo on/off.) Combined with the pause/resume functionality, this would open up some interesting possibilities. Definitely, just needs quite a bit of work to flush out all the little issues. :-) Dan Regards Mayank -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 02:14 To: cxf-user@incubator.apache.org Cc: Mayank Thakore Subject: Re: ABR Communication Pattern Hmm... interesting solution.I like it. :-) One potential issue is the use of the ThreadLocal, but that's definitely not an issue right now. The API's technically allow an interceptor to pause the chain and then resume it on a separate thread. (for example, to wait for a resource to become available) Nothing does that right now and doing so is going to take a bunch of testing to fix everything else that will break. :-) To support that, the variable would need to be stored as a property on the Exchange. Then an interceptor would need to be added to the end of the outgoing chains to check for the flag and, if present, restart the message processing from the beginning.I guess that would be the more correct way to do it, but also a LOT more complex. For now, your solution is great. Dan On Tuesday 15 January 2008, Mayank Thakore wrote: I LOVE OPEN SOURCE It worked :) just need to call following from service implementation when another response needs to be sent (as long as you keep calling this your method will get reinvoked to handle this incoming request; so you can send as many responses to each request as you want) JMSDestination.abrStatus.set(new Boolean(true)); modified code from JMSDestination: -- --- public static ThreadLocalBoolean abrStatus = new ThreadLocalBoolean() { @Override protected synchronized Boolean initialValue() { return new Boolean(false); } }; protected class JMSExecutor implements Runnable { javax.jms.Message message; JMSExecutor(javax.jms.Message m) { message = m; } public void run() { long abrCount = 0; do { getLogger().log(Level.INFO, run the incoming message in the threadpool); JMSDestination.abrStatus.set(new Boolean(false)); getLogger().log(Level.INFO, abr count for message(+Thread.currentThread()+): +abrCount); abrCount++; try { incoming(message); } catch (IOException ex) { // TODO: Decide what to do if we receive the exception. getLogger().log(Level.WARNING, Failed to process incoming message : , ex); break; } } while(JMSDestination.abrStatus.get().booleanValue
Re: ABR Communication Pattern
I LOVE OPEN SOURCE It worked :) just need to call following from service implementation when another response needs to be sent (as long as you keep calling this your method will get reinvoked to handle this incoming request; so you can send as many responses to each request as you want) JMSDestination.abrStatus.set(new Boolean(true)); modified code from JMSDestination: - public static ThreadLocalBoolean abrStatus = new ThreadLocalBoolean() { @Override protected synchronized Boolean initialValue() { return new Boolean(false); } }; protected class JMSExecutor implements Runnable { javax.jms.Message message; JMSExecutor(javax.jms.Message m) { message = m; } public void run() { long abrCount = 0; do { getLogger().log(Level.INFO, run the incoming message in the threadpool); JMSDestination.abrStatus.set(new Boolean(false)); getLogger().log(Level.INFO, abr count for message(+Thread.currentThread()+): +abrCount); abrCount++; try { incoming(message); } catch (IOException ex) { // TODO: Decide what to do if we receive the exception. getLogger().log(Level.WARNING, Failed to process incoming message : , ex); break; } } while(JMSDestination.abrStatus.get().booleanValue()); } } - Regards Mayank On 1/15/08, Mayank Thakore [EMAIL PROTECTED] wrote: Well, it didn't work. The interceptors mutate the message and won't process the mutated one. So I am going to try changing the JMSDestination.incoming code to resend the message as many times as required. Any thoughts? Regards Mayank -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: Sunday, January 13, 2008 23:09 To: cxf-user@incubator.apache.org Subject: ABR Communication Pattern Hi, I was trying to achieve Asynchronous Batch Response (ABR) pattern with CXF for JMS transport. ABR means user can send multiple responses to a single request. Please read this and let me know what you think. Hazard info: I haven't finished the client for this yet, so don't know wheather it is working. It does print the cxf logs correctly. Below is my interceptor code. It attaches to the end of the interceptor chain and executes the previous two interceptors which invoke the service implementation and send the out message respectively. == package ws.v1.tmf854; import java.util.ListIterator; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.message.Message; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; public class ABRInterceptor extends AbstractPhaseInterceptorMessage { public ABRInterceptor() { super(Phase.POST_INVOKE); getAfter().add( org.apache.cxf.interceptor.OutgoingChainInterceptor.class .getName()); } @Override public void handleMessage(Message message) throws Fault { System.out.println(ABRInterceptor invoked); if (ABRSession.isEnabled()) { executeReRuns(message); } } private void executeReRuns(Message message) { ListIteratorInterceptor? extends Message iterator = prepareReRunIterator(message); while (ABRSession.isEnabled()) { ABRSession.disable(); for (int i = 0; i 2; i++) { iterator.previous(); } for (int i = 0; i 2; i++) { Interceptor currentInterceptor = iterator.next(); currentInterceptor.handleMessage(message); } } } private ListIteratorInterceptor? extends Message prepareReRunIterator( Message message) { ListIteratorInterceptor? extends Message iterator = message .getInterceptorChain().getIterator(); while (iterator.hasNext()) { iterator.next(); } iterator.previous(); return iterator; } } == Below is the session control device. It uses a thread local variable to remember if ABR session is enabled or disabled
RE: ABR Communication Pattern
Actually that is what I had tried initially. I added an interceptor at the end and used a flag on the message to decide on reprocessing. But it didn't work after 2 and half days of effort so I gave in to modifying cxf code. It would be great if some of the interceptors could undo the change they did to the message. Then, we would be able to move the message up and down certain portions of the chain. (It might make the chain heavier or slow down processing, but we could always add an annotation or configuration to put undo on/off.) Combined with the pause/resume functionality, this would open up some interesting possibilities. Regards Mayank -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 02:14 To: cxf-user@incubator.apache.org Cc: Mayank Thakore Subject: Re: ABR Communication Pattern Hmm... interesting solution.I like it. :-) One potential issue is the use of the ThreadLocal, but that's definitely not an issue right now. The API's technically allow an interceptor to pause the chain and then resume it on a separate thread. (for example, to wait for a resource to become available) Nothing does that right now and doing so is going to take a bunch of testing to fix everything else that will break. :-) To support that, the variable would need to be stored as a property on the Exchange. Then an interceptor would need to be added to the end of the outgoing chains to check for the flag and, if present, restart the message processing from the beginning.I guess that would be the more correct way to do it, but also a LOT more complex. For now, your solution is great. Dan On Tuesday 15 January 2008, Mayank Thakore wrote: I LOVE OPEN SOURCE It worked :) just need to call following from service implementation when another response needs to be sent (as long as you keep calling this your method will get reinvoked to handle this incoming request; so you can send as many responses to each request as you want) JMSDestination.abrStatus.set(new Boolean(true)); modified code from JMSDestination: -- --- public static ThreadLocalBoolean abrStatus = new ThreadLocalBoolean() { @Override protected synchronized Boolean initialValue() { return new Boolean(false); } }; protected class JMSExecutor implements Runnable { javax.jms.Message message; JMSExecutor(javax.jms.Message m) { message = m; } public void run() { long abrCount = 0; do { getLogger().log(Level.INFO, run the incoming message in the threadpool); JMSDestination.abrStatus.set(new Boolean(false)); getLogger().log(Level.INFO, abr count for message(+Thread.currentThread()+): +abrCount); abrCount++; try { incoming(message); } catch (IOException ex) { // TODO: Decide what to do if we receive the exception. getLogger().log(Level.WARNING, Failed to process incoming message : , ex); break; } } while(JMSDestination.abrStatus.get().booleanValue()); } } -- --- Regards Mayank On 1/15/08, Mayank Thakore [EMAIL PROTECTED] wrote: Well, it didn't work. The interceptors mutate the message and won't process the mutated one. So I am going to try changing the JMSDestination.incoming code to resend the message as many times as required. Any thoughts? Regards Mayank -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: Sunday, January 13, 2008 23:09 To: cxf-user@incubator.apache.org Subject: ABR Communication Pattern Hi, I was trying to achieve Asynchronous Batch Response (ABR) pattern with CXF for JMS transport. ABR means user can send multiple responses to a single request. Please read this and let me know what you think. Hazard info: I haven't finished the client for this yet, so don't know wheather it is working. It does print the cxf logs correctly. Below is my interceptor code. It attaches to the end of the interceptor chain and executes the previous two interceptors which invoke the service implementation and send the out message respectively. == package ws.v1.tmf854; import java.util.ListIterator; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.message.Message; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; public class ABRInterceptor extends AbstractPhaseInterceptorMessage
cxf jar is empty
Hi, I downloaded the src zip of cxf 2.0.3. Did a mvn -Pfastinstall in the root folder. Then did a mvn in the distribution folder. But the cxf-2.0.3-incubator.jar file (inside the resulting apache-cxf-2.0.3-incubator.zip package) does not have any class files inside it ! Its just empty! Only 10KB size (META-INF folder is present). Though it should be about 2.5MB. Has anyone seen this before? If required I will post the build output. It showed all success. Thanks! Mayank
RE: ABR Communication Pattern
Well, it didn't work. The interceptors mutate the message and won't process the mutated one. So I am going to try changing the JMSDestination.incoming code to resend the message as many times as required. Any thoughts? Regards Mayank -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: Sunday, January 13, 2008 23:09 To: cxf-user@incubator.apache.org Subject: ABR Communication Pattern Hi, I was trying to achieve Asynchronous Batch Response (ABR) pattern with CXF for JMS transport. ABR means user can send multiple responses to a single request. Please read this and let me know what you think. Hazard info: I haven't finished the client for this yet, so don't know wheather it is working. It does print the cxf logs correctly. Below is my interceptor code. It attaches to the end of the interceptor chain and executes the previous two interceptors which invoke the service implementation and send the out message respectively. == package ws.v1.tmf854; import java.util.ListIterator; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.message.Message; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; public class ABRInterceptor extends AbstractPhaseInterceptorMessage { public ABRInterceptor() { super(Phase.POST_INVOKE); getAfter().add( org.apache.cxf.interceptor.OutgoingChainInterceptor.class .getName()); } @Override public void handleMessage(Message message) throws Fault { System.out.println(ABRInterceptor invoked); if (ABRSession.isEnabled()) { executeReRuns(message); } } private void executeReRuns(Message message) { ListIteratorInterceptor? extends Message iterator = prepareReRunIterator(message); while (ABRSession.isEnabled()) { ABRSession.disable(); for (int i = 0; i 2; i++) { iterator.previous(); } for (int i = 0; i 2; i++) { Interceptor currentInterceptor = iterator.next(); currentInterceptor.handleMessage(message); } } } private ListIteratorInterceptor? extends Message prepareReRunIterator( Message message) { ListIteratorInterceptor? extends Message iterator = message .getInterceptorChain().getIterator(); while (iterator.hasNext()) { iterator.next(); } iterator.previous(); return iterator; } } == Below is the session control device. It uses a thread local variable to remember if ABR session is enabled or disabled. == package ws.v1.tmf854; public class ABRSession { private static ThreadLocalBoolean status = new ThreadLocalBoolean() { @Override protected synchronized Boolean initialValue() { return new Boolean(false); } }; public static synchronized boolean isEnabled() { return status.get().booleanValue(); } public static synchronized void disable() { System.out.println(Disabling ABRSession); status.set(new Boolean(false)); } public static synchronized void enable() { System.out.println(Enabling ABRSession); status.set(new Boolean(true)); } } == So, if user wants ABR mode, they just need to invoke ABRSession.enable() inside the service implementation. Here is the server main for completion: == package ws.v1.tmf854; import javax.xml.ws.Endpoint; import org.apache.cxf.jaxws.EndpointImpl; /** * This class was generated by Apache CXF (incubator) 2.0.3-incubator Sat Jan 12 * 11:10:39 IST 2008 Generated source version: 2.0.3-incubator * */ public class AlarmRetrieval_AlarmRetrievalJms_Server { protected AlarmRetrieval_AlarmRetrievalJms_Server() throws Exception { System.out.println(Starting Server); Object implementor = new AlarmRetrievalImpl(); String address = jms://; EndpointImpl ep = (EndpointImpl) Endpoint.publish(address, implementor); ep.getServer().getEndpoint().getInInterceptors().add
RE: cxf jar is empty
Thank you! Regards Mayank -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 15, 2008 00:32 To: cxf-user@incubator.apache.org Cc: Mayank Thakore Subject: Re: cxf jar is empty Mayank, That's as designed. It's just a manifest jar (jar that has a Manifest with a Classpath: entry that points to all the other jars it needs). (hmm, probably should rename that) The jar you probably want is in distribution/bundle. It is the big jar with everything in it. Dan On Monday 14 January 2008, Mayank Thakore wrote: Hi, I downloaded the src zip of cxf 2.0.3. Did a mvn -Pfastinstall in the root folder. Then did a mvn in the distribution folder. But the cxf-2.0.3-incubator.jar file (inside the resulting apache-cxf-2.0.3-incubator.zip package) does not have any class files inside it ! Its just empty! Only 10KB size (META-INF folder is present). Though it should be about 2.5MB. Has anyone seen this before? If required I will post the build output. It showed all success. Thanks! Mayank -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Documentation for AbstractPhaseInterceptor
Hi, The API doc for AbstractPhaseInterceptor.getAfter() and getBefore() are reversed. The doc for getAfter() says: Returns a set of IDs specifying the interceptors that should be run after this interceptor. But actually, it returns a set of IDs specifying the interceptors after which this interceptor should be run. The description is correct in the user guide at http://cwiki.apache.org/confluence/display/CXF20DOC/Interceptors It says: You can also express that you would like your interceptor to run before/after certain other interceptors in the same phase Regards Mayank
ABR Communication Pattern
Hi, I was trying to achieve Asynchronous Batch Response (ABR) pattern with CXF for JMS transport. ABR means user can send multiple responses to a single request. Please read this and let me know what you think. Hazard info: I haven't finished the client for this yet, so don't know wheather it is working. It does print the cxf logs correctly. Below is my interceptor code. It attaches to the end of the interceptor chain and executes the previous two interceptors which invoke the service implementation and send the out message respectively. == package ws.v1.tmf854; import java.util.ListIterator; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.message.Message; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; public class ABRInterceptor extends AbstractPhaseInterceptorMessage { public ABRInterceptor() { super(Phase.POST_INVOKE); getAfter().add( org.apache.cxf.interceptor.OutgoingChainInterceptor.class .getName()); } @Override public void handleMessage(Message message) throws Fault { System.out.println(ABRInterceptor invoked); if (ABRSession.isEnabled()) { executeReRuns(message); } } private void executeReRuns(Message message) { ListIteratorInterceptor? extends Message iterator = prepareReRunIterator(message); while (ABRSession.isEnabled()) { ABRSession.disable(); for (int i = 0; i 2; i++) { iterator.previous(); } for (int i = 0; i 2; i++) { Interceptor currentInterceptor = iterator.next(); currentInterceptor.handleMessage(message); } } } private ListIteratorInterceptor? extends Message prepareReRunIterator( Message message) { ListIteratorInterceptor? extends Message iterator = message .getInterceptorChain().getIterator(); while (iterator.hasNext()) { iterator.next(); } iterator.previous(); return iterator; } } == Below is the session control device. It uses a thread local variable to remember if ABR session is enabled or disabled. == package ws.v1.tmf854; public class ABRSession { private static ThreadLocalBoolean status = new ThreadLocalBoolean() { @Override protected synchronized Boolean initialValue() { return new Boolean(false); } }; public static synchronized boolean isEnabled() { return status.get().booleanValue(); } public static synchronized void disable() { System.out.println(Disabling ABRSession); status.set(new Boolean(false)); } public static synchronized void enable() { System.out.println(Enabling ABRSession); status.set(new Boolean(true)); } } == So, if user wants ABR mode, they just need to invoke ABRSession.enable() inside the service implementation. Here is the server main for completion: == package ws.v1.tmf854; import javax.xml.ws.Endpoint; import org.apache.cxf.jaxws.EndpointImpl; /** * This class was generated by Apache CXF (incubator) 2.0.3-incubator Sat Jan 12 * 11:10:39 IST 2008 Generated source version: 2.0.3-incubator * */ public class AlarmRetrieval_AlarmRetrievalJms_Server { protected AlarmRetrieval_AlarmRetrievalJms_Server() throws Exception { System.out.println(Starting Server); Object implementor = new AlarmRetrievalImpl(); String address = jms://; EndpointImpl ep = (EndpointImpl) Endpoint.publish(address, implementor); ep.getServer().getEndpoint().getInInterceptors().add( new ABRInterceptor()); } public static void main(String args[]) throws Exception { new AlarmRetrieval_AlarmRetrievalJms_Server(); System.out.println(Server ready...); } } = So, what do you think? Thanks for any and all comments. Feel free to be critical. Mayank
Some basic question on wsdl generated services
Hi, Few basic questions: 1. If we generate service implementation objects using wsdl2java, is it possible to avoid it referring back to the wsdl file in the annotations? 2. The generated implementation mentions the port name in the annotations. So how can we use the same implementation for two ports (say one http, other jms)? Will we have to delegate the calls to some common class? Thanks! Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
Question regarding jms destination
Hi, For JMS, we specify the endpoint to register the service when invoking Endpoint.publish(address, impl) Also, we specify the url as the jndiDestinationName attribute of jms:address element in the wsdl port definition. The jndiDestinationName must be registered in jndi server or name not found exception is thrown. So, if we are giving the jndi destination url in wsdl file, what is the use of giving the endpoint address when calling Endpoint.publish(string, object)? What does this message in the logs imply (I gave this url to Endpoint.publish whereas, in wsdl I am using the url jms://MyQueue): INFO: Setting the server's publish address to be jms://MyNew2Queue I realize that it works properly if we give the same url at both the places and have the destination registered in jndi. Thanks much for the help! Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
RE: Question regarding jms destination
Hi Ulhas, If we want to publish the same service over multiple jms channels will we have to define a port for each of them in the wsdl file? Thanks! Regards Mayank -Original Message- From: Bhole, Ulhas [mailto:[EMAIL PROTECTED] Sent: Thursday, January 10, 2008 15:59 To: cxf-user@incubator.apache.org; [EMAIL PROTECTED] Subject: RE: Question regarding jms destination Hi Mayank, JMS transport ignores the address specified in endpoint.publish() and acts upon anything that is set in JMS WSDL Entensor. Having said this, you do need the address starting with jms:// to let CXF stack know which transport to pickup if you skip this CXF will assume default HTTP transport and will try to load HTTP transport. Regards, Ulhas Bhole -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: 10 January 2008 09:48 To: cxf-user@incubator.apache.org Subject: Question regarding jms destination Hi, For JMS, we specify the endpoint to register the service when invoking Endpoint.publish(address, impl) Also, we specify the url as the jndiDestinationName attribute of jms:address element in the wsdl port definition. The jndiDestinationName must be registered in jndi server or name not found exception is thrown. So, if we are giving the jndi destination url in wsdl file, what is the use of giving the endpoint address when calling Endpoint.publish(string, object)? What does this message in the logs imply (I gave this url to Endpoint.publish whereas, in wsdl I am using the url jms://MyQueue): INFO: Setting the server's publish address to be jms://MyNew2Queue I realize that it works properly if we give the same url at both the places and have the destination registered in jndi. Thanks much for the help! Regards Mayank This e-mail and attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient's) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
RE: Wsdl2java package usage
We had 8 services like this. We ran wsdl2java separately for each of them. Then, copied everything into one folder-tree (overwriting along the way) and as Glen said, finally merged the ObjectFactory code manually. Regards Mayank -Original Message- From: Glen Mazza [mailto:[EMAIL PROTECTED] Sent: Thursday, December 27, 2007 10:48 To: cxf-user@incubator.apache.org Subject: RE: Wsdl2java package usage I apologize, I stand corrected. Metro (JAXB apparently) *does* create this class. I did not realize it was a required object--still, I don't see it being referenced by other classes. Perhaps running wsdl2java twice, flipping the order of FooService and BarService, and then merging all the methods into *one* ObjectFactory would work. That's all I can think of. Glen Am Mittwoch, den 26.12.2007, 23:48 -0500 schrieb Silberman, Nathan: I actually had not been using ObjectFactory in my code at all. The reason why this came up is that I have 2 services, lets call them FooService and BarService, both of which have abstract and extended types. When I execute wsdl2java on FooService, and then BarService, ObjectFactory has only BarService create helper methods. No problem so far. Still not referencing these methods in my codebase. At this point, when I deploy my two services, only BarService works correctly, in that FooService's extended types are marshalled WITHOUT derived type information (thus rendering them impossible to unmarshall). If I instead execute wsdl2java on BarService and then FooService, thus ensuring that FooService's methods appear in ObjectFactory, then FooService works fine and BarService's derived/extended types no longer work. I hadn't though that ObjectFactory was used at from CXF but this is literally the only file I observed as being altered (aside from several file's whose' autogened timestamps were changed) when I switch the ordering of which I execute with wsdl2java first or second. Any thoughts? I can produce some sample code if this is unclear or if a real example is needed for any diagnosis. -Original Message- From: Glen Mazza [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 26, 2007 11:34 PM To: cxf-user@incubator.apache.org Subject: Re: Wsdl2java package usage Am Mittwoch, den 26.12.2007, 14:48 -0500 schrieb Silberman, Nathan: When using wsdl2java, I had been specifying the destination packages for several services to be the same package: com.foobar lets say. This is not problematic for all classes except one: ObjectFactory. The methods in objectFactory are only those of the last wsdl to be generated to java code. The consequence of this is that objectFactory is missing most of the element helper methods. Has anybody else run into this issue? If so, is there another solution other than having each wsdl2java output be sent to a different package? (The consequence of multiple output packages is that you end up with duplicate classes for wsdls that share types) ObjectFactory has always struck me as just a training wheel-type helper class for newbies. (IIRC GlassFish Metro's wsimport doesn't even generate it.) I would argue to keep your code JAX-WS portable and avoid using it in your work. Glen Nathan
multiple responses in jms
Hi, I need to be able to send multiple responses to a single request on jms transport. Does CXF support this style of communication or is there a workaround to achieve this? Any sample code? Even if this cannot be done, would some experienced member on this list please confirm it? I have written some wsdl based web services but am not able to figure out how to achieve this style. Thanks a lot! Regards Mayank
Re: multiple responses in jms
Thanks for the answer Ulhas! This clears up the air. Though unfortunately this is the answer I had anticipated. We were earlier using XFire and ended up customizing the JMSTransport/Channel classes to suit our needs. CXF has much better support but with our requirements maturing we have to customize here too. One question. In XFire we were able to register the modified transport files. Any such luck here? I wasn't able to find anything in google or the user/arch guide. Thanks again! Regards Mayank On Dec 12, 2007 6:33 PM, Ulhas Bhole [EMAIL PROTECTED] wrote: Hi Mayank, Answer is NO. currently JMS transport only works on 1 request, 1reply basis. The workaround might be to use the pub/sub mechanism and have something like client sending a request to a topic on server side and then server doing the same thing other way round on some other topic where the client side will also have topic listener on which it can accept the replies. Other option a bit complicated and time consuming is to extend the existing JMS transport or write your own transport to suit your purpose. Regards, Ulhas Bhole Mayank Thakore wrote: Hi, I need to be able to send multiple responses to a single request on jms transport. Does CXF support this style of communication or is there a workaround to achieve this? Any sample code? Even if this cannot be done, would some experienced member on this list please confirm it? I have written some wsdl based web services but am not able to figure out how to achieve this style. Thanks a lot! Regards Mayank IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
RE: multiple responses in jms
Hi Willem, We are doing sample implementations of MTOSI 1.1 specs. (IONA also has a toolkit around this. I have to take out time to have a look at it) One of the message exchange patterns requires multiple responses to single request. (if possible please refer SD2-10 of TMF854 1.1) Regards Mayank -Original Message- From: Jiang, Ning (Willem) [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 12, 2007 18:32 To: cxf-user@incubator.apache.org Subject: RE: multiple responses in jms Hi I do not know how can you let your implementor return multiple response. If you just want the responses send to different jms queue, maybe you can do it by hacking the MessageSenderInterceptor. Willem. -Original Message- From: Mayank Thakore [mailto:[EMAIL PROTECTED] Sent: Wed 12/12/2007 19:06 To: cxf-user@incubator.apache.org Subject: multiple responses in jms Hi, I need to be able to send multiple responses to a single request on jms transport. Does CXF support this style of communication or is there a workaround to achieve this? Any sample code? Even if this cannot be done, would some experienced member on this list please confirm it? I have written some wsdl based web services but am not able to figure out how to achieve this style. Thanks a lot! Regards Mayank
JMS performance
Hi, I wrote a simple WSDL based web service. In HTTP I am getting 1000 request/response in 19 secs. But, in JMS 1000 request/response cost 110+ secs. Is this OK? Are there any benchmarks? Any pointers on what can be done for JMS? I am using CXF 2.0.2 and OpenJMS. Thanks! Mayank
Re: FileNotFoundException wsdl
I had some doubts along similar lines. Suppose that my client needs to access a web service published by different servers at multiple endpoint urls. These urls will be known only at runtime. How can I achieve this? (because if the wsdl url is a file then it has the address of the service) Arun says that when metro stubs are used the first call is used to invoke the wsdl and second to get the results. Can we do the same in CXF by specifying WS endpoint at runtime? Thanks! Mayank On 11/12/07, Abid Hussain [EMAIL PROTECTED] wrote: Thanks, putting the wsdl in the classpath and using the following code in the ServiceImpl class finally did it: static { URL url = null; try { // url = new URL(file:etc/kvvservice.wsdl); url = KvvServiceImplService.class.getResource(/kvvservice.wsdl); System.out.println(Using wsdl from ( + url + ).); } catch (Exception e) { System.err.println(Can not initialize the default wsdl from classpath:/kvvservice.wsdl); // e.printStackTrace(); } WSDL_LOCATION = url; } Regards, Abi Glen Mazza schrieb: Am Montag, den 12.11.2007, 11:08 +0100 schrieb Abid Hussain: Hello everybody, I generated a client using wsdl2java and packed it in a jar, so that I can use it in other applications. When generating the client using wsdl2java I indicated that the wsdl file is in etc/kvvservice.wsdl. Now, when I try to use the client in an other application (using the jar file) I get the following error (full stack trace at the end): javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'file:etc/kvvservice.wsdl'.: java.io.FileNotFoundException: etc\kvvservice.wsdl (Das System kann den angegebenen Pfad nicht finden) First, I wonder how to indicate that the wsdl has moved to another place when using the client in another application. Your WSDL file will need to be in the classpath of the client app that you are running. Basically, at the root of the classes directory is the easiest place to put it, but you can also specify other classpaths. I find Ant easier to state classpaths, if you look at my run-client target in step 5 of my eBay tutorial this may help you: http://www.jroller.com/gmazza/date/20070817 Also, in your Service class generated by JAX-WS, you can alter the syntax used for loading the file. Instead of: url = new URL(file:mywsdl.wsdl); // filepath search, probably won't work for JARs you should be able to use something like: URL wsdlURL = getClass().getClassLoader().getResource(mywsdl.wsdl); // classpath search, should work for JARs Second, I don't get why the CXF Runtime needs the wsdl file at all? The clients classes have already been generated using wsdl2java and I suppose that all information needed is contained in those generated classes. Vivek and Arun of Sun Metro have much to say about this, links below. http://forums.java.net/jive/message.jspa?messageID=244333#244333 http://blogs.sun.com/arungupta/date/20071108 HTH, Glen -- Abid Hussain Mail: [EMAIL PROTECTED] Web: http://www.abid76.de