Transactional web service using CXF, Spring and JPA
Greetings, I've been experimenting with creating a transactional web service using CXF, Spring and JPA/Hibernate. The basic examples I've seen of such services look like this: @Transactional @WebService(...) public class MyService implements MyServiceInterface { @PersistenceContext private EntityManager em; public void myOperation() throws DataAccessException { ... // use injected entity manager em.find(...) ... } } and the Spring config has this: tx:annotation-driven transaction-manager=transactionManager / ... jaxws:server id=myService serviceClass=MyServiceInterface address=/Service jaxws:serviceBean bean id=myServiceBean class=MyService autowire=autodetect / /jaxws:serviceBean /jaxws:server Here's what I would expect to happen with a transactional web service based on JPA: - Request begins - System begins new unit of database work by creating a new EntityManager - All database interactions in the request use the same EntityManager - Request finishes processing - Transaction commits or rolls back (if an error occurred) - Response sent As far as I can tell, Spring is only creating one instance of my service bean, and injecting a single EntityManager into it when it does so. This clearly won't work when handling multiple concurrent requests, since EntityManager is not thread-safe and a new one needs to be instantiated for each unit of work. Is the above setup actually right? Can anyone point me to an example of how to wire this all together correctly? I'm about to give up on using Spring transactional support and go back to just implementing my own simple transactional wrapper and making the EntityManager available to DAOs through a ThreadLocal. Thanks, Karl __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: possible problems in mixing https and http?
It seems my trouble continues. I think I should try to explain the situation again: We have a CXF web service client (A) that access a CXF web service (S) through a content switch (CS), such that the client speaks HTTPS with the content switch, who in turn speak plain HTTP with the web service: (A) ---HTTPS--- (CS) ---HTTP--- (S) The web service (S) has a WSDL that refer to a schema much like this: wsdl:types xsd:schema targetNamespace=http://ns.com/xsd; xsd:import namespace=http://ns.com/xsd; schemaLocation=Schema.xsd/ /xsd:schema /wsdl:types The schema is deployed as part of the web application (ie. it's in the .war). Now, when we deploy this service, CXF modifies the published WSDL so that the schemaLocation attribute comes up with this value: wsdl:types xsd:schema targetNamespace=http://ns.com/xsd; xsd:import namespace=http://ns.com/xsd; schemaLocation=http://server.com/application/services/Service?xsd=Schema.xsd/ /xsd:schema /wsdl:types Notice how the schemaLocation points to a plain HTTP address. Initially, we thought that we could just make all HTTP calls to the server be redirected to their respective HTTPS counterparts - and this trick does indeed work well with our Ruby clients, however, the CXF clients does not respond correctly to the redirect (2.0.3-incubator-SNAPSHOT): [Fatal Error] :-1:-1: Premature end of file. Exception in thread main javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.apache.cxf.jaxws.ServiceImpl.init(ServiceImpl.java:109) at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:55) at javax.xml.ws.Service.init(Service.java:57) at my.client.Main.main(Main.java:125) Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.apache.cxf.wsdl11.WSDLServiceFactory.init(WSDLServiceFactory.java:83) at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:115) at org.apache.cxf.jaxws.ServiceImpl.init(ServiceImpl.java:107) ... 8 more Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'http://server.com/application/services/Service?xsd=Schema.xsd'.: org.xml.sax.SAXParseException: Premature end of file. at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:199) at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:163) at org.apache.cxf.wsdl11.WSDLServiceFactory.init(WSDLServiceFactory.java:81) ... 10 more Caused by: org.xml.sax.SAXParseException: Premature end of file. at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292) ... 23 more And I think this is because... We just use java's URL to get wsdl not the HTTPConduit. ... which, it seems since I tested it out (1.5.0_07-87), can't handle redirects. So, I'm at a crossroad: I can (1) make the content switch use HTTPS when speaking with the service (S), I could (2) further lobby you guys to add configurations that would let me control the URL generation in CXF, or (3) I could ask you to handle redirects. Personally, I'm in a hurry, so I'm rushing ahead with (1), but (3) kind of seems like a bug in my eyes, and (2) would also be nice though not that important (to me, personally) if (3) works. 2007/11/1, Willem Jiang [EMAIL PROTECTED]: AFAIK, HTTPConduit will not take any charge to load WSDL related information. We just use java's URL to get wsdl not the HTTPConduit. Willem. Christian Vest Hansen wrote: I'm not quite sure fixing that jira will solve this particular issue. It seems to me that CXF has trouble connecting to anything HTTP once it has been configured to use HTTPS. 2007/11/1, Willem Jiang [EMAIL PROTECTED]: Hi Christian, I think we could achieve you goal by letting service that CXF published the WSDL with user defined , so you could add what you want https or http protocol
Re: Transactional web service using CXF, Spring and JPA
Hi, You need to delegate the transaction to spring, not the cxf. like: jaxws:endpoint id=myService implementorClass=net.java.dev.service.MyServiceImpl implementor=#myService address=/theService /jaxws:endpoint bean id=myService class=net.java.dev.service.MyServiceImpl /bean ... here the myService is with transaction, with other spring-specific config to add transaction. Best Regards Jeff Karl Goldstein wrote: Greetings, I've been experimenting with creating a transactional web service using CXF, Spring and JPA/Hibernate. The basic examples I've seen of such services look like this: @Transactional @WebService(...) public class MyService implements MyServiceInterface { @PersistenceContext private EntityManager em; public void myOperation() throws DataAccessException { ... // use injected entity manager em.find(...) ... } } and the Spring config has this: tx:annotation-driven transaction-manager=transactionManager / ... jaxws:server id=myService serviceClass=MyServiceInterface address=/Service jaxws:serviceBean bean id=myServiceBean class=MyService autowire=autodetect / /jaxws:serviceBean /jaxws:server Here's what I would expect to happen with a transactional web service based on JPA: - Request begins - System begins new unit of database work by creating a new EntityManager - All database interactions in the request use the same EntityManager - Request finishes processing - Transaction commits or rolls back (if an error occurred) - Response sent As far as I can tell, Spring is only creating one instance of my service bean, and injecting a single EntityManager into it when it does so. This clearly won't work when handling multiple concurrent requests, since EntityManager is not thread-safe and a new one needs to be instantiated for each unit of work. Is the above setup actually right? Can anyone point me to an example of how to wire this all together correctly? I'm about to give up on using Spring transactional support and go back to just implementing my own simple transactional wrapper and making the EntityManager available to DAOs through a ThreadLocal. Thanks, Karl __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: wsdlLocation
I don't recall seeing a response on this question, does anyone have any thoughts on this problem? Thanks, David On 10/31/07, David W Sica [EMAIL PROTECTED] wrote: I'm trying to deploy a WS where I'm defining the wsdlLocation in my SOAPPortImpl file as WEB-INF/wsdl/file.wsdl. In my wsdl, I am importing several XSDs as: xs:import namespace= http://url; schemaLocation=file.xsd/ I'm using a beans.xml file as: beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / . . . However, I can't seem to get Tomcat6 to find both the WSDL and XSD files. Right now it's finding the WSDL but not the XSDs. It's trying to find the XSD files in %TOMCATHOME%\bin. Any hints would be greatly appreciated! Thanks, David
getting nosuchmethoderrror when requesting CXFServlet
Hi everybody, when trying to request the CXFServlet (and my services) from the browser, I get a NoSuchMethodError (stack trace below). Actually I have no idea, why this happens, because obviously the spring-beans-2.0.4.jar (which is included in the WEB-INF/lib - see below) contains the org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setNamespaceHandlerResolver(...) method. My cxf.xml is: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws jaxws.xsd jaxws:endpoint id=moduleServiceImpl implementor=modulverwaltung.service.ModuleServiceImpl address=https://www.mi.fu-berlin.de/modulverwaltung/services/ModuleService; / /beans My WEB-INF/lib contains the following jars: activation.jar aopalliance-1.0.jar asm.jar castor-1.0.jar cglib-2.1.jar commons-beanutils-1.7.0.jar commons-betwixt-0.8-dev.jar commons-codec-1.3.jar commons-collections-3.1.jar commons-dbcp-1.2.1.jar commons-digester-1.7.jar commons-httpclient-3.0.1.jar commons-lang-2.1.jar commons-logging-1.1.jar commons-pool-1.2.jar commons-transaction-1.1.jar cxf-2.0.2-incubator.jar db-ojb-1.0.4.jar geronimo-annotation_1.0_spec-1.1.jar geronimo-ws-metadata_2.0_spec-1.1.1.jar itext-1.4.6.jar jaxb-api-2.0.jar jaxb-impl-2.0.5.jar jaxb-xjc-2.0.jar jaxws-api-2.0.jar jdom-1.0.jar jetty-6.1.5.jar jetty-util-6.1.5.jar jstl.jar kvvservice.jar log4j-1.2.13.jar mail.jar neethi-2.0.2.jar p6spy-1.3-patched.jar postgresql.jar saaj-api-1.3.jar saaj-impl-1.3.jar spring-beans-2.0.4.jar spring-context-2.0.4.jar spring-core-2.0.4.jar spring-web-2.0.4.jar standard.jar stax-api-1.0.1.jar taglibs-string.jar utilities.jar velocity-1.4.jar wsdl4j-1.6.1.jar wstx-asl-3.2.1.jar xercesImpl.jar xml-resolver-1.2.jar XmlSchema-1.2.jar Stack trace: ERROR: [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/modulverwaltung]] StandardWrapper.Throwable java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setNamespaceHandlerResolver(Lorg/springframework/ beans/factory/xml/NamespaceHandlerResolver;)V at org.apache.cxf.bus.spring.BusApplicationContext.initBeanDefinitionReader(BusApplicationContext.java:174) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java: 89) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:269) at org.apache.cxf.bus.spring.BusApplicationContext.init(BusApplicationContext.java:71) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:84) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:156) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) 2007-11-05 17:03:50 ERROR: [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/modulverwaltung].[CXFServlet]] Allocate exception for servlet CXFSer vlet java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setNamespaceHandlerResolver(Lorg/springframework/ beans/factory/xml/NamespaceHandlerResolver;)V at
Re: Transactional web service using CXF, Spring and JPA
Yep, CXF has the invoker[1] to take care the whole invoking stuff. Jeff just showed you the basic use scenario which treats the implementor as a singleton in the default bean Invoker. All the client sides concurrency invocations will be end up in this singleton invoker, so we can still use the spring to transaction management here. [1]http://cwiki.apache.org/CXF20DOC/invokers.html Willem. Jeff Yu wrote: Hi, You need to delegate the transaction to spring, not the cxf. like: jaxws:endpoint id=myService implementorClass=net.java.dev.service.MyServiceImpl implementor=#myService address=/theService /jaxws:endpoint bean id=myService class=net.java.dev.service.MyServiceImpl /bean ... here the myService is with transaction, with other spring-specific config to add transaction. Best Regards Jeff Karl Goldstein wrote: Greetings, I've been experimenting with creating a transactional web service using CXF, Spring and JPA/Hibernate. The basic examples I've seen of such services look like this: @Transactional @WebService(...) public class MyService implements MyServiceInterface { @PersistenceContext private EntityManager em; public void myOperation() throws DataAccessException { ... // use injected entity manager em.find(...) ... } } and the Spring config has this: tx:annotation-driven transaction-manager=transactionManager / ... jaxws:server id=myService serviceClass=MyServiceInterface address=/Service jaxws:serviceBean bean id=myServiceBean class=MyService autowire=autodetect / /jaxws:serviceBean /jaxws:server Here's what I would expect to happen with a transactional web service based on JPA: - Request begins - System begins new unit of database work by creating a new EntityManager - All database interactions in the request use the same EntityManager - Request finishes processing - Transaction commits or rolls back (if an error occurred) - Response sent As far as I can tell, Spring is only creating one instance of my service bean, and injecting a single EntityManager into it when it does so. This clearly won't work when handling multiple concurrent requests, since EntityManager is not thread-safe and a new one needs to be instantiated for each unit of work. Is the above setup actually right? Can anyone point me to an example of how to wire this all together correctly? I'm about to give up on using Spring transactional support and go back to just implementing my own simple transactional wrapper and making the EntityManager available to DAOs through a ThreadLocal. Thanks, Karl __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: ClientFactoryBean AbstractMethodError
hanks. That doesn't really explain, to me, why the server starts up fine when deployed but fails with the error shown when run in a JUnit test. The demo is able to create a service in JUnit without problem. In this particular JUnit, rather than relying on Spring configuration, I was attempting to create the server myself using the following code: private Server createRestServer(SessionFactory sessionFactory) { MyServiceImpl service = new MyServiceImpl(); service.setSessionFactory(sessionFactory); JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); sf.setServiceClass(MyServiceInterface.class); sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID); sf.setAddress(http://localhost:8080/rest/;); sf.getServiceFactory().setInvoker(new BeanInvoker(service)); sf.getServiceFactory().setWrapped(true); return sf.create(); } This is almost exactly the same as the server code from the demo - the code that works. However, in my example I receive the stack trace from above on the sf.create() method. On 11/4/07, Liu, Jervis [EMAIL PROTECTED] wrote: I probabaly should remove JAX-WS style client codes from restful_http_binding demo, as it constantly causes confusions. In theory, JAX-WS style client APIs should work with RESTful services that published using CXF HTTP binding, as this is symmetric to what the server side has to do to marshal/unmarshal request/response. But in reality, this does not work because a). This JAX-WS style client APIs support is not completed yet. b). I don't think there will be much value added by supporting JAX-WS style client APIs. This JAX-WS style client APIs wont work without a WSDL, most RESTful services wont have a WSDL. More comments about client side REST API support can be found in [1]. [1]. http://www.nabble.com/Using-verbs-other-than-GET-from-a-RESTful-client-application-tf4628659.html Cheers, Jervis -Original Message- From: Todd Orr [mailto:[EMAIL PROTECTED] Sent: 2007?11?5? 10:41 To: cxf-user@incubator.apache.org Subject: ClientFactoryBean AbstractMethodError I have been trying to get a REST service up and running. I believe the server is up. However, creating the client is problematic. Using the following code borrowed from the bundled rest sample: JaxWsProxyFactoryBean sf = new JaxWsProxyFactoryBean(); sf.setServiceClass(MyServiceInterface.class); // Turn off wrapped mode to make our xml prettier sf.getServiceFactory().setWrapped(false); // Use the HTTP Binding which understands the Java Rest Annotations sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP _BINDING_ID); sf.setAddress(http://localhost:8080/rest/;); this.service = (MyServiceInterface) sf.create(); I receive the following exception: java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getInputEncoding()Ljava/lan g/String; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess orImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth odAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.ws.commons.schema.utils.DOMUtil.getInputEncoding(DO MUtil.java:594) at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchem aCollection.java:348) at org.apache.cxf.databinding.source.AbstractDataBinding.addSchem aDocument(AbstractDataBinding.java:73) at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding .java:224) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.bu ildServiceFromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.in itializeServiceModel(ReflectionServiceFactoryBean.java:333) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.cr eate(ReflectionServiceFactoryBean.java:151) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(Ja xWsServiceFactoryBean.java:93) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.creat eEndpoint(AbstractWSDLBasedEndpointFactory.java:74) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactory Bean.java:51) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientPr oxyFactoryBean.java:89) at com.foo.bar.RestTest.injectDependencies(RestTest.java:30) at org.springframework.test.AbstractDependencyInjectionSpringCont extTests.prepareTestInstance(AbstractDependencyInjectionSpring ContextTests.java:158) at org.springframework.test.AbstractSingleSpringContextTests.setU p(AbstractSingleSpringContextTests.java:88) at junit.framework.TestCase.runBare(TestCase.java:125) at org.springframework.test.ConditionalTestCase.runBare(Condition
Re: other spring cxf resources ?
Hi , Actually, you could change the client's service URL per message. You can find more information here [1] [1]http://www.nabble.com/Client-question-tf4357978.html#a12419843 Willem. Mohammad Shamsi wrote: Hi Glen, Sorry, my application is not really a distributed app. i just run it on 9 servers, all 9 server connect to one database, but they are work standalone. and they don't know about each other. for some reason i wan't to collect some info from each app server and show them together in one client. Service in all 9 Server is same, but at least in URL, they are deferent. http://server1:port/MyService http://server2:port2/MyService http://server3:port3/MyService . . . On 11/4/07, Glen Mazza [EMAIL PROTECTED] wrote: Do you have a WSDL? Just follow the links I gave. That fact that you have 9 servers or 900 shouldn't matter--the URL in the WSDL would be the same for all the servers your app is distributed on (just as it is the same for your web application as a whole, correct?) Glen Am Sonntag, den 04.11.2007, 21:42 +0330 schrieb Mohammad Shamsi: Hi All, I have a spring based Java EE application, this application destirbuted on 9 servers, i want to add a Web Service to this application, i want now how to call these 9 servers web service with a client ? i read spring cxf sample, client part of this sample in beans.xmlare somthing like this : bean id=client class=demo.spring.HelloWorldImpl factory-bean=clientFactory factory-method=create/ bean id=clientFactory class= org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=demo.spring.HelloWorld/ property name=address value= http://localhost:8080/cxf/wscxf/HelloWorld/ /bean with this guide, i have to define 9 bean like this client bean and 9 clientFactory bean. is there any simpler way to do this?
Re: Maturity
Greg, There was a thread about this on TheServerSide this weekend. I did reply with the only information I'm allowed to provide. :-( http://www.theserverside.com/discussions/thread.tss?thread_id=47448 Dan On Wednesday 31 October 2007, Greg Thoenen wrote: Thanks for the reply, Christian. Is there anyone else out there willing to give a brief answer to these two of my original questions: Is CXF considered production ready? If so, is anyone using it in production systems, and what are people's experiences regarding its production readiness? Thanks much, Greg -Original Message- From: Christian Vest Hansen [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 23, 2007 3:18 PM To: cxf-user@incubator.apache.org Subject: Re: Maturity We are using CXF to build an SSO and general intergration platform at my workplace. We initially started out with XFire but decided in the last minute (and about three days after CXF 2.0 was released IIRC) to go with CXF instead, even though it meant scraping some of work we already had done on some general components. We did this even though XFire is very mature and production ready, because if you want to build software with a future, it's best to use technologies that have a future as well; CXF is young and has its kinks, but it also has momentum and a growing community as far as I can tell, and this made it a better option for us then XFire. I personally consider CXF production ready; we haven't got any CXF services in production systems just yet, though we have some handfuls in staging environments and they are humming along quite handsomly. 2007/10/23, Greg Thoenen [EMAIL PROTECTED]: Hi, all. I'm currently evaluating web service frameworks that might provide our web services on the server side. CXF is a top contender, but I'm a little confused about its maturity. It is still in the Apache incubator, however it has releases that appear to me to be production releases (e.g. 2.0.1, as opposed to 2.0-MC1 or 2.0-RC1, etc.). This leads me to some (related) questions: Is CXF considered production ready? If so, is anyone using it in production systems, and what are people's experiences regarding its production readiness? An unrelated question that may be pretty ignorant (sorry) is why Apache is sponsoring CXF rather than modifying the web service framework (Axis2) that it already is invested in? Was it deemed that it would take more effort to modify Axis2 to support JAX-WS, etc., as to start with XFire and do it? Thanks in advance, Greg -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: ClientFactoryBean AbstractMethodError
Hi , Can you check xercesImpl-2.8.1.jar is in the class path of your test with JUnit? I can find the method org.apache.xerces.dom.DocumentImpl.getInputEncoding() in that jar. Willem. Todd Orr wrote: hanks. That doesn't really explain, to me, why the server starts up fine when deployed but fails with the error shown when run in a JUnit test. The demo is able to create a service in JUnit without problem. In this particular JUnit, rather than relying on Spring configuration, I was attempting to create the server myself using the following code: private Server createRestServer(SessionFactory sessionFactory) { MyServiceImpl service = new MyServiceImpl(); service.setSessionFactory(sessionFactory); JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); sf.setServiceClass(MyServiceInterface.class); sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID); sf.setAddress(http://localhost:8080/rest/;); sf.getServiceFactory().setInvoker(new BeanInvoker(service)); sf.getServiceFactory().setWrapped(true); return sf.create(); } This is almost exactly the same as the server code from the demo - the code that works. However, in my example I receive the stack trace from above on the sf.create() method. On 11/4/07, Liu, Jervis [EMAIL PROTECTED] wrote: I probabaly should remove JAX-WS style client codes from restful_http_binding demo, as it constantly causes confusions. In theory, JAX-WS style client APIs should work with RESTful services that published using CXF HTTP binding, as this is symmetric to what the server side has to do to marshal/unmarshal request/response. But in reality, this does not work because a). This JAX-WS style client APIs support is not completed yet. b). I don't think there will be much value added by supporting JAX-WS style client APIs. This JAX-WS style client APIs wont work without a WSDL, most RESTful services wont have a WSDL. More comments about client side REST API support can be found in [1]. [1]. http://www.nabble.com/Using-verbs-other-than-GET-from-a-RESTful-client-application-tf4628659.html Cheers, Jervis -Original Message- From: Todd Orr [mailto:[EMAIL PROTECTED] Sent: 2007?11?5? 10:41 To: cxf-user@incubator.apache.org Subject: ClientFactoryBean AbstractMethodError I have been trying to get a REST service up and running. I believe the server is up. However, creating the client is problematic. Using the following code borrowed from the bundled rest sample: JaxWsProxyFactoryBean sf = new JaxWsProxyFactoryBean(); sf.setServiceClass(MyServiceInterface.class); // Turn off wrapped mode to make our xml prettier sf.getServiceFactory().setWrapped(false); // Use the HTTP Binding which understands the Java Rest Annotations sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP _BINDING_ID); sf.setAddress(http://localhost:8080/rest/;); this.service = (MyServiceInterface) sf.create(); I receive the following exception: java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getInputEncoding()Ljava/lan g/String; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess orImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth odAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.ws.commons.schema.utils.DOMUtil.getInputEncoding(DO MUtil.java:594) at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchem aCollection.java:348) at org.apache.cxf.databinding.source.AbstractDataBinding.addSchem aDocument(AbstractDataBinding.java:73) at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding .java:224) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.bu ildServiceFromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.in itializeServiceModel(ReflectionServiceFactoryBean.java:333) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.cr eate(ReflectionServiceFactoryBean.java:151) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(Ja xWsServiceFactoryBean.java:93) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.creat eEndpoint(AbstractWSDLBasedEndpointFactory.java:74) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactory Bean.java:51) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientPr oxyFactoryBean.java:89) at com.foo.bar.RestTest.injectDependencies(RestTest.java:30) at org.springframework.test.AbstractDependencyInjectionSpringCont extTests.prepareTestInstance(AbstractDependencyInjectionSpring ContextTests.java:158) at
Re: Mulitple protocols on one IMPL?
Hi, You can use JAXWS API to publish different transport with a single implementor. eg. Endpoint.publish(Address some where, implemetor); But for your JMS transport , you need to do some configuration to setup the JMS address. You can find some information here [1] and some discussions in the cxf-dev mail list[2] [1]http://cwiki.apache.org/CXF20DOC/jax-ws-java-first-with-jms-transport.html [2]http://www.nabble.com/SOAP-over-JMS-Questions-tf4744699.html#a13567840 Willem. Patrick Mulligan wrote: Hi, Is it possible to have multiple protocols on a single running instance of an IMPL in CXF? Or do I need to start two seperate instances? For example, ServiceA running soap/http and ServiceA running JMS. This questions applies to standalone server and spring deployments. _ Help yourself to FREE treats served up daily at the Messenger Café. Stop by today. http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline
test
test
Re: wsdlLocation
Hmmm...shouldn't the XSD's be in the same directory as the WSDL (i.e., WEB-INF/wsdl)? According to here[1], that's where they need to be. HTH, Glen [1]http://blogs.sun.com/manveen/entry/converting_an_existing_webservice_to Am Montag, den 05.11.2007, 08:50 -0700 schrieb David W Sica: I don't recall seeing a response on this question, does anyone have any thoughts on this problem? Thanks, David On 10/31/07, David W Sica [EMAIL PROTECTED] wrote: I'm trying to deploy a WS where I'm defining the wsdlLocation in my SOAPPortImpl file as WEB-INF/wsdl/file.wsdl. In my wsdl, I am importing several XSDs as: xs:import namespace= http://url; schemaLocation=file.xsd/ I'm using a beans.xml file as: beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / . . . However, I can't seem to get Tomcat6 to find both the WSDL and XSD files. Right now it's finding the WSDL but not the XSDs. It's trying to find the XSD files in %TOMCATHOME%\bin. Any hints would be greatly appreciated! Thanks, David
Re: ClientFactoryBean AbstractMethodError
That seems to have worked. Thanks! On 11/5/07, Willem Jiang [EMAIL PROTECTED] wrote: Hi , Can you check xercesImpl-2.8.1.jar is in the class path of your test with JUnit? I can find the method org.apache.xerces.dom.DocumentImpl.getInputEncoding() in that jar. Willem. Todd Orr wrote: hanks. That doesn't really explain, to me, why the server starts up fine when deployed but fails with the error shown when run in a JUnit test. The demo is able to create a service in JUnit without problem. In this particular JUnit, rather than relying on Spring configuration, I was attempting to create the server myself using the following code: private Server createRestServer(SessionFactory sessionFactory) { MyServiceImpl service = new MyServiceImpl(); service.setSessionFactory(sessionFactory); JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); sf.setServiceClass(MyServiceInterface.class); sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID); sf.setAddress(http://localhost:8080/rest/;); sf.getServiceFactory().setInvoker(new BeanInvoker(service)); sf.getServiceFactory().setWrapped(true); return sf.create(); } This is almost exactly the same as the server code from the demo - the code that works. However, in my example I receive the stack trace from above on the sf.create() method. On 11/4/07, Liu, Jervis [EMAIL PROTECTED] wrote: I probabaly should remove JAX-WS style client codes from restful_http_binding demo, as it constantly causes confusions. In theory, JAX-WS style client APIs should work with RESTful services that published using CXF HTTP binding, as this is symmetric to what the server side has to do to marshal/unmarshal request/response. But in reality, this does not work because a). This JAX-WS style client APIs support is not completed yet. b). I don't think there will be much value added by supporting JAX-WS style client APIs. This JAX-WS style client APIs wont work without a WSDL, most RESTful services wont have a WSDL. More comments about client side REST API support can be found in [1]. [1]. http://www.nabble.com/Using-verbs-other-than-GET-from-a-RESTful-client-application-tf4628659.html Cheers, Jervis -Original Message- From: Todd Orr [mailto:[EMAIL PROTECTED] Sent: 2007?11?5? 10:41 To: cxf-user@incubator.apache.org Subject: ClientFactoryBean AbstractMethodError I have been trying to get a REST service up and running. I believe the server is up. However, creating the client is problematic. Using the following code borrowed from the bundled rest sample: JaxWsProxyFactoryBean sf = new JaxWsProxyFactoryBean(); sf.setServiceClass(MyServiceInterface.class); // Turn off wrapped mode to make our xml prettier sf.getServiceFactory().setWrapped(false); // Use the HTTP Binding which understands the Java Rest Annotations sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP _BINDING_ID); sf.setAddress(http://localhost:8080/rest/;); this.service = (MyServiceInterface) sf.create(); I receive the following exception: java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getInputEncoding()Ljava/lan g/String; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess orImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth odAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.ws.commons.schema.utils.DOMUtil.getInputEncoding(DO MUtil.java:594) at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchem aCollection.java:348) at org.apache.cxf.databinding.source.AbstractDataBinding.addSchem aDocument(AbstractDataBinding.java:73) at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding .java:224) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.bu ildServiceFromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.in itializeServiceModel(ReflectionServiceFactoryBean.java:333) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.cr eate(ReflectionServiceFactoryBean.java:151) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(Ja xWsServiceFactoryBean.java:93) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.creat eEndpoint(AbstractWSDLBasedEndpointFactory.java:74) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactory Bean.java:51) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientPr oxyFactoryBean.java:89) at com.foo.bar.RestTest.injectDependencies(RestTest.java:30) at
Re: getting nosuchmethoderrror when requesting CXFServlet
Hi again, I got the problem solved by cleaning up my WEB-INF/lib directory from my Tomcat installation. Regards, Abid Abid Hussain schrieb: Hi everybody, when trying to request the CXFServlet (and my services) from the browser, I get a NoSuchMethodError (stack trace below). Actually I have no idea, why this happens, because obviously the spring-beans-2.0.4.jar (which is included in the WEB-INF/lib - see below) contains the org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setNamespaceHandlerResolver(...) method. My cxf.xml is: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws jaxws.xsd jaxws:endpoint id=moduleServiceImpl implementor=modulverwaltung.service.ModuleServiceImpl address=https://www.mi.fu-berlin.de/modulverwaltung/services/ModuleService; / /beans My WEB-INF/lib contains the following jars: activation.jar aopalliance-1.0.jar asm.jar castor-1.0.jar cglib-2.1.jar commons-beanutils-1.7.0.jar commons-betwixt-0.8-dev.jar commons-codec-1.3.jar commons-collections-3.1.jar commons-dbcp-1.2.1.jar commons-digester-1.7.jar commons-httpclient-3.0.1.jar commons-lang-2.1.jar commons-logging-1.1.jar commons-pool-1.2.jar commons-transaction-1.1.jar cxf-2.0.2-incubator.jar db-ojb-1.0.4.jar geronimo-annotation_1.0_spec-1.1.jar geronimo-ws-metadata_2.0_spec-1.1.1.jar itext-1.4.6.jar jaxb-api-2.0.jar jaxb-impl-2.0.5.jar jaxb-xjc-2.0.jar jaxws-api-2.0.jar jdom-1.0.jar jetty-6.1.5.jar jetty-util-6.1.5.jar jstl.jar kvvservice.jar log4j-1.2.13.jar mail.jar neethi-2.0.2.jar p6spy-1.3-patched.jar postgresql.jar saaj-api-1.3.jar saaj-impl-1.3.jar spring-beans-2.0.4.jar spring-context-2.0.4.jar spring-core-2.0.4.jar spring-web-2.0.4.jar standard.jar stax-api-1.0.1.jar taglibs-string.jar utilities.jar velocity-1.4.jar wsdl4j-1.6.1.jar wstx-asl-3.2.1.jar xercesImpl.jar xml-resolver-1.2.jar XmlSchema-1.2.jar Stack trace: ERROR: [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/modulverwaltung]] StandardWrapper.Throwable java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setNamespaceHandlerResolver(Lorg/springframework/ beans/factory/xml/NamespaceHandlerResolver;)V at org.apache.cxf.bus.spring.BusApplicationContext.initBeanDefinitionReader(BusApplicationContext.java:174) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java: 89) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:269) at org.apache.cxf.bus.spring.BusApplicationContext.init(BusApplicationContext.java:71) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:84) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:156) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:791) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:127) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) 2007-11-05 17:03:50 ERROR: [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/modulverwaltung].[CXFServlet]] Allocate exception for servlet CXFSer vlet java.lang.NoSuchMethodError:
Help! Aegis not mapping Java.Util.Collection properly
Hello, I am having a problem trying to return a 'complex object' that contains a java.util.collection as one of the properties. I've written a SOAP service using Aegis binding and I want to pass in a generic return type from the various data accessing functions I have written. I am getting this error in my SOAPUI: Mon Nov 05 13:17:48 EST 2007:WARN: error: src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. I have defined the class as such: @XmlType(name = wsResponse, namespace = http://soap.ws.test.com/;) public class wsResponseT { protected CollectionT response; protected String sName; protected String sessionId; public wsResponse(CollectionT os) { this.response = os; } public wsResponse() { } public void setResponse(CollectionT response) { this.response = response; } public CollectionT getResponse() { return response; } ... (other setters//getters) } Please help, I have been held up for 2 days! Though there are no real examples out there, the Xfire/CXF docs 'claim' this should be automatic with Java 1.5 Thanks! -Tony
Marshalling Error: xxxxxx is not known to this context
Hi there, I don't know how to overcome this error. Marshalling Error: xx is not known to this context I see from the bug list that it is recommend that one uses ServerFactoryBean svrBean = new ServerFactoryBean(); svrBean.setAddress(http://localhost/Hello;); svrBean.setServiceClass(HelloService.class); svrBean.setBus(getBus()); Map props = svrBean.getProperties(); if (props == null) { props = new HashMapString, Object(); } props.put(jaxb.additionalContextClasses, new Class[] {java.rmi.Remote.class, java.rmi.RemoteException.class}); svrBean.setProperties(props); svrBean.create(); But where is one supposed to put this code? I am using annotations and the web.xml as well as the following in the applicationContext.xml import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / jaxws:endpoint id=itestWebService implementor=#itestWebServiceBean address=/ITestWebService / thanks Mark === Cyber Connect - More than just broadband http://www.CyberConnect.co.za - Vodacom 3G R99/month Cyber Designs - Put your business on the net http://www.CyberDesigns.co.za Jumping Bean - Your Java and Linux Experts http://www.JumpingBean.co.za Tel: 011-781 80 14 Fax: 011-781 80 15 === Disclaimer Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising.
Re: wsdlLocation
Can you send me a war file or similar that shows the issue? (private direct to me is fine as well) Definitely a lot easier to diagnose if I have a sample. Dan On Wednesday 31 October 2007, David W Sica wrote: I'm trying to deploy a WS where I'm defining the wsdlLocation in my SOAPPortImpl file as WEB-INF/wsdl/file.wsdl. In my wsdl, I am importing several XSDs as: xs:import namespace=http://url; schemaLocation=file.xsd/ I'm using a beans.xml file as: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / . . . However, I can't seem to get Tomcat6 to find both the WSDL and XSD files. Right now it's finding the WSDL but not the XSDs. It's trying to find the XSD files in %TOMCATHOME%\bin. Any hints would be greatly appreciated! Thanks, David -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
pojo object return type not included in wsdl as complextype
Hi there, I can;t get cfx to place the definition of a pojo into the wsdl as a complextyope. On the interface I have tried the following: == import . @WebService public interface ISimpleBankAccount{ @ResponseWrapper(className=Balance) public Balance doDebit(Double amount); @ResponseWrapper(className=Balance) public Balance doCredit(Double amount); } public class Balance(){ java.util.Date date; Double balance; Double previousBlanace; getter and setters } What am I doing wrong? === Cyber Connect - More than just broadband http://www.CyberConnect.co.za - Vodacom 3G R99/month Cyber Designs - Put your business on the net http://www.CyberDesigns.co.za Jumping Bean - Your Java and Linux Experts http://www.JumpingBean.co.za Tel: 011-781 80 14 Fax: 011-781 80 15 === Disclaimer Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising.
RE: pojo object return type not included in wsdl as complextype
Try using the xmltype annotation in your object, ala: @XmlType(name = Balance, namespace = http://object.package.com/;) So for example I have my objects in com.package.object - you need to define it in that namespace -Original Message- From: Mark Clarke [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 3:32 PM To: cxf-user@incubator.apache.org Subject: pojo object return type not included in wsdl as complextype Hi there, I can;t get cfx to place the definition of a pojo into the wsdl as a complextyope. On the interface I have tried the following: == import . @WebService public interface ISimpleBankAccount{ @ResponseWrapper(className=Balance) public Balance doDebit(Double amount); @ResponseWrapper(className=Balance) public Balance doCredit(Double amount); } public class Balance(){ java.util.Date date; Double balance; Double previousBlanace; getter and setters } What am I doing wrong? === Cyber Connect - More than just broadband http://www.CyberConnect.co.za - Vodacom 3G R99/month Cyber Designs - Put your business on the net http://www.CyberDesigns.co.za Jumping Bean - Your Java and Linux Experts http://www.JumpingBean.co.za Tel: 011-781 80 14 Fax: 011-781 80 15 === Disclaimer Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising.
Specifying minOccurs for primitive properties with Simple Server
Pardon me if this has been answered already - couldn't find it anywhere in Nabble. Is there a way to specify minOccurs for primitive properties with the Simple Server? Since many of our consumers use dynamic languages that do not have default values for primitives I am forced to use complex types for Integers, Longs, Boolean's, etc. for parameters that should be optional. This is a problem with many of our developers as they are used to using primitive ints, longs and booleans. Example: public class MyArg { Integer foo; public Integer getFoo() { // getter} public void setFoo(Integer foo) { // setter} } we would like it to be: public class MyArg { int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } Any options? Regards, Kaleb
2.0.3 Breaking my services in new and awful ways compared to 2.0.2
Hello, I'm trying to use last night's 2.0.3 snapshot to see if it resolves an issue I'm having with collections, but I am getting a massive exception when my app reloads - it's some kinda of no such method error. Nov 5, 2007 2:58:04 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sBoardService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.getExtReg()Lorg/apache/ ws/commons/schema/extensions/ExtensionRegistry; Caused by: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.getExtReg()Lorg/apache/ ws/commons/schema/extensions/ExtensionRegistry; at org.apache.cxf.databinding.source.AbstractDataBinding.addSchemaDocument( AbstractDataBinding.java:72) at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisDat abinding.java:376) at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabi nding.java:171) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildService FromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeSe rviceModel(ReflectionServiceFactoryBean.java:333) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Refle ctionServiceFactoryBean.java:151) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsService FactoryBean.java:93) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint( AbstractWSDLBasedEndpointFactory.java:74) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java: 108) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBea n.java:147) at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:288) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:228) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:341) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1214 ) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1179) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFac tory.createBean(AbstractAutowireCapableBeanFactory.java:427) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObjec t(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.g etSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab stractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Ab stractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.pre InstantiateSingletons(DefaultListableBeanFactory.java:279) at org.springframework.context.support.AbstractApplicationContext.refresh(A bstractApplicationContext.java:360) at org.springframework.web.context.ContextLoader.createWebApplicationContex t(ContextLoader.java:241) at org.springframework.web.context.ContextLoader.initWebApplicationContext( ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized (ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.j ava:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714) at
Re: 2.0.3 Breaking my services in new and awful ways compared to 2.0.2
Anthony, Check the version of XmlSchema jar that is found. Due to a BUNCH of bugs in 1.2, we had to upgrade to 1.3.2.The error you show below suggests that 1.2 was picked up on the classpath somehow. Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Hello, I'm trying to use last night's 2.0.3 snapshot to see if it resolves an issue I'm having with collections, but I am getting a massive exception when my app reloads - it's some kinda of no such method error. Nov 5, 2007 2:58:04 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sBoardService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.getExtReg()Lorg/apach e/ ws/commons/schema/extensions/ExtensionRegistry; Caused by: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.getExtReg()Lorg/apach e/ ws/commons/schema/extensions/ExtensionRegistry; at org.apache.cxf.databinding.source.AbstractDataBinding.addSchemaDocumen t( AbstractDataBinding.java:72) at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisD at abinding.java:376) at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisData bi nding.java:171) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServi ce FromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initialize Se rviceModel(ReflectionServiceFactoryBean.java:333) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Ref le ctionServiceFactoryBean.java:151) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServi ce FactoryBean.java:93) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoin t( AbstractWSDLBasedEndpointFactory.java:74) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.jav a: 108) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryB ea n.java:147) at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:288) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:228) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:341) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j av a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess or Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanF ac tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:12 14 ) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanF ac tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1179) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanF ac tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanF ac tory.createBean(AbstractAutowireCapableBeanFactory.java:427) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObj ec t(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry .g etSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean( Ab stractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean( Ab stractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.p re InstantiateSingletons(DefaultListableBeanFactory.java:279) at org.springframework.context.support.AbstractApplicationContext.refresh (A bstractApplicationContext.java:360) at org.springframework.web.context.ContextLoader.createWebApplicationCont ex t(ContextLoader.java:241) at org.springframework.web.context.ContextLoader.initWebApplicationContex t( ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitializ ed (ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext .j ava:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:43 37 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase. ja va:791) at
RE: 2.0.3 Breaking my services in new and awful ways compared to 2.0.2
Dan, Thanks very much, I thought I had deleted it but I guess not. Any thoughts on why I might be getting this other schema error when I try to make a request to a function that Returns a Java object that houses a Java.util.collection that is generic - eg defined as CollectionT c? src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 3:47 PM To: cxf-user@incubator.apache.org Cc: Vespa, Anthony J Subject: Re: 2.0.3 Breaking my services in new and awful ways compared to 2.0.2 Anthony, Check the version of XmlSchema jar that is found. Due to a BUNCH of bugs in 1.2, we had to upgrade to 1.3.2.The error you show below suggests that 1.2 was picked up on the classpath somehow. Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Hello, I'm trying to use last night's 2.0.3 snapshot to see if it resolves an issue I'm having with collections, but I am getting a massive exception when my app reloads - it's some kinda of no such method error. Nov 5, 2007 2:58:04 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sBoardService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.getExtReg()Lorg/apach e/ ws/commons/schema/extensions/ExtensionRegistry; Caused by: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.getExtReg()Lorg/apach e/ ws/commons/schema/extensions/ExtensionRegistry; at org.apache.cxf.databinding.source.AbstractDataBinding.addSchemaDocumen t( AbstractDataBinding.java:72) at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisD at abinding.java:376) at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisData bi nding.java:171) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServi ce FromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initialize Se rviceModel(ReflectionServiceFactoryBean.java:333) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Ref le ctionServiceFactoryBean.java:151) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServi ce FactoryBean.java:93) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoin t( AbstractWSDLBasedEndpointFactory.java:74) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.jav a: 108) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryB ea n.java:147) at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:288) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:228) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:341) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j av a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess or Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanF ac tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:12 14 ) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanF ac tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1179) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanF ac tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanF ac tory.createBean(AbstractAutowireCapableBeanFactory.java:427) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObj ec t(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry .g etSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean( Ab stractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean( Ab stractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.p re InstantiateSingletons(DefaultListableBeanFactory.java:279) at org.springframework.context.support.AbstractApplicationContext.refresh (A bstractApplicationContext.java:360) at
Re: 2.0.3 Breaking my services in new and awful ways compared to 2.0.2
You have a stack trace? Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Dan, Thanks very much, I thought I had deleted it but I guess not. Any thoughts on why I might be getting this other schema error when I try to make a request to a function that Returns a Java object that houses a Java.util.collection that is generic - eg defined as CollectionT c? src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 3:47 PM To: cxf-user@incubator.apache.org Cc: Vespa, Anthony J Subject: Re: 2.0.3 Breaking my services in new and awful ways compared to 2.0.2 Anthony, Check the version of XmlSchema jar that is found. Due to a BUNCH of bugs in 1.2, we had to upgrade to 1.3.2.The error you show below suggests that 1.2 was picked up on the classpath somehow. Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Hello, I'm trying to use last night's 2.0.3 snapshot to see if it resolves an issue I'm having with collections, but I am getting a massive exception when my app reloads - it's some kinda of no such method error. Nov 5, 2007 2:58:04 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sBoardService': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.getExtReg()Lorg/apa ch e/ ws/commons/schema/extensions/ExtensionRegistry; Caused by: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.getExtReg()Lorg/apa ch e/ ws/commons/schema/extensions/ExtensionRegistry; at org.apache.cxf.databinding.source.AbstractDataBinding.addSchemaDocum en t( AbstractDataBinding.java:72) at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(Aegi sD at abinding.java:376) at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDa ta bi nding.java:171) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildSer vi ce FromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initiali ze Se rviceModel(ReflectionServiceFactoryBean.java:333) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(R ef le ctionServiceFactoryBean.java:151) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsSer vi ce FactoryBean.java:93) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpo in t( AbstractWSDLBasedEndpointFactory.java:74) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.j av a: 108) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactor yB ea n.java:147) at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:288) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:228) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:341) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl .j av a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce ss or Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBea nF ac tory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java: 12 14 ) at org.springframework.beans.factory.support.AbstractAutowireCapableBea nF ac tory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1179) at org.springframework.beans.factory.support.AbstractAutowireCapableBea nF ac tory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145) at org.springframework.beans.factory.support.AbstractAutowireCapableBea nF ac tory.createBean(AbstractAutowireCapableBeanFactory.java:427) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getO bj ec t(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegist ry .g etSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBea n( Ab stractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBea n( Ab stractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory .p re
Re: Specifying minOccurs for primitive properties with Simple Server
Hmm...Not really sure. I suppose you could try something like: public class MyArg { @XmlElement(type = Integer.class, required = false) int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } That might work. That said, the Java 5 autoboxing should work and allow the non-primitive forms to work.Even with public void setFoo(Integer foo), you should be able to call setFoo(12) or similar. Dan On Monday 05 November 2007, Kaleb Walton wrote: Pardon me if this has been answered already - couldn't find it anywhere in Nabble. Is there a way to specify minOccurs for primitive properties with the Simple Server? Since many of our consumers use dynamic languages that do not have default values for primitives I am forced to use complex types for Integers, Longs, Boolean's, etc. for parameters that should be optional. This is a problem with many of our developers as they are used to using primitive ints, longs and booleans. Example: public class MyArg { Integer foo; public Integer getFoo() { // getter} public void setFoo(Integer foo) { // setter} } we would like it to be: public class MyArg { int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } Any options? Regards, Kaleb -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: pojo object return type not included in wsdl as complextype
Mark, You might be hitting a class name conflict issue: @ResponseWrapper(className=Balance) public Balance doCredit(Double amount) You have a Balance object for the return type, but you are also using a Balance object for the response wrapper. Is that intended? Also, the className attribute should point to a fully qualified (with package) class name that we can do a Class.forName(...) with. Dan On Monday 05 November 2007, Mark Clarke wrote: Hi there, I can;t get cfx to place the definition of a pojo into the wsdl as a complextyope. On the interface I have tried the following: == import . @WebService public interface ISimpleBankAccount{ @ResponseWrapper(className=Balance) public Balance doDebit(Double amount); @ResponseWrapper(className=Balance) public Balance doCredit(Double amount); } public class Balance(){ java.util.Date date; Double balance; Double previousBlanace; getter and setters } What am I doing wrong? === Cyber Connect - More than just broadband http://www.CyberConnect.co.za - Vodacom 3G R99/month Cyber Designs - Put your business on the net http://www.CyberDesigns.co.za Jumping Bean - Your Java and Linux Experts http://www.JumpingBean.co.za Tel: 011-781 80 14 Fax: 011-781 80 15 === Disclaimer Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising. -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
RE: 2.0.3 Breaking my services in new and awful ways compared to 2.0.2
The issue is occurring within soap ui 176. As below: Mon Nov 05 15:57:31 EST 2007:INFO:Loading schema types from [http://dws2600:/services/sBoardService?wsdl] Mon Nov 05 15:57:31 EST 2007:INFO:Getting schema http://dws2600.bos.cbsig.net:/services/sBoardService?wsdl Mon Nov 05 15:57:31 EST 2007:INFO:schema for [http://www.w3.org/2001/XMLSchema] contained [{}] namespaces Mon Nov 05 15:57:31 EST 2007:INFO:schema for [http://soap.ws.test.com/] contained [{}] namespaces Mon Nov 05 15:57:31 EST 2007:ERROR:An error occured [http://dws2600:/services/sBoardService?wsdl:0: error: src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found.], see error log for details Mon Nov 05 15:57:31 EST 2007:WARN:Error: http://dws2600:/services/sBoardService?wsdl:0: error: src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. Mon Nov 05 15:57:31 EST 2007:ERROR:Loading of definition failed for [http://dws2600:/services/sBoardService?wsdl]; com.eviware.soapui.impl.wsdl.support.xsd.SchemaException: Error loading schema types Mon Nov 05 15:57:31 EST 2007:ERROR:An error occured [Error loading schema types], see error log for details Now, if I use my front end client I can get some kinda of response back in XML, but it has replaced my typed generic collection as anytype, as below. Basically I have three objects I want inside my message object - and I'd like 1) for it to work in SoapUI for testing and 2) I'd like the names to be something more reasonable, not just anyType - soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; - soap:Body - ns1:getMessagesForMessageBoardResponse xmlns:ns1=http://soap.ws.bos.test.com/; - ns1:getMessagesForMessageBoardResult - ns1:response - ns2:anyType xmlns:ns2=http://www.w3.org/2001/XMLSchema; xmlns:ns3=http://www.w3.org/2001/XMLSchema-instance; ns3:type=ns1:wsMessage - ns1:authorCache ns1:domainThe Dark Side/ns1:domain ns1:externalIdentityId1/ns1:externalIdentityId ns1:mottoLet me tell you a story/ns1:motto ns1:screenNameDarth Vespa/ns1:screenName /ns1:authorCache ns1:createDate2007-10-08T12:35:58-04:00/ns1:createDate ns1:messageBoardId1/ns1:messageBoardId ns1:messageId1/ns1:messageId ns1:messageText... standing outside a bar on a rainy day, when all of sudden the weirdest thing happened./ns1:messageText ns1:parentComment ns3:nil=true / ns1:titleSo there we were .../ns1:title /ns2:anyType - ns2:anyType xmlns:ns2=http://www.w3.org/2001/XMLSchema; xmlns:ns3=http://www.w3.org/2001/XMLSchema-instance; ns3:type=ns1:wsMessage - ns1:authorCache ns1:domainEvil Empire/ns1:domain ns1:externalIdentityId2/ns1:externalIdentityId ns1:mottoDeath is not too good for my enemies/ns1:motto ns1:screenNameEvil Overlord/ns1:screenName /ns1:authorCache ns1:createDate2007-10-08T12:35:58-04:00/ns1:createDate ns1:messageBoardId1/ns1:messageBoardId ns1:messageId2/ns1:messageId ns1:messageTextI hope this isn't another 10' tall chicken sighting./ns1:messageText ns1:parentComment1/ns1:parentComment ns1:titleRE: So there we were .../ns1:title /ns2:anyType - ns2:anyType xmlns:ns2=http://www.w3.org/2001/XMLSchema; xmlns:ns3=http://www.w3.org/2001/XMLSchema-instance; ns3:type=ns1:wsMessage - ns1:authorCache ns1:domainGalactic Librarians/ns1:domain ns1:externalIdentityId3/ns1:externalIdentityId ns1:mottoI deny your reality/ns1:motto ns1:screenNameEpisarch/ns1:screenName /ns1:authorCache ns1:createDate2007-10-08T12:35:58-04:00/ns1:createDate ns1:messageBoardId1/ns1:messageBoardId ns1:messageId3/ns1:messageId ns1:messageTextCouldn't be stranger than my life./ns1:messageText ns1:parentComment1/ns1:parentComment ns1:titleRE: So there we were .../ns1:title /ns2:anyType - ns2:anyType xmlns:ns2=http://www.w3.org/2001/XMLSchema; xmlns:ns3=http://www.w3.org/2001/XMLSchema-instance; ns3:type=ns1:wsMessage - ns1:authorCache ns1:domainThe Dark Side/ns1:domain ns1:externalIdentityId1/ns1:externalIdentityId ns1:mottoLet me tell you a story/ns1:motto ns1:screenNameDarth Vespa/ns1:screenName /ns1:authorCache ns1:createDate2007-10-08T12:35:58-04:00/ns1:createDate ns1:messageBoardId1/ns1:messageBoardId ns1:messageId5/ns1:messageId ns1:messageTextWhich reminds me of another time/ns1:messageText ns1:parentComment1/ns1:parentComment ns1:titleRE: So there we were .../ns1:title /ns2:anyType - ns2:anyType xmlns:ns2=http://www.w3.org/2001/XMLSchema; xmlns:ns3=http://www.w3.org/2001/XMLSchema-instance; ns3:type=ns1:wsMessage - ns1:authorCache ns1:domainGargleblasters.com/ns1:domain ns1:externalIdentityId4/ns1:externalIdentityId ns1:mottoOh no, not again!/ns1:motto ns1:screenNamePetunia/ns1:screenName /ns1:authorCache ns1:createDate2007-10-08T12:35:58-04:00/ns1:createDate ns1:messageBoardId1/ns1:messageBoardId ns1:messageId6/ns1:messageId ns1:messageTextHello? Anyone out there?/ns1:messageText ns1:parentComment
Re: Specifying minOccurs for primitive properties with Simple Server
Thanks for the suggestion. Right now since we use the Simple Server we have ZERO annotations in our Java classes and we want to keep it that way so that method will not work for us. If you can think of any other configuration option that I can specify in my Spring config, or if there's some file that I can create to include meta data about how to serialize the class please let me know as this is one of the last little things that's getting in our way :) Thanks again for all your consideration! Regards, Kaleb | | From: | | --| |Daniel Kulp [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Cc:| | --| |Kaleb Walton/Southfield/[EMAIL PROTECTED] | --| | | Date: | | --| |11/05/2007 03:56 PM | --| | | Subject: | | --| |Re: Specifying minOccurs for primitive properties with Simple Server | --| Hmm...Not really sure. I suppose you could try something like: public class MyArg { @XmlElement(type = Integer.class, required = false) int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } That might work. That said, the Java 5 autoboxing should work and allow the non-primitive forms to work.Even with public void setFoo(Integer foo), you should be able to call setFoo(12) or similar. Dan On Monday 05 November 2007, Kaleb Walton wrote: Pardon me if this has been answered already - couldn't find it anywhere in Nabble. Is there a way to specify minOccurs for primitive properties with the Simple Server? Since many of our consumers use dynamic languages that do not have default values for primitives I am forced to use complex types for Integers, Longs, Boolean's, etc. for parameters that should be optional. This is a problem with many of our developers as they are used to using primitive ints, longs and booleans. Example: public class MyArg { Integer foo; public Integer getFoo() { // getter} public void setFoo(Integer foo) { // setter} } we would like it to be: public class MyArg { int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } Any options? Regards, Kaleb -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
RE: Specifying minOccurs for primitive properties with Simple Server
This is for what we invented Aegis, I think. You can do some of these things in XML files. From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:13 PM To: cxf-user@incubator.apache.org Cc: Daniel Kulp Subject: Re: Specifying minOccurs for primitive properties with Simple Server Thanks for the suggestion. Right now since we use the Simple Server we have ZERO annotations in our Java classes and we want to keep it that way so that method will not work for us. If you can think of any other configuration option that I can specify in my Spring config, or if there's some file that I can create to include meta data about how to serialize the class please let me know as this is one of the last little things that's getting in our way :) Thanks again for all your consideration! Regards, Kaleb Inactive hide details for Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure.Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure. From: Daniel Kulp [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Cc: Kaleb Walton/Southfield/[EMAIL PROTECTED] Date: 11/05/2007 03:56 PM Subject: Re: Specifying minOccurs for primitive properties with Simple Server Hmm...Not really sure. I suppose you could try something like: public class MyArg { @XmlElement(type = Integer.class, required = false) int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } That might work. That said, the Java 5 autoboxing should work and allow the non-primitive forms to work.Even with public void setFoo(Integer foo), you should be able to call setFoo(12) or similar. Dan On Monday 05 November 2007, Kaleb Walton wrote: Pardon me if this has been answered already - couldn't find it anywhere in Nabble. Is there a way to specify minOccurs for primitive properties with the Simple Server? Since many of our consumers use dynamic languages that do not have default values for primitives I am forced to use complex types for Integers, Longs, Boolean's, etc. for parameters that should be optional. This is a problem with many of our developers as they are used to using primitive ints, longs and booleans. Example: public class MyArg { Integer foo; public Integer getFoo() { // getter} public void setFoo(Integer foo) { // setter} } we would like it to be: public class MyArg { int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } Any options? Regards, Kaleb -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
RE: Specifying minOccurs for primitive properties with Simple Server
Ok - I'll definitely research that a bit more. Thank you for the tip! Regards, Kaleb | | From: | | --| |Benson Margulies [EMAIL PROTECTED] | --| | | To:| | --| |cxf-user@incubator.apache.org | --| | | Cc:| | --| |Daniel Kulp [EMAIL PROTECTED] | --| | | Date: | | --| |11/05/2007 04:16 PM | --| | | Subject: | | --| |RE: Specifying minOccurs for primitive properties with Simple Server | --| This is for what we invented Aegis, I think. You can do some of these things in XML files. From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:13 PM To: cxf-user@incubator.apache.org Cc: Daniel Kulp Subject: Re: Specifying minOccurs for primitive properties with Simple Server Thanks for the suggestion. Right now since we use the Simple Server we have ZERO annotations in our Java classes and we want to keep it that way so that method will not work for us. If you can think of any other configuration option that I can specify in my Spring config, or if there's some file that I can create to include meta data about how to serialize the class please let me know as this is one of the last little things that's getting in our way :) Thanks again for all your consideration! Regards, Kaleb Inactive hide details for Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure.Daniel Kulp ---11/05/2007 03:56:32 PM---Hmm... Not really sure. From: Daniel Kulp [EMAIL PROTECTED] To: cxf-user@incubator.apache.org Cc: Kaleb Walton/Southfield/[EMAIL PROTECTED] Date: 11/05/2007 03:56 PM Subject: Re: Specifying minOccurs for primitive properties with Simple Server Hmm...Not really sure. I suppose you could try something like: public class MyArg { @XmlElement(type = Integer.class, required = false) int foo; public int getFoo() { // getter} public void setFoo(int foo) { // setter} } That might work. That said, the Java 5 autoboxing should work and allow the non-primitive forms to work.Even with public void setFoo(Integer foo), you should be able to call setFoo(12) or similar. Dan On Monday 05 November 2007, Kaleb Walton wrote: Pardon me if this has been answered already - couldn't find it anywhere in Nabble. Is there a way to specify minOccurs for primitive properties with the Simple Server? Since many of our consumers use dynamic languages that do not have default values for primitives I am forced to use complex types for Integers, Longs, Boolean's, etc. for parameters that should be optional. This is a problem with many of our developers as they are used to using primitive ints, longs and booleans. Example: public class MyArg { Integer foo; public Integer getFoo() { // getter} public void setFoo(Integer foo) { // setter} } we
Re: Help! Aegis not mapping Java.Util.Collection properly
I'm not an aegis expert at all, but I believe the claim is that the generics work on the Collections, but not on other classes.Thus, ListInteger will map to int in the schema, but FooInteger is not mapped.Basically, we only look at the generics if its an instance of a collection and at that point, we ONLY look at that collection. We don't going searching up all the declarations to figure out where the generics expansion came from. That said, mapping to the anyType should have worked. Generating an invalid wsdl is definitely a bug. Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Hello, I am having a problem trying to return a 'complex object' that contains a java.util.collection as one of the properties. I've written a SOAP service using Aegis binding and I want to pass in a generic return type from the various data accessing functions I have written. I am getting this error in my SOAPUI: Mon Nov 05 13:17:48 EST 2007:WARN: error: src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. I have defined the class as such: @XmlType(name = wsResponse, namespace = http://soap.ws.test.com/;) public class wsResponseT { protected CollectionT response; protected String sName; protected String sessionId; public wsResponse(CollectionT os) { this.response = os; } public wsResponse() { } public void setResponse(CollectionT response) { this.response = response; } public CollectionT getResponse() { return response; } ... (other setters//getters) } Please help, I have been held up for 2 days! Though there are no real examples out there, the Xfire/CXF docs 'claim' this should be automatic with Java 1.5 Thanks! -Tony -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
RE: Help! Aegis not mapping Java.Util.Collection properly
Okie, so what is the next step? Do I need to log a bug for this? I'm not really 100% on why the mapping is broken. -T -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:32 PM To: cxf-user@incubator.apache.org Cc: Vespa, Anthony J Subject: Re: Help! Aegis not mapping Java.Util.Collection properly I'm not an aegis expert at all, but I believe the claim is that the generics work on the Collections, but not on other classes.Thus, ListInteger will map to int in the schema, but FooInteger is not mapped.Basically, we only look at the generics if its an instance of a collection and at that point, we ONLY look at that collection. We don't going searching up all the declarations to figure out where the generics expansion came from. That said, mapping to the anyType should have worked. Generating an invalid wsdl is definitely a bug. Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Hello, I am having a problem trying to return a 'complex object' that contains a java.util.collection as one of the properties. I've written a SOAP service using Aegis binding and I want to pass in a generic return type from the various data accessing functions I have written. I am getting this error in my SOAPUI: Mon Nov 05 13:17:48 EST 2007:WARN: error: src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. I have defined the class as such: @XmlType(name = wsResponse, namespace = http://soap.ws.test.com/;) public class wsResponseT { protected CollectionT response; protected String sName; protected String sessionId; public wsResponse(CollectionT os) { this.response = os; } public wsResponse() { } public void setResponse(CollectionT response) { this.response = response; } public CollectionT getResponse() { return response; } ... (other setters//getters) } Please help, I have been held up for 2 days! Though there are no real examples out there, the Xfire/CXF docs 'claim' this should be automatic with Java 1.5 Thanks! -Tony -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: Help! Aegis not mapping Java.Util.Collection properly
On Monday 05 November 2007, Vespa, Anthony J wrote: Okie, so what is the next step? Do I need to log a bug for this? I'm not really 100% on why the mapping is broken. I have it fixed. :-) Running the test suite now. There were two issues: 1) We were generating the ArrayOfAnyType into the http://www.w3.org/2001/XMLSchema namespace which is really wrong as thats a standard namespace that we shouldn't be generating anything into. 2) Because that namespace is a standard one, we don't create an xsd:import element for it.Thus, the SOAPui parser/validator cannot find it. Fixing (1) actually fixes this. Dan -T -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:32 PM To: cxf-user@incubator.apache.org Cc: Vespa, Anthony J Subject: Re: Help! Aegis not mapping Java.Util.Collection properly I'm not an aegis expert at all, but I believe the claim is that the generics work on the Collections, but not on other classes.Thus, ListInteger will map to int in the schema, but FooInteger is not mapped.Basically, we only look at the generics if its an instance of a collection and at that point, we ONLY look at that collection. We don't going searching up all the declarations to figure out where the generics expansion came from. That said, mapping to the anyType should have worked. Generating an invalid wsdl is definitely a bug. Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Hello, I am having a problem trying to return a 'complex object' that contains a java.util.collection as one of the properties. I've written a SOAP service using Aegis binding and I want to pass in a generic return type from the various data accessing functions I have written. I am getting this error in my SOAPUI: Mon Nov 05 13:17:48 EST 2007:WARN: error: src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. I have defined the class as such: @XmlType(name = wsResponse, namespace = http://soap.ws.test.com/;) public class wsResponseT { protected CollectionT response; protected String sName; protected String sessionId; public wsResponse(CollectionT os) { this.response = os; } public wsResponse() { } public void setResponse(CollectionT response) { this.response = response; } public CollectionT getResponse() { return response; } ... (other setters//getters) } Please help, I have been held up for 2 days! Though there are no real examples out there, the Xfire/CXF docs 'claim' this should be automatic with Java 1.5 Thanks! -Tony -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
RE: wsdlLocation
Thanks Dan, just sent you a private response with the war. David -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 1:19 PM To: cxf-user@incubator.apache.org Cc: David W Sica Subject: Re: wsdlLocation Can you send me a war file or similar that shows the issue? (private direct to me is fine as well) Definitely a lot easier to diagnose if I have a sample. Dan On Wednesday 31 October 2007, David W Sica wrote: I'm trying to deploy a WS where I'm defining the wsdlLocation in my SOAPPortImpl file as WEB-INF/wsdl/file.wsdl. In my wsdl, I am importing several XSDs as: xs:import namespace=http://url; schemaLocation=file.xsd/ I'm using a beans.xml file as: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / . . . However, I can't seem to get Tomcat6 to find both the WSDL and XSD files. Right now it's finding the WSDL but not the XSDs. It's trying to find the XSD files in %TOMCATHOME%\bin. Any hints would be greatly appreciated! Thanks, David -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: pojo object return type not included in wsdl as complextype
Mark, The class pointed at by the ResponseWrapper should NEVER be the same as the return type. The ResponseWrapper class should point to a bean that holds onto the return type as a member. (as well as any out types from any holders) In you case, it would need to point to something like: public class DoCreditResponse { private Balance _return; public Balance get_return() { return _return; } public void set_return(Balance b) { _return = b; } } If you are using CXF 2.0.2 (if not, you really need to update) and doing complete code first development, you probably should just avoid using the @ResponseWrapper annotation entirely and let the runtime handle it. 2.0.2 doesn't need the the generated wrapper classes. In anycase, definitely check what version of CXF you're using. There have been a TON of fixes to the codefirst stuff since 2.0. Dan On Monday 05 November 2007, Mark Clarke wrote: Hi Daniel, The example was a quick and dirty to give some idea of what I am trying. From what I have read the className attribute should point to the fQN of the class, in my example I am assuming default packahe but the same would apply for any other package namespace. As the return type and the className refer to the same class I assume they would be the same? My basic problem is that any return type that is not a standard java.lang object just throws errors like Marshalling Errror: class is not know to this context Its quiet frustrating. I didnt have this problem with xfire :( Daniel Kulp wrote: Mark, You might be hitting a class name conflict issue: @ResponseWrapper(className=Balance) public Balance doCredit(Double amount) You have a Balance object for the return type, but you are also using a Balance object for the response wrapper. Is that intended? Also, the className attribute should point to a fully qualified (with package) class name that we can do a Class.forName(...) with. Dan On Monday 05 November 2007, Mark Clarke wrote: Hi there, I can;t get cfx to place the definition of a pojo into the wsdl as a complextyope. On the interface I have tried the following: == import . @WebService public interface ISimpleBankAccount{ @ResponseWrapper(className=Balance) public Balance doDebit(Double amount); @ResponseWrapper(className=Balance) public Balance doCredit(Double amount); } public class Balance(){ java.util.Date date; Double balance; Double previousBlanace; getter and setters } What am I doing wrong? === Cyber Connect - More than just broadband http://www.CyberConnect.co.za - Vodacom 3G R99/month Cyber Designs - Put your business on the net http://www.CyberDesigns.co.za Jumping Bean - Your Java and Linux Experts http://www.JumpingBean.co.za Tel: 011-781 80 14 Fax: 011-781 80 15 === Disclaimer Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising. === Cyber Connect - More than just broadband http://www.CyberConnect.co.za - Vodacom 3G R99/month Cyber Designs - Put your business on the net http://www.CyberDesigns.co.za Jumping Bean - Your Java and Linux Experts http://www.JumpingBean.co.za Tel: 011-781 80 14 Fax: 011-781 80 15 === Disclaimer Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising. -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: pojo object return type not included in wsdl as complextype
Hi Daniel, The example was a quick and dirty to give some idea of what I am trying. From what I have read the className attribute should point to the fQN of the class, in my example I am assuming default packahe but the same would apply for any other package namespace. As the return type and the className refer to the same class I assume they would be the same? My basic problem is that any return type that is not a standard java.lang object just throws errors like Marshalling Errror: class is not know to this context Its quiet frustrating. I didnt have this problem with xfire :( Daniel Kulp wrote: Mark, You might be hitting a class name conflict issue: @ResponseWrapper(className=Balance) public Balance doCredit(Double amount) You have a Balance object for the return type, but you are also using a Balance object for the response wrapper. Is that intended? Also, the className attribute should point to a fully qualified (with package) class name that we can do a Class.forName(...) with. Dan On Monday 05 November 2007, Mark Clarke wrote: Hi there, I can;t get cfx to place the definition of a pojo into the wsdl as a complextyope. On the interface I have tried the following: == import . @WebService public interface ISimpleBankAccount{ @ResponseWrapper(className=Balance) public Balance doDebit(Double amount); @ResponseWrapper(className=Balance) public Balance doCredit(Double amount); } public class Balance(){ java.util.Date date; Double balance; Double previousBlanace; getter and setters } What am I doing wrong? === Cyber Connect - More than just broadband http://www.CyberConnect.co.za - Vodacom 3G R99/month Cyber Designs - Put your business on the net http://www.CyberDesigns.co.za Jumping Bean - Your Java and Linux Experts http://www.JumpingBean.co.za Tel: 011-781 80 14 Fax: 011-781 80 15 === Disclaimer Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising. === Cyber Connect - More than just broadband http://www.CyberConnect.co.za - Vodacom 3G R99/month Cyber Designs - Put your business on the net http://www.CyberDesigns.co.za Jumping Bean - Your Java and Linux Experts http://www.JumpingBean.co.za Tel: 011-781 80 14 Fax: 011-781 80 15 === Disclaimer Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any liability in respect of such communication, and the employee responsible will be personally liable for any damages or other liability arising.
RE: Help! Aegis not mapping Java.Util.Collection properly
A jira would be most helpful. -Original Message- From: Vespa, Anthony J [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:46 PM To: Daniel Kulp; cxf-user@incubator.apache.org Subject: RE: Help! Aegis not mapping Java.Util.Collection properly Okie, so what is the next step? Do I need to log a bug for this? I'm not really 100% on why the mapping is broken. -T -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:32 PM To: cxf-user@incubator.apache.org Cc: Vespa, Anthony J Subject: Re: Help! Aegis not mapping Java.Util.Collection properly I'm not an aegis expert at all, but I believe the claim is that the generics work on the Collections, but not on other classes.Thus, ListInteger will map to int in the schema, but FooInteger is not mapped.Basically, we only look at the generics if its an instance of a collection and at that point, we ONLY look at that collection. We don't going searching up all the declarations to figure out where the generics expansion came from. That said, mapping to the anyType should have worked. Generating an invalid wsdl is definitely a bug. Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Hello, I am having a problem trying to return a 'complex object' that contains a java.util.collection as one of the properties. I've written a SOAP service using Aegis binding and I want to pass in a generic return type from the various data accessing functions I have written. I am getting this error in my SOAPUI: Mon Nov 05 13:17:48 EST 2007:WARN: error: src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. I have defined the class as such: @XmlType(name = wsResponse, namespace = http://soap.ws.test.com/;) public class wsResponseT { protected CollectionT response; protected String sName; protected String sessionId; public wsResponse(CollectionT os) { this.response = os; } public wsResponse() { } public void setResponse(CollectionT response) { this.response = response; } public CollectionT getResponse() { return response; } ... (other setters//getters) } Please help, I have been held up for 2 days! Though there are no real examples out there, the Xfire/CXF docs 'claim' this should be automatic with Java 1.5 Thanks! -Tony -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
RE: Help! Aegis not mapping Java.Util.Collection properly
Thank you so much! So to clarify a couple things (apologies if this is redundant I just want to make sure I understand) -Once this issue is fixed, will the any-type resolve to being the actual types on my collection, or will it still be any type and this just fixes the breakage in the SoapUI tool? -Will this then be going into 2.0.3, and if so, when will 2.0.3 be fully released as a finished item? I didn't see any dates for it in my inspection of the docs and sites. Thanks again!! -Tony From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Mon 11/5/2007 4:56 PM To: cxf-user@incubator.apache.org Cc: Vespa, Anthony J Subject: Re: Help! Aegis not mapping Java.Util.Collection properly On Monday 05 November 2007, Vespa, Anthony J wrote: Okie, so what is the next step? Do I need to log a bug for this? I'm not really 100% on why the mapping is broken. I have it fixed. :-) Running the test suite now. There were two issues: 1) We were generating the ArrayOfAnyType into the http://www.w3.org/2001/XMLSchema namespace which is really wrong as thats a standard namespace that we shouldn't be generating anything into. 2) Because that namespace is a standard one, we don't create an xsd:import element for it.Thus, the SOAPui parser/validator cannot find it. Fixing (1) actually fixes this. Dan -T -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:32 PM To: cxf-user@incubator.apache.org Cc: Vespa, Anthony J Subject: Re: Help! Aegis not mapping Java.Util.Collection properly I'm not an aegis expert at all, but I believe the claim is that the generics work on the Collections, but not on other classes.Thus, ListInteger will map to int in the schema, but FooInteger is not mapped.Basically, we only look at the generics if its an instance of a collection and at that point, we ONLY look at that collection. We don't going searching up all the declarations to figure out where the generics expansion came from. That said, mapping to the anyType should have worked. Generating an invalid wsdl is definitely a bug. Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Hello, I am having a problem trying to return a 'complex object' that contains a java.util.collection as one of the properties. I've written a SOAP service using Aegis binding and I want to pass in a generic return type from the various data accessing functions I have written. I am getting this error in my SOAPUI: Mon Nov 05 13:17:48 EST 2007:WARN: error: src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. I have defined the class as such: @XmlType(name = wsResponse, namespace = http://soap.ws.test.com/;) public class wsResponseT { protected CollectionT response; protected String sName; protected String sessionId; public wsResponse(CollectionT os) { this.response = os; } public wsResponse() { } public void setResponse(CollectionT response) { this.response = response; } public CollectionT getResponse() { return response; } ... (other setters//getters) } Please help, I have been held up for 2 days! Though there are no real examples out there, the Xfire/CXF docs 'claim' this should be automatic with Java 1.5 Thanks! -Tony -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: Help! Aegis not mapping Java.Util.Collection properly
On Monday 05 November 2007, Vespa, Anthony J wrote: Thank you so much! So to clarify a couple things (apologies if this is redundant I just want to make sure I understand) -Once this issue is fixed, will the any-type resolve to being the actual types on my collection, or will it still be any type and this just fixes the breakage in the SoapUI tool? This just fixes the breakage in SoapUI tool. It will still be anyType in the wsdl. -Will this then be going into 2.0.3, and if so, when will 2.0.3 be fully released as a finished item? I didn't see any dates for it in my inspection of the docs and sites. It will be in 2.0.3. I was GOING to build the 2.0.3 builds this afternoon, but you and David Sica side tracked me on fixing a couple issues before I did the build. Thus, it's likely to be later tonight or tomorrow morning. Dan Thanks again!! -Tony From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Mon 11/5/2007 4:56 PM To: cxf-user@incubator.apache.org Cc: Vespa, Anthony J Subject: Re: Help! Aegis not mapping Java.Util.Collection properly On Monday 05 November 2007, Vespa, Anthony J wrote: Okie, so what is the next step? Do I need to log a bug for this? I'm not really 100% on why the mapping is broken. I have it fixed. :-) Running the test suite now. There were two issues: 1) We were generating the ArrayOfAnyType into the http://www.w3.org/2001/XMLSchema namespace which is really wrong as thats a standard namespace that we shouldn't be generating anything into. 2) Because that namespace is a standard one, we don't create an xsd:import element for it.Thus, the SOAPui parser/validator cannot find it. Fixing (1) actually fixes this. Dan -T -Original Message- From: Daniel Kulp [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 4:32 PM To: cxf-user@incubator.apache.org Cc: Vespa, Anthony J Subject: Re: Help! Aegis not mapping Java.Util.Collection properly I'm not an aegis expert at all, but I believe the claim is that the generics work on the Collections, but not on other classes. Thus, ListInteger will map to int in the schema, but FooInteger is not mapped.Basically, we only look at the generics if its an instance of a collection and at that point, we ONLY look at that collection. We don't going searching up all the declarations to figure out where the generics expansion came from. That said, mapping to the anyType should have worked. Generating an invalid wsdl is definitely a bug. Dan On Monday 05 November 2007, Vespa, Anthony J wrote: Hello, I am having a problem trying to return a 'complex object' that contains a java.util.collection as one of the properties. I've written a SOAP service using Aegis binding and I want to pass in a generic return type from the various data accessing functions I have written. I am getting this error in my SOAPUI: Mon Nov 05 13:17:48 EST 2007:WARN: error: src-resolve: type '[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema' not found. I have defined the class as such: @XmlType(name = wsResponse, namespace = http://soap.ws.test.com/;) public class wsResponseT { protected CollectionT response; protected String sName; protected String sessionId; public wsResponse(CollectionT os) { this.response = os; } public wsResponse() { } public void setResponse(CollectionT response) { this.response = response; } public CollectionT getResponse() { return response; } ... (other setters//getters) } Please help, I have been held up for 2 days! Though there are no real examples out there, the Xfire/CXF docs 'claim' this should be automatic with Java 1.5 Thanks! -Tony -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Java first: Binding classes not exposed in service APIs
I asked a smiliar question a few days ago referencing binding subclasses with Aegis (http://www.nabble.com/Migrating-XFire-Aegis-inheritance-to-CXF-tf473390 3.html), but I wanted to follow up on the subject and ask a more general question. Is binding arbitrary classes (i.e. those that are not necessarily exposed in a service interface) supported in CXF? If so, how is this done using JAXB? What would the Spring configuration look like? Thanks! Jeff
Bus has no BindingFactoryManager extension in AbstractBindingFactory.registerWithBindingManager
I'm using apache-cxf-2.0.3-incubator-20071102.144221-7 (although I see the same problem with 2.0.2) and Spring 2.5-rc1 I have a simple servlet configuration exactly as described here: http://cwiki.apache.org/CXF20DOC/servlet-transport.html and the cxf component of my spring config looks like this: import resource=classpath:META-INF/cxf/cxf.xml/ import resource=classpath:META-INF/cxf/cxf-extension-soap.xml/ import resource=classpath:META-INF/cxf/cxf-servlet.xml/ jaxws:endpoint id=rpcReviewService implementor=com.atlassian.crucible.spi.rpc.RpcReviewServiceImpl address=/review / RpcReviewServiceImpl.java Is: @Component @WebService (endpointInterface=com.atlassian.crucible.spi.rpc.RpcReviewService) @SOAPBinding(style=Style.RPC, use= Use.LITERAL) public class RpcReviewServiceImpl implements RpcReviewService { private ReviewService reviewService; public ReviewData createReview(ReviewData review) { return reviewService.createReview(review); } public ListReviewData getAllReviews() { return reviewService.getAllReviews(); } public void setReviewService(ReviewService reviewService) { this.reviewService = reviewService; } } When I start my app (running in Jetty) I have an NPE here: [java] java.lang.NullPointerException [java] at org .apache .cxf .binding .AbstractBindingFactory .registerWithBindingManager(AbstractBindingFactory.java:60) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun .reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 39) [java] at sun .reflect .DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 25) [java] at java.lang.reflect.Method.invoke(Method.java:585) [java] at org .springframework .beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor $LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java: 209) [java] at org .springframework .beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor $ LifecycleMetadata .invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:180) [java] at org .springframework .beans .factory .annotation .InitDestroyAnnotationBeanPostProcessor .postProcessBeforeInitialization (InitDestroyAnnotationBeanPostProcessor.java:98) [java] at org .springframework .beans .factory .support .AbstractAutowireCapableBeanFactory .applyBeanPostProcessorsBeforeInitialization (AbstractAutowireCapableBeanFactory.java:322) [java] at org .springframework .beans .factory .support .AbstractAutowireCapableBeanFactory .initializeBean(AbstractAutowireCapableBeanFactory.java:1299) [java] at org .springframework .beans .factory .support .AbstractAutowireCapableBeanFactory .createBean(AbstractAutowireCapableBeanFactory.java:532) [java] at org.springframework.beans.factory.support.AbstractBeanFactory $1.getObject(AbstractBeanFactory.java:238) [java] at org .springframework .beans .factory .support .DefaultSingletonBeanRegistry .getSingleton(DefaultSingletonBeanRegistry.java:167) [java] at org .springframework .beans .factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java: 235) [java] at org .springframework .beans .factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java: 167) [java] at org .springframework .context .support .AbstractApplicationContext.getBean(AbstractApplicationContext.java:867) [java] at org .apache.cxf.configuration.spring.SpringBeanMap.get(SpringBeanMap.java: 193) [java] at org.apache.cxf.configuration.spring.SpringBeanMap $Entry.getValue(SpringBeanMap.java:258) [java] at org .springframework .beans .TypeConverterDelegate.convertToTypedMap(TypeConverterDelegate.java:469) ... meaning that in: public abstract class AbstractBindingFactory... ... @PostConstruct void registerWithBindingManager() { BindingFactoryManager manager = bus.getExtension(BindingFactoryManager.class); for (String ns : activationNamespaces) { manager.registerBindingFactory(ns, this); } } bus.getExtension(BindingFactoryManager.class) is returning null. Any advice would be welcome. Thanks, Tom -- ATLASSIAN - http://www.atlassian.com Our products help over 8,500 customers in more than 95 countries to collaborate
RE: ClientFactoryBean AbstractMethodError
Glad to see you have your problem resolved. What I am suggesting is that do not write your RESTful service client using JAX-WS style API (eg, JaxWsProxyFactoryBean etc), we do not support that and have no plan to support it. Instead, you may find most of time you are just fine to access your RESTful services by using HttpURLConnection or Apache HttpClient or even a browser. Cheers, Jervis -Original Message- From: Todd Orr [mailto:[EMAIL PROTECTED] Sent: 2007?11?6? 2:06 To: cxf-user@incubator.apache.org Subject: Re: ClientFactoryBean AbstractMethodError That seems to have worked. Thanks! On 11/5/07, Willem Jiang [EMAIL PROTECTED] wrote: Hi , Can you check xercesImpl-2.8.1.jar is in the class path of your test with JUnit? I can find the method org.apache.xerces.dom.DocumentImpl.getInputEncoding() in that jar. Willem. Todd Orr wrote: hanks. That doesn't really explain, to me, why the server starts up fine when deployed but fails with the error shown when run in a JUnit test. The demo is able to create a service in JUnit without problem. In this particular JUnit, rather than relying on Spring configuration, I was attempting to create the server myself using the following code: private Server createRestServer(SessionFactory sessionFactory) { MyServiceImpl service = new MyServiceImpl(); service.setSessionFactory(sessionFactory); JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(); sf.setServiceClass(MyServiceInterface.class); sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID); sf.setAddress(http://localhost:8080/rest/;); sf.getServiceFactory().setInvoker(new BeanInvoker(service)); sf.getServiceFactory().setWrapped(true); return sf.create(); } This is almost exactly the same as the server code from the demo - the code that works. However, in my example I receive the stack trace from above on the sf.create() method. On 11/4/07, Liu, Jervis [EMAIL PROTECTED] wrote: I probabaly should remove JAX-WS style client codes from restful_http_binding demo, as it constantly causes confusions. In theory, JAX-WS style client APIs should work with RESTful services that published using CXF HTTP binding, as this is symmetric to what the server side has to do to marshal/unmarshal request/response. But in reality, this does not work because a). This JAX-WS style client APIs support is not completed yet. b). I don't think there will be much value added by supporting JAX-WS style client APIs. This JAX-WS style client APIs wont work without a WSDL, most RESTful services wont have a WSDL. More comments about client side REST API support can be found in [1]. [1]. http://www.nabble.com/Using-verbs-other-than-GET-from-a-RESTfu l-client-application-tf4628659.html Cheers, Jervis -Original Message- From: Todd Orr [mailto:[EMAIL PROTECTED] Sent: 2007?11?5? 10:41 To: cxf-user@incubator.apache.org Subject: ClientFactoryBean AbstractMethodError I have been trying to get a REST service up and running. I believe the server is up. However, creating the client is problematic. Using the following code borrowed from the bundled rest sample: JaxWsProxyFactoryBean sf = new JaxWsProxyFactoryBean(); sf.setServiceClass(MyServiceInterface.class); // Turn off wrapped mode to make our xml prettier sf.getServiceFactory().setWrapped(false); // Use the HTTP Binding which understands the Java Rest Annotations sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP _BINDING_ID); sf.setAddress(http://localhost:8080/rest/;); this.service = (MyServiceInterface) sf.create(); I receive the following exception: java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.getInputEncoding()Ljava/lan g/String; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess orImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth odAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.ws.commons.schema.utils.DOMUtil.getInputEncoding(DO MUtil.java:594) at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchem aCollection.java:348) at org.apache.cxf.databinding.source.AbstractDataBinding.addSchem aDocument(AbstractDataBinding.java:73) at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding .java:224) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.bu ildServiceFromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.in
Re: pojo object return type not included in wsdl as complextype
Hi Dan, Thanks for the info. I only started using the response wrapper as I couldn't get the return object to be anything other than a java.lang type. I am doing code first development of the application. I am trying to do a simple method call returning a custom object. I have set up the following: 1) Interface to he service I want to expose as a web service. I have annotated this with @WebService and the parameters with @WebParam. @WebService public interface ITestService { public ITestResult processTestTransaction(@WebParam(name=id)String id); 2) I have annnotated the service implementation class with @WebService @WebService(endpointInterface = za.co.test.web.service.ITestWebService) public class TestImpl implements ITestService { 3) I have setup, in applicationContext.xml, import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / jaxws:endpoint id=TestWebService implementor=#testWebServiceBean address=/testWebService / bean id=testWebServiceBean class=za.co.test.web.service.impl.TestWebServiceImpl property name=testService ref=testService/ /bean 4) The returned object of the method has an interface and an implementation class. i.e public interface ITestResult{ ..} public class TestResult implements ITestResult{ .. I still keep on getting the marshalling error? Thanks Mark Daniel Kulp wrote: Mark, The class pointed at by the ResponseWrapper should NEVER be the same as the return type. The ResponseWrapper class should point to a bean that holds onto the return type as a member. (as well as any out types from any holders) In you case, it would need to point to something like: public class DoCreditResponse { private Balance _return; public Balance get_return() { return _return; } public void set_return(Balance b) { _return = b; } } If you are using CXF 2.0.2 (if not, you really need to update) and doing complete code first development, you probably should just avoid using the @ResponseWrapper annotation entirely and let the runtime handle it. 2.0.2 doesn't need the the generated wrapper classes. In anycase, definitely check what version of CXF you're using. There have been a TON of fixes to the codefirst stuff since 2.0. Dan On Monday 05 November 2007, Mark Clarke wrote: Hi Daniel, The example was a quick and dirty to give some idea of what I am trying. From what I have read the className attribute should point to the fQN of the class, in my example I am assuming default packahe but the same would apply for any other package namespace. As the return type and the className refer to the same class I assume they would be the same? My basic problem is that any return type that is not a standard java.lang object just throws errors like Marshalling Errror: class is not know to this context Its quiet frustrating. I didnt have this problem with xfire :( Daniel Kulp wrote: Mark, You might be hitting a class name conflict issue: @ResponseWrapper(className=Balance) public Balance doCredit(Double amount) You have a Balance object for the return type, but you are also using a Balance object for the response wrapper. Is that intended? Also, the className attribute should point to a fully qualified (with package) class name that we can do a Class.forName(...) with. Dan On Monday 05 November 2007, Mark Clarke wrote: Hi there, I can;t get cfx to place the definition of a pojo into the wsdl as a complextyope. On the interface I have tried the following: == import . @WebService public interface ISimpleBankAccount{ @ResponseWrapper(className=Balance) public Balance doDebit(Double amount); @ResponseWrapper(className=Balance) public Balance doCredit(Double amount); } public class Balance(){ java.util.Date date; Double balance; Double previousBlanace; getter and setters } What am I doing wrong? === Cyber Connect - More than just broadband http://www.CyberConnect.co.za - Vodacom 3G R99/month Cyber Designs - Put your business on the net http://www.CyberDesigns.co.za Jumping Bean - Your Java and Linux Experts http://www.JumpingBean.co.za Tel: 011-781 80 14 Fax: 011-781 80 15 === Disclaimer Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Employees of Cyber Designs are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy and outside the scope of the employment of the individual concerned. The company will not accept any