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.(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. > >
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.(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: OSGi bundling
we're using cxf inside osgi bundles... we just put all the libs in one bundle and export required packages from there... just had to be careful to import the javax.jws and some related namespaces in other bundles where services are written since these packages are available without import too but the @WebService annotations won't work then so is there anything special we ought to do to make a cxf bundle? On Feb 9, 2008 2:40 AM, Kyle.Bober <[EMAIL PROTECTED]> wrote: > > To whom it may concern, > I would also like to try out CXF OSGi bundles. I would love to use CXF in > my Eclipse RCP application I am writing. You mention there is a small > (untested) maven project to create the bundles. I would like to try it out > in my environment if possible. Where can I locate it to give it a whirl. > > Regards, > Kyle > > > > > gnodet wrote: > > > > We're currently working on using CXF inside ServiceMix, so I've just > > committed a small maven project to create a bundle for CXF, though this is > > not tested yet and may not include everything you will need right now. > > However, any feedback would be welcome. > > > > On Nov 19, 2007 5:27 PM, Roshan A. Punnoose < > > [EMAIL PROTECTED]> wrote: > > > >> Is there incubation code set up for the cxf OSGi bundling that is > >> targeted for Dec.15? I want to try it out now. :) > >> > >> Roshan > >> > > > > > > > > -- > > Cheers, > > Guillaume Nodet > > > > Blog: http://gnodet.blogspot.com/ > > > > > > -- > View this message in context: > http://www.nabble.com/axis-vs-cxf%2C-which-is-better--tp13755334p15363956.html > Sent from the cxf-user mailing list archive at Nabble.com. > >
Webservice client sending null parameters to host
I have a cxf webservice and a client generated using wsdl2java. When the client tries to contact the service the parameters are being null. I am unable to figure out the reason.Tried including all the jars from cxf. Any answers are appreciated. Thanks -- View this message in context: http://www.nabble.com/Webservice-client-sending-null-parameters-to-host-tp15368060p15368060.html Sent from the cxf-user mailing list archive at Nabble.com.
Using CXF with an Eclipse RCP Application
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.(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: OSGi bundling
To whom it may concern, I would also like to try out CXF OSGi bundles. I would love to use CXF in my Eclipse RCP application I am writing. You mention there is a small (untested) maven project to create the bundles. I would like to try it out in my environment if possible. Where can I locate it to give it a whirl. Regards, Kyle gnodet wrote: > > We're currently working on using CXF inside ServiceMix, so I've just > committed a small maven project to create a bundle for CXF, though this is > not tested yet and may not include everything you will need right now. > However, any feedback would be welcome. > > On Nov 19, 2007 5:27 PM, Roshan A. Punnoose < > [EMAIL PROTECTED]> wrote: > >> Is there incubation code set up for the cxf OSGi bundling that is >> targeted for Dec.15? I want to try it out now. :) >> >> Roshan >> > > > > -- > Cheers, > Guillaume Nodet > > Blog: http://gnodet.blogspot.com/ > > -- View this message in context: http://www.nabble.com/axis-vs-cxf%2C-which-is-better--tp13755334p15363956.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: CXF on WebLogic 9.2
Thanks for your suggestions. I tracked down the problem and it turns out that geronimo-ws-metadeta_2.0_spec-1.1.1.jar was being put on the WebLogic classpath twice, which was causing the error. Thanks again, Ben dkulp wrote: > > > It may be the xml-apis.jar. I'm not sure why we have it in lib. It > shouldn't be needed. I'll try excluding it and seeing if things still > build. > > Dan > > > On Thursday 07 February 2008, chengas123 wrote: >> Hi, >> I'm afraid I'm getting the QName issue again. I have no idea as to >> what was different in the very short span of time I was not getting >> the error. I do have the prefer-web-inf-classes set in my >> weblogic.xml file and I am using 2.0.4. Any other ideas on how I >> could track down the source of the issues? >> >> Thanks, >> Ben >> >> Barry Fitzgerald wrote: >> > Hello, >> > >> > I've had a similar problem before and I think you can fix it with a >> > prefer-web-inf-classes >> > element in your weblogic.xml. See here: >> > http://e-docs.bea.com/wls/docs92/webapp/weblogic_xml.html >> > >> > To set this on a server wide basis see here: >> > http://e-docs.bea.com/wls/docs92/programming/classloading.html >> > >> > Hope this helps, >> > >> > Barry >> >> Daniel Kulp wrote: >> > On Jan 31, 2008 9:07 PM, Daniel Kulp <[EMAIL PROTECTED]> wrote: >> >> FYI: for 2.0.4, we specifically switched to the geronimo version >> >> as it does NOT have the QName class in it like the stax-api version >> >> that we used in 2.0.3 does. Thus, the problem should be >> >> reduced. >> >> >> >> Dan > > > > -- > J. Daniel Kulp > Principal Engineer, IONA > [EMAIL PROTECTED] > http://www.dankulp.com/blog > > -- View this message in context: http://www.nabble.com/CXF-on-WebLogic-9.2-tp15193763p15362446.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Rest service necessary modules?
Hi I'm not sure how many modules a CXF-specific HTTP_BINDING requires, but it would be interesting to get a picture on how many modules a CXF JAX-RS frontend needs. The following dependencies are likely be needed only : cxf-rt-core cxf-api, cxf-common-utilities cxf-rt-transports-http cxf-rt-transports-http-jetty and possibly cxf-rt-databinding-jaxb Cheers, Sergey - Original Message - From: "Julio Arias" <[EMAIL PROTECTED]> To: Sent: Thursday, February 07, 2008 10:08 PM Subject: Rest service necessary modules? Hi - I'm having trouble initializing a server for a test, I think I'm missing some dep in my project I'm using the following: If I change all of that for the cxf-bundle artifact it works but it adds a lot of jars that I don't think I need, which are the minimum artifacts that I need. org.apache.cxf cxf-rt-core ${cxf.version} org.apache.cxf cxf-rt-frontend-jaxws ${cxf.version} org.apache.cxf cxf-rt-transports-http ${cxf.version} org.apache.cxf cxf-rt-bindings-http ${cxf.version} org.apache.cxf cxf-rt-bindings-soap ${cxf.version} @Before public void setup() { JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); sf.setServiceClass(SessionService.class); sf.getServiceFactory().setWrapped(true); sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID); sf.setAddress("http://localhost:9001/";); RestSessionService restSessionService = new RestSessionService(); sf.getServiceFactory().setInvoker(new BeanInvoker(restSessionService)); svr = sf.create(); } I got the following exception: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:128) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:147) at kaplan.scorelms.rte.ws.SessionServiceTest.setup(SessionServiceTest.java:33) 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.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) 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.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980) Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://schemas.xmlsoap.org/wsdl/http/. at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:106) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:199) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:97) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:108) ... 26 more -- Julio Arias Java Developer Roundbox Global : enterprise : technology : genius - Avenida 11 y Calle 7-9, Barrio Amón, San Jose, Costa Rica tel: (011) 506.258.3695 ext. 2001 | cell: (011) 506.849.5981 email: [EMAIL PROTECTED] | www.rbxglobal.com - IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelb
Re: CXF on WebLogic 9.2
It may be the xml-apis.jar. I'm not sure why we have it in lib. It shouldn't be needed. I'll try excluding it and seeing if things still build. Dan On Thursday 07 February 2008, chengas123 wrote: > Hi, > I'm afraid I'm getting the QName issue again. I have no idea as to > what was different in the very short span of time I was not getting > the error. I do have the prefer-web-inf-classes set in my > weblogic.xml file and I am using 2.0.4. Any other ideas on how I > could track down the source of the issues? > > Thanks, > Ben > > Barry Fitzgerald wrote: > > Hello, > > > > I've had a similar problem before and I think you can fix it with a > > prefer-web-inf-classes > > element in your weblogic.xml. See here: > > http://e-docs.bea.com/wls/docs92/webapp/weblogic_xml.html > > > > To set this on a server wide basis see here: > > http://e-docs.bea.com/wls/docs92/programming/classloading.html > > > > Hope this helps, > > > > Barry > > Daniel Kulp wrote: > > On Jan 31, 2008 9:07 PM, Daniel Kulp <[EMAIL PROTECTED]> wrote: > >> FYI: for 2.0.4, we specifically switched to the geronimo version > >> as it does NOT have the QName class in it like the stax-api version > >> that we used in 2.0.3 does. Thus, the problem should be > >> reduced. > >> > >> Dan -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: Multiple Services Question
Hmm... That should definitely work. I know it works for jaxws:endpoint defined services as the TCK puts multiple endpoints in a war in several places and I debugged some issues around it when they are in separate imported files for 2.0.4. Any chance you could send a war/project that demonstrates the issue? Dan On Wednesday 06 February 2008, JavaRunner wrote: > I must be missing something very simple. I've deployed a project with > multiple service classes. I had assumed that I would just add the > service definition to the cxf-servlet.xml file like this: > > address="/accounts"> > > > > > address="/pricing"> > > > > > > When deployed (to Tomcat) only ServiceA is visible/available. > Obviously there's another way. What am missing? -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: soap fault question
Rob, The JAX-WS spec covers this fairly extensively. You might want to read through section of 3.7 of the JAX-WS spec: https://jax-ws.dev.java.net/spec-download.html Basically, there are three ways to deal with "Service Specific Exceptions" (as the spec calls them): 1) Very low level: throw a SOAPFaultException This is the most conrollable from an exception standpoint as you control exactly what it looks like on the wire. However, this won't appear in the wsdl/xsd at all. It also sucks from a programmer standpoint (IMO) as you pretty much have to deal with all the XML stuff yourself. Not fun. I don't recommend it. 2) JAX-WS "mimic the generated code" method: You define the data you want returned to the client in it's own JAXB bean (not a subclass of Exception) and annotate it just like you would any other JAXB bean. Your exception would then just have one method: MyFaultDetail getFaultInfo() and a constructor like: MyException(String message, MyFaultDetail faultInfo) {...} You would also need to add a @WebFault annotation, but the defaults for everything should be OK with that. 3) JAX-WS mapping: If you put getter/setter things for each data element you want returned, we just create a simple sequence for it and use it. Nothing elaborate and not much can be done to customize the WSDL/XSD. In case 3, the RI requires that you run the wsgen stuff to create special JAXB bean objects for the exceptions that the runtime then uses by copying data to/from the exception to the bean. CXF doesn't require that. We'll work with the exception directly. Basically, if you need to control how things appear in the wsdl/xsd, option 2 is really the best bet. It's really just defining a type to put in the schema just like you would any other jaxb type. Dan On Thursday 07 February 2008, Rob Barrett wrote: > To clarify, I'm looking for an example of a soap:fault from a custom > exception thrown by a Java service published using a /> entry. > > I'm particularly interested in how to annotate the exception and how > the annotations affect the resulting wsdl/xsd representation, > > I also wouldn't mind knowing if there are specific base classes that > are intended for extension - e.g. SoapFault - or if they are just > meant to wrap custom exception content. > > The cxf doco in this area seems a bit light. > > Cheers, Rob > > On Feb 7, 2008 2:51 PM, Glen Mazza <[EMAIL PROTECTED]> wrote: > > I didn't need to annotate them, my example was WSDL-first. > > wsdl2java creates Java objects corresponding to those exceptions, > > now whether it adds annotations within those objects, I didn't > > bother to check, it doesn't matter for me. > > > > If you are doing Java-first, maybe the @WebFault annotation will > > help you. Google or wait for someone here more knowledgeable. I > > don't know much about that annotation. > > > > Glen > > > > Am Donnerstag, den 07.02.2008, 14:20 +1000 schrieb Rob Barrett: > > > Thanks Glen. > > > > > > How did you annotate these exceptions? > > > > > > import org.example.wordlookup.BasicFault; > > > import org.example.wordlookup.EntryAlreadyExistsFault; > > > import org.example.wordlookup.EntryNotFoundFault; > > > > > > > > > Cheers, Rob > > > > > > On Feb 7, 2008 1:11 PM, Glen Mazza <[EMAIL PROTECTED]> wrote: > > > > http://www.jroller.com/gmazza/date/20071019 ? Check steps #4, > > > > #6, and #10, for the WSDL, service, and client, respectively. > > > > > > > > HTH, > > > > Glen > > > > > > > > Am Donnerstag, den 07.02.2008, 07:50 +1000 schrieb Rob Barrett: > > > > > Does anyone have an example of how to create a soap:fault from > > > > > a custom exception thrown by a JAX-WS service? > > > > > > > > > > Cheers, Rob -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
CXFNonSpringServlet How-To?
Let me start by saying that I am somewhat new to the CXF library and to JAXWS in general. I would like to deploy the service under Tomcat 5.5. and I have been able to get one of the samples to work using the standard CXFServlet configuration. However, our application server environment does not include Spring, nor do we care to include it at this time. I would really like to trim out the spring libraries and bootstrapping from the CXF dependency list. How can I get a web service to listen on a servlet transport without using Spring? I have read earlier posts referring to the CXFNonSpringServlet, but when I substitute this class in the web.xml for Tomcat, it does not work. There is little in the way of an error message, other than: "Can't find the the request for http://myhost/services/hello_world's Observer". Thanks in advance! --Nick -- View this message in context: http://www.nabble.com/CXFNonSpringServlet-How-To--tp15356670p15356670.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Problem with attachment retrieval MTOM (CXF 2.0.4)
Yea, definitely don't rely on it being a ByteArrayInputStream. The DelegatingInputStream MIGHT be wrappering a ByteArrayInputStream, but if the attachment is large and we had to stop streaming, it's most likely been spooled to disk (so multi-megabyte attachments don't suck up all the memory) in a temp file so it would be wrappering a FileInputStream. If we're still streaming, it may be the raw HTTP input stream. In anycase, your code doesn't need the BAIS. Just cast it to an InputStream and you should be all set. Dan On Friday 08 February 2008, Ian Roberts wrote: > Ronald Pieterse wrote: > > and the file is uploaded. I though that if I just copy / paste and > > switch server code to client code and vice versa the download part > > would work too. It does indeed work until I try to do: > > > > bis = (ByteArrayInputStream) file.getData().getContent(); > > > > At that line a ClassCastException is thrown for the > > DelegatingInputStream on which I can find nothing. How do I handle > > this? > > The code you've included doesn't seem to do anything that requires a > ByteArrayInputStream (as opposed to just any old InputStream) so you > could just cast to InputStream, which should work OK. And if you get > something back from getContent() that isn't an InputStream then it > should be safe to call getInputStream on the DataHandler. > > Ian -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: More geronimo-javamail_1.4_spec-1.0-M1 bugs
Eric, I just noticed there is a 1.2 version (instead of 1.0-M1) at: http://repo1.maven.org/maven2/org/apache/geronimo/specs/geronimo-javamail_1.4_spec/ Any chance you could give it a whirl? I'd be happy to update our deps so future builds get that. Actually, I'll probably update all the geronimo-specs versions that we use shortly anyway. They have a vote going on for new versions of activation, ws-metadata, etc... as well. Dan On Thursday 07 February 2008, Eric Rodriguez wrote: > To let you know: > > I have found a bug on geronimo-javamail_1.4_spec-1.0-M1.jar, on > javax.mail.Service.connect(s1,s2,s3,s4), it completely ignores any > user property you have passed. It should look "URLName.getUsername()", > it its null then it looks for a property called > "mail.[protocol].user", then for "mail.user" and if it still is null > then it looks for > System.getProperty("user.name"), at least that's what sun's mail.jar > does. Geronimo's version however lacks the las 'if' condition, so it > always takes the System's "user.name" property! > > Just thought I should let you know. > > Regards, > Eric -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: CXF threading
Right now, a threadlocal would work. That said, ideally you would use the exchange for storage (for cxf interceptors) or the WebServiceContext for the jaxws stuff. That way, if we change things in the future, it wouldn't break. We keep talking about someday allowing the interceptor chain to be paused and then resumed on another thread. We're not there yet, but. Dan On Thursday 07 February 2008, Rob Barrett wrote: > Is it reasonable to use a ThreadLocal for holding request specific > metadata? i.e. are there cases where CXF can use more than one thread > to handle a request or where CXF handles more than one request on the > same thread? > > Or does this just depend on the configuration of the container e.g. > tomcat/jetty? > > If it's not a good thing to do then what is the preferred way to > attach metadata to a request? > > Thanks Rob -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: Problem with attachment retrieval MTOM (CXF 2.0.4)
Ronald Pieterse wrote: and the file is uploaded. I though that if I just copy / paste and switch server code to client code and vice versa the download part would work too. It does indeed work until I try to do: bis = (ByteArrayInputStream) file.getData().getContent(); At that line a ClassCastException is thrown for the DelegatingInputStream on which I can find nothing. How do I handle this? The code you've included doesn't seem to do anything that requires a ByteArrayInputStream (as opposed to just any old InputStream) so you could just cast to InputStream, which should work OK. And if you get something back from getContent() that isn't an InputStream then it should be safe to call getInputStream on the DataHandler. Ian -- Ian Roberts | Department of Computer Science [EMAIL PROTECTED] | University of Sheffield, UK
Problem with attachment retrieval MTOM (CXF 2.0.4)
I have a service with which I would like to upload and download files. The uploading part goes great - I make the upload call like so: UploadFileType uft = new UploadFileType(); uft.setFileName("somefilename.zip"); uft.setData(new DataHandler(new FileDataSource("/var/tmp/somefilename.zip"))); service.uploadFile(uft); then on the server I do: FileOutputStream fos = new FileOutputStream(new File("/var/tmp/" + file.getFileName())); ByteArrayInputStream bis = (ByteArrayInputStream) file.getData().getContent(); byte[] buffer = new byte[2048]; int bytesRead = bis.read(buffer); while (bytesRead >= 0) { fos.write(buffer, 0, bytesRead); bytesRead = bis.read(buffer); } ... and the file is uploaded. I though that if I just copy / paste and switch server code to client code and vice versa the download part would work too. It does indeed work until I try to do: bis = (ByteArrayInputStream) file.getData().getContent(); At that line a ClassCastException is thrown for the DelegatingInputStream on which I can find nothing. How do I handle this? The exception that is thrown: java.lang.ClassCastException: org.apache.cxf.attachment.DelegatingInputStream at com.tripolis.api.prototype.client.PrototypeServiceTest.testFileDownload(PrototypeServiceTest.java:54) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) -- View this message in context: http://www.nabble.com/Problem-with-attachment-retrieval-MTOM-%28CXF-2.0.4%29-tp15352705p15352705.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Use java.io.serialization for databinding
Using DataHandler/MTOM? http://www.jroller.com/gmazza/date/20071102 Glen Am Donnerstag, den 07.02.2008, 14:34 +0100 schrieb [EMAIL PROTECTED]: > Hi, > > I'm developing a simple webservice which can take any object as input that > implements java.io.serializable and can return any of those: > > @WebService > public interface SOAPService { > Object call(Object parameter); > } > > How can I tell cxf that it should transfer this parameter as simple > serializable attachement? > > Regards, > Heinrich Wendel > > > > Deutsches Zentrum für Luft- und Raumfahrt e.V. > in der Helmholtz-Gemeinschaft > > Simulation und Softwaretechnik (SISTEC) > > Heinrich Wendel > > Linder Höhe > 51147 Köln > Telefon: 02203 601-3305 > E-Mail: mailto:[EMAIL PROTECTED] > Internet: http://www.dlr.de >