Re: WebSecurity error when using Simple Frontend / Aegis binding
Interesting issue. Definitely a bug in the FaultOutInterceptor. It should definitely be able to work OK if the bop is null. Basically, just return if no BOP should be the right behavior. Basically, with JAXWS, we have to look at the incoming SOAP message earlier to deterine the operation information so by the time the WS security stuff is called, the BOP may be filled in. With simple, we probably don't so it's not there yet.(it may also have to do with SOAPAction things as we may be grabbing the BOP based on a unique soapaction) The only workaround I can think of right now is to write an interceptor that would sit just before the FaultOutInterceptor and checks to see if the bop is null. If it is, grab the service out of the message/exchange and just pick a random one to make sure the NPE doesn't occur. Dan On Monday 04 February 2008, yulinxp wrote: Looking at src for FaultOutInterceptor.java, BindingOperationInfo op is null! This only happens for Simple Frontend/Aegis binding, not for JAX-WS Frontend/JAXB binding. Is there a way to let it work? I am using cxf-2.0.3. public FaultInfo getFaultForClass(BindingOperationInfo op, Class class1) { for (BindingFaultInfo bfi : op.getFaults()) { FaultInfo faultInfo = bfi.getFaultInfo(); Class? c = (Class)faultInfo.getProperty(Class.class.getName()); if (c.isAssignableFrom(class1)) { return faultInfo; } } return null; } --- ///tomcat CXF server exception INFO: Interceptor has thrown exception, unwinding now java.lang.NullPointerException at org.apache.cxf.interceptor.FaultOutInterceptor.getFaultForClass(FaultO utInterceptor.java: 128) at org.apache.cxf.interceptor.FaultOutInterceptor.handleMessage(FaultOutI nterceptor.java:61) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto rChain.java:207) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessa ge(AbstractFaultCha inInitiatorObserver.java:90) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto rChain.java:224) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitia tionObserver.java:7 3) at org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletD estination.java:79) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(S ervletController.ja va:256) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletContr oller.java:160) at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXF Servlet.java:170) at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXF Servlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli cationFilterChain.j ava:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi lterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa lve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa lve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja va:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja va:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv e.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java :263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces s(Http11Protocol.ja va:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447 ) at java.lang.Thread.run(Thread.java:595) What's working for JAX-WS Frontend / JAXB binding does not work for Simple Frontend / Aegis binding. Is there anything wrong with my xml? How to fix it? -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
WebSecurity error when using Simple Frontend / Aegis binding
Web Security works for my example A, using JAX-WS Frontend / JAXB binding. If client sets the wrong password, server will return Security processing failed. to the client. Now I want to add WebSecurity to another example B, using Simple Frontend / Aegis binding. I use the same ServerPasswordCallback ClientPasswordCallback as in example A. My xml is like this: simple:server id=helloWorld serviceClass=demo.spring.HelloWorld address=/ServerEndPoint simple:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /simple:dataBinding simple:serviceBean bean class=demo.spring.HelloWorldImpl / /simple:serviceBean simple:inInterceptors bean class=org.apache.cxf.binding.soap.saaj.SAAJInInterceptor/ bean class=org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor property name=properties !-- constructor-arg -- map entry key=action value=UsernameToken/ entry key=passwordType value=PasswordDigest / entry key=passwordCallbackClass value=demo.spring.security.ServerPasswordCallback/ /map !-- constructor-arg -- /property /bean /simple:inInterceptors /simple:server If client sets the password right, everything is fine. But if client sets the wrong password, server tomcat will have the following exception. And because of it, the client doesn't receive any response, and the client will have something like Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0] ///tomcat CXF server exception INFO: Interceptor has thrown exception, unwinding now java.lang.NullPointerException at org.apache.cxf.interceptor.FaultOutInterceptor.getFaultForClass(FaultOutInterceptor.java: 128) at org.apache.cxf.interceptor.FaultOutInterceptor.handleMessage(FaultOutInterceptor.java:61) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultCha inInitiatorObserver.java:90) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:224) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:7 3) at org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.ja va:256) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:170) at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) What's working for JAX-WS Frontend / JAXB binding does not work for Simple Frontend / Aegis binding. Is there anything wrong with my xml? How to fix it? -- View this message in context: http://www.nabble.com/WebSecurity-error-when-using-Simple-Frontend---Aegis-binding-tp15277618p15277618.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: WebSecurity error when using Simple Frontend / Aegis binding
Hi , There are some difference between the simple front end and jaxws front end to detail with the fault message. The WebFault annotation will take effect when you are using the jaxws front end , but when you using simple front you need let the exception class inherit the org.apache.cxf.frontend.FaultInfoException class. You can find some more information by digging the RefactionServiceFactoryBean [1] 's initializeFaults() method. [1] https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Willem. yulinxp wrote: Looking at src for FaultOutInterceptor.java, BindingOperationInfo op is null! This only happens for Simple Frontend/Aegis binding, not for JAX-WS Frontend/JAXB binding. Is there a way to let it work? I am using cxf-2.0.3. public FaultInfo getFaultForClass(BindingOperationInfo op, Class class1) { for (BindingFaultInfo bfi : op.getFaults()) { FaultInfo faultInfo = bfi.getFaultInfo(); Class? c = (Class)faultInfo.getProperty(Class.class.getName()); if (c.isAssignableFrom(class1)) { return faultInfo; } } return null; } --- ///tomcat CXF server exception INFO: Interceptor has thrown exception, unwinding now java.lang.NullPointerException at org.apache.cxf.interceptor.FaultOutInterceptor.getFaultForClass(FaultOutInterceptor.java: 128) at org.apache.cxf.interceptor.FaultOutInterceptor.handleMessage(FaultOutInterceptor.java:61) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultCha inInitiatorObserver.java:90) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:224) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:7 3) at org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:79) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.ja va:256) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:170) at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) What's working for JAX-WS Frontend / JAXB binding does not work for Simple Frontend / Aegis binding. Is there anything wrong with my xml? How to fix it?
Re: Simple Front end/Aegis binding server side set up problem
where to find classpath:META-INF? Could you pls give me the link? --- willem.jiang wrote: They are the spring description files of cxf components. import resource=classpath:META-INF/cxf/cxf.xml / this is the cxf core component. import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / this is the soap component configuration file. import resource=classpath:META-INF/cxf/cxf-servlet.xml / this is the cxf servlet transport component configuration file. You can find them from the cxf modules class path. Willem. yulinxp wrote: I need to add these: 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 / Can anybody tell me what they are and how they're found and referenced? - yulinxp wrote: When deploying in tomcat, it's complaining about Caused by: java.net.MalformedURLException: no protocol: /hello_world Did I not get the schema for simple? where can I find it? SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorld': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustom InitMethod(AbstractAutowireCapableBeanFactory.java:1240) . at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.MalformedURLException: no protocol: /hello_world at java.net.URL.init(URL.java:567) at java.net.URL.init(URL.java:464) at java.net.URL.init(URL.java:413) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyHTTPDestination.java :88) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTP TransportFactory.java:116) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTra nsportFactory.java:103) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java :74) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90) at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:109) ... 41 more --- beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:simple=http://cxf.apache.org/simple; xmlns:soap=http://cxf.apache.org/bindings/soap; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; simple:server id=helloWorld serviceClass=demo.spring.HelloWorld address=/hello_world simple:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /simple:dataBinding simple:serviceBean bean class=demo.spring.HelloWorldImpl / /simple:serviceBean /simple:server /beans -- View this message in context: http://www.nabble.com/Simple-Front-end-Aegis-binding-server-side-set-up-problem-tp14841711p14887352.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Simple Front end/Aegis binding server side set up problem
It's just a directory in the jar files. On Wed, 2008-01-16 at 10:04 -0800, yulinxp wrote: where to find classpath:META-INF? Could you pls give me the link? --- willem.jiang wrote: They are the spring description files of cxf components. import resource=classpath:META-INF/cxf/cxf.xml / this is the cxf core component. import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / this is the soap component configuration file. import resource=classpath:META-INF/cxf/cxf-servlet.xml / this is the cxf servlet transport component configuration file. You can find them from the cxf modules class path. Willem. yulinxp wrote: I need to add these: 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 / Can anybody tell me what they are and how they're found and referenced? - yulinxp wrote: When deploying in tomcat, it's complaining about Caused by: java.net.MalformedURLException: no protocol: /hello_world Did I not get the schema for simple? where can I find it? SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorld': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustom InitMethod(AbstractAutowireCapableBeanFactory.java:1240) . at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.MalformedURLException: no protocol: /hello_world at java.net.URL.init(URL.java:567) at java.net.URL.init(URL.java:464) at java.net.URL.init(URL.java:413) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyHTTPDestination.java :88) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTP TransportFactory.java:116) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTra nsportFactory.java:103) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java :74) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90) at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:109) ... 41 more --- beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:simple=http://cxf.apache.org/simple; xmlns:soap=http://cxf.apache.org/bindings/soap; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; simple:server id=helloWorld serviceClass=demo.spring.HelloWorld address=/hello_world simple:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /simple:dataBinding simple:serviceBean bean class=demo.spring.HelloWorldImpl / /simple:serviceBean /simple:server /beans
Re: Simple Front end/Aegis binding server side set up problem
I found them. They're in the cxf-xxx-jar/META-INF/cxf/ - yulinxp wrote: where to find classpath:META-INF? Could you pls give me the link? --- willem.jiang wrote: They are the spring description files of cxf components. import resource=classpath:META-INF/cxf/cxf.xml / this is the cxf core component. import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / this is the soap component configuration file. import resource=classpath:META-INF/cxf/cxf-servlet.xml / this is the cxf servlet transport component configuration file. You can find them from the cxf modules class path. Willem. yulinxp wrote: I need to add these: 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 / Can anybody tell me what they are and how they're found and referenced? - yulinxp wrote: When deploying in tomcat, it's complaining about Caused by: java.net.MalformedURLException: no protocol: /hello_world Did I not get the schema for simple? where can I find it? SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorld': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustom InitMethod(AbstractAutowireCapableBeanFactory.java:1240) . at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.MalformedURLException: no protocol: /hello_world at java.net.URL.init(URL.java:567) at java.net.URL.init(URL.java:464) at java.net.URL.init(URL.java:413) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyHTTPDestination.java :88) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTP TransportFactory.java:116) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTra nsportFactory.java:103) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java :74) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90) at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:109) ... 41 more --- beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:simple=http://cxf.apache.org/simple; xmlns:soap=http://cxf.apache.org/bindings/soap; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; simple:server id=helloWorld serviceClass=demo.spring.HelloWorld address=/hello_world simple:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /simple:dataBinding simple:serviceBean bean class=demo.spring.HelloWorldImpl / /simple:serviceBean /simple:server /beans -- View this message in context: http://www.nabble.com/Simple-Front-end-Aegis-binding-server-side-set-up-problem-tp14841711p14889659.html Sent from the cxf-user mailing list archive
Re: Simple Front end/Aegis binding server side set up problem
When I specify these three xml files, tomcat loads them: INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/beans.xml] Jan 16, 2008 1:45:42 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml] Jan 16, 2008 1:45:42 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml] Jan 16, 2008 1:45:42 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-servlet.xml] Jan 16, 2008 1:45:42 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBe anFactory But if I don't import them in beans.xml. Tomcat loads all xml files! So if this is happening, why is it still not right? ( Caused by: java.net.MalformedURLException: no protocol: /hello_world ) INFO: Refreshing [EMAIL PROTECTED]: display name [org.apache.c [EMAIL PROTECTED]; startup date [Wed Jan 16 13:47:20 CST 2008]; root of c ontext hierarchy Jan 16, 2008 1:47:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml] Jan 16, 2008 1:47:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml] Jan 16, 2008 1:47:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-management.x ml] Jan 16, 2008 1:47:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-rm.xml] Jan 16, 2008 1:47:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-addr.xml] Jan 16, 2008 1:47:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-http-binding .xml] Jan 16, 2008 1:47:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-jms.xml] Jan 16, 2008 1:47:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-jaxws.xml] Jan 16, 2008 1:47:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefini tions They are the spring description files of cxf components. import resource=classpath:META-INF/cxf/cxf.xml / this is the cxf core component. import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / this is the soap component configuration file. import resource=classpath:META-INF/cxf/cxf-servlet.xml / this is the cxf servlet transport component configuration file. You can find them from the cxf modules class path. Willem. -- View this message in context: http://www.nabble.com/Simple-Front-end-Aegis-binding-server-side-set-up-problem-tp14841711p14890738.html Sent from the cxf-user mailing list archive at Nabble.com.
Simple Front end/Aegis binding server side set up problem
When deploying in tomcat, it's complaining about Caused by: java.net.MalformedURLException: no protocol: /hello_world Did I not get the schema for simple? where can I find it? SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorld': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustom InitMethod(AbstractAutowireCapableBeanFactory.java:1240) . at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.MalformedURLException: no protocol: /hello_world at java.net.URL.init(URL.java:567) at java.net.URL.init(URL.java:464) at java.net.URL.init(URL.java:413) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyHTTPDestination.java :88) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTP TransportFactory.java:116) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTra nsportFactory.java:103) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java :74) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90) at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:109) ... 41 more --- beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:simple=http://cxf.apache.org/simple; xmlns:soap=http://cxf.apache.org/bindings/soap; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; simple:server id=helloWorld serviceClass=demo.spring.HelloWorld address=/hello_world simple:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /simple:dataBinding simple:serviceBean bean class=demo.spring.HelloWorldImpl / /simple:serviceBean /simple:server /beans -- View this message in context: http://www.nabble.com/Simple-Front-end-Aegis-binding-server-side-set-up-problem-tp14841711p14841711.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Simple Front end/Aegis binding server side set up problem
I need to add these: 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 / Can anybody tell me what they are and how they're found and referenced? - yulinxp wrote: When deploying in tomcat, it's complaining about Caused by: java.net.MalformedURLException: no protocol: /hello_world Did I not get the schema for simple? where can I find it? SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorld': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustom InitMethod(AbstractAutowireCapableBeanFactory.java:1240) . at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.MalformedURLException: no protocol: /hello_world at java.net.URL.init(URL.java:567) at java.net.URL.init(URL.java:464) at java.net.URL.init(URL.java:413) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyHTTPDestination.java :88) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTP TransportFactory.java:116) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTra nsportFactory.java:103) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java :74) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90) at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:109) ... 41 more --- beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:simple=http://cxf.apache.org/simple; xmlns:soap=http://cxf.apache.org/bindings/soap; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; simple:server id=helloWorld serviceClass=demo.spring.HelloWorld address=/hello_world simple:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /simple:dataBinding simple:serviceBean bean class=demo.spring.HelloWorldImpl / /simple:serviceBean /simple:server /beans -- View this message in context: http://www.nabble.com/Simple-Front-end-Aegis-binding-server-side-set-up-problem-tp14841711p14844724.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: Simple Front end/Aegis binding server side set up problem
It looks like you're running into the same usage issue as Powel did. See: http://mail-archives.apache.org/mod_mbox/incubator-cxf-user/200801.mbox/200801151428.34207.dkulp%40apache.org Dan On Tuesday 15 January 2008, yulinxp wrote: When deploying in tomcat, it's complaining about Caused by: java.net.MalformedURLException: no protocol: /hello_world Did I not get the schema for simple? where can I find it? SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorld': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.jav a:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j ava:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess orImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanF actory.invokeCustom InitMethod(AbstractAutowireCapableBeanFactory.java:1240) . at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:51 6) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j ava:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess orImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.MalformedURLException: no protocol: /hello_world at java.net.URL.init(URL.java:567) at java.net.URL.init(URL.java:464) at java.net.URL.init(URL.java:413) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyH TTPDestination.java :88) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDe stination(JettyHTTP TransportFactory.java:116) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDesti nation(JettyHTTPTra nsportFactory.java:103) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTr ansportFactory.java :74) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90) at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.jav a:109) ... 41 more --- beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:simple=http://cxf.apache.org/simple; xmlns:soap=http://cxf.apache.org/bindings/soap; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; simple:server id=helloWorld serviceClass=demo.spring.HelloWorld address=/hello_world simple:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /simple:dataBinding simple:serviceBean bean class=demo.spring.HelloWorldImpl / /simple:serviceBean /simple:server /beans -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: Simple Front end/Aegis binding server side set up problem
They are the spring description files of cxf components. import resource=classpath:META-INF/cxf/cxf.xml / this is the cxf core component. import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / this is the soap component configuration file. import resource=classpath:META-INF/cxf/cxf-servlet.xml / this is the cxf servlet transport component configuration file. You can find them from the cxf modules class path. Willem. yulinxp wrote: I need to add these: 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 / Can anybody tell me what they are and how they're found and referenced? - yulinxp wrote: When deploying in tomcat, it's complaining about Caused by: java.net.MalformedURLException: no protocol: /hello_world Did I not get the schema for simple? where can I find it? SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'helloWorld': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustom InitMethod(AbstractAutowireCapableBeanFactory.java:1240) . at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.net.MalformedURLException: no protocol: /hello_world at java.net.URL.init(URL.java:567) at java.net.URL.init(URL.java:464) at java.net.URL.init(URL.java:413) at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyHTTPDestination.java :88) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTP TransportFactory.java:116) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTra nsportFactory.java:103) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java :74) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90) at org.apache.cxf.endpoint.ServerImpl.init(ServerImpl.java:69) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:109) ... 41 more --- beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:simple=http://cxf.apache.org/simple; xmlns:soap=http://cxf.apache.org/bindings/soap; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; simple:server id=helloWorld serviceClass=demo.spring.HelloWorld address=/hello_world simple:dataBinding bean class=org.apache.cxf.aegis.databinding.AegisDatabinding / /simple:dataBinding simple:serviceBean bean class=demo.spring.HelloWorldImpl / /simple:serviceBean /simple:server /beans
Re: exposed methods with Aegis binding
On Thursday 10 January 2008, Nacharya wrote: We have used the ServerFactoryBean with Aegis databinding and the exclude annotation didn't work. How can we get this simple annotation to work? The @WebMethod(ignore = true) stuff is a jaxws thing. Thus, you would need to use the JaxwsServerFactoryBean and have it setup as a jaxws service. (you can use the aegis databinding with the jaxws frontend) -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: exposed methods with Aegis binding
We have used the ServerFactoryBean with Aegis databinding and the exclude annotation didn't work. How can we get this simple annotation to work? -- View this message in context: http://www.nabble.com/exposed-methods-with-Aegis-binding-tp14697814p14743951.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: exposed methods with Aegis binding
Hi, Aegis Binding is a data binding , it will not effect which method will be export to the web service. If you are using JaxWs front end , you could use the annotation to define your SEI ( which will be mapped to the WSDL operation) You can find the example here[1]. [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Hello.java Willem. tcs wrote: I'm using CXF (with Aegis Binding) to create a simple Web Service. My web service impl. class extends other classes. Not only are the methods in my web service impl. class exposed in the WSDL generated by CXF, but methods from the parent class are also exposed. Is there a way to control which methods are exposed using the default Aegis Binding. thanks,
Re: exposed methods with Aegis binding
Basically, you can use the @WebMethod(exclude=true) to exclude the methods that you don't want it to be exposed. James Hi, Aegis Binding is a data binding , it will not effect which method will be export to the web service. If you are using JaxWs front end , you could use the annotation to define your SEI ( which will be mapped to the WSDL operation) You can find the example here[1]. [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/Hello.java Willem. tcs wrote: I'm using CXF (with Aegis Binding) to create a simple Web Service. My web service impl. class extends other classes. Not only are the methods in my web service impl. class exposed in the WSDL generated by CXF, but methods from the parent class are also exposed. Is there a way to control which methods are exposed using the default Aegis Binding. thanks,
Re: array - difference between JAXB and Aegis Binding
Nope. Not right now. The aegis databinging is very type oriented in that it generates a type for each field. It doesn't try to collapse them down into elements with maxOccurs. I looked into it a bit when fixing https://issues.apache.org/jira/browse/CXF-1116, but it didn't look easy so I just stuck with the ArrayOf stuff. Dan On Thursday 13 December 2007, tcs wrote: Hi, I wrote a simple web service with two methods, one that would take an array and one that would return an array. public String[] getAbc() { String[] strs = new String[3]; strs[0] = a; strs[1] = b; strs[2] = c; return strs; } public String setAbc(String[] args) { return done; } I noticed that with JAXB binding, the WSDL created does not have the wrapper 'ArrayOf...' element present. xsd:schema attributeFormDefault=unqualified elementFormDefault=unqualified targetNamespace=http://server.hw.demo/; xmlns:tns=http://server.hw.demo/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xsd:element name=setAbc type=tns:setAbc/ xsd:complexType name=setAbc xsd:sequence xsd:element maxOccurs=unbounded minOccurs=0 name=arg0 type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=setAbcResponse type=tns:setAbcResponse/ xsd:complexType name=setAbcResponse xsd:sequence xsd:element minOccurs=0 name=return type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=getAbc type=tns:getAbc/ xsd:complexType name=getAbc xsd:sequence/ /xsd:complexType xsd:element name=getAbcResponse type=tns:getAbcResponse/ xsd:complexType name=getAbcResponse xsd:sequence xsd:element maxOccurs=unbounded minOccurs=0 name=return type=xsd:string/ /xsd:sequence /xsd:complexType /xsd:schema However with Aegis binding, the wrapper 'ArrayOf...' elements are present. xsd:schema attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://server.hw.demo/; xsd:complexType name=ArrayOfString xsd:sequence xsd:element maxOccurs=unbounded minOccurs=0 name=string nillable=true type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=setAbc type=tns:setAbc/ xsd:complexType name=setAbc xsd:sequence xsd:element name=arg0 nillable=true type=tns:ArrayOfString/ /xsd:sequence /xsd:complexType xsd:element name=setAbcResponse type=tns:setAbcResponse/ xsd:complexType name=setAbcResponse xsd:sequence xsd:element minOccurs=0 name=return type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=getAbc type=tns:getAbc/ xsd:complexType name=getAbc xsd:sequence/ /xsd:complexType xsd:element name=getAbcResponse type=tns:getAbcResponse/ xsd:complexType name=getAbcResponse xsd:sequence xsd:element name=return nillable=true type=tns:ArrayOfString/ /xsd:sequence /xsd:complexType /xsd:schema I'd like to use Aegis binding. But would like my WSDL to not have the wrapper 'ArrayOf...' elements. Is that possible? thanks, Just as an fyi.. this issue was discussed in this thread: http://www.nabble.com/JAX-WS-Array-Support-tt8483460.html#a8483460 -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: Aegis Binding - Hello World example fails with SchemaFactoryFinder$ConfigurationError
Sounds like a JDK bug or something. I'm not really sure why. Dan On Thursday 13 December 2007, tcs wrote: I set the following system property: -Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema= com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl And was able to start the server. Shouldn't it default to this? Why does it default to: http\://www.w3.org/2001/XMLSchema=com.sun.org.apache.xerces.internal.j axp.validation.xs.SchemaFactoryImpl thanks tcs wrote: I'm trying to write a simple web service using Aegis but am running into some issues. When I try to start the server, I get the following exception: INFO: Creating Service {http://demo/}HelloWorld from class demo.HelloWorld JAXP: find factoryId=javax.xml.validation.SchemaFactory:http://www.w3.org/2001/ XMLSchema Exception in thread main javax.xml.validation.SchemaFactoryFinder$ConfigurationError: Provider http\://www.w3.org/2001/XMLSchema=com.sun.org.apache.xerces.internal .jaxp.validation.xs.SchemaFactoryImpl not found at javax.xml.validation.SchemaFactoryFinder.newInstance(Unknown Source) at javax.xml.validation.SchemaFactoryFinder.findJarServiceProvider(Unkn own Source) at javax.xml.validation.SchemaFactoryFinder.find(Unknown Source) at javax.xml.validation.SchemaFactory.newInstance(Unknown Source) at org.apache.cxf.aegis.type.XMLTypeCreator.clinit(XMLTypeCreator.jav a:115) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:177) at org.apache.cxf.aegis.type.DefaultTypeMappingRegistry.createRootTypeC reator(DefaultTypeMappingRegistry.java:244) at org.apache.cxf.aegis.type.DefaultTypeMappingRegistry.createTypeCreat or(DefaultTypeMappingRegistry.java:228) at org.apache.cxf.aegis.type.DefaultTypeMappingRegistry.createTypeMappi ng(DefaultTypeMappingRegistry.java:209) at org.apache.cxf.aegis.type.DefaultTypeMappingRegistry.createTypeMappi ng(DefaultTypeMappingRegistry.java:202) at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDa tabinding.java:144) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildSer viceFromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initiali zeServiceModel(ReflectionServiceFactoryBean.java:333) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(R eflectionServiceFactoryBean.java:151) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpo int(AbstractWSDLBasedEndpointFactory.java:74) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.j ava:108) at test.StartServer.usingAegis(StartServer.java:48) at test.StartServer.main(StartServer.java:18) I'm trying to start the server as follows: HelloWorldImpl bean= new HelloWorldImpl (); ServerFactoryBean svrFactory = new ServerFactoryBean(); svrFactory.setServiceClass(HelloWorldImpl.class); svrFactory.setAddress(url); svrFactory.setServiceBean(bean); svrFactory.setDataBinding(new AegisDatabinding()); svrFactory.create(); -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
Aegis Binding - Hello World example fails with SchemaFactoryFinder$ConfigurationError
I'm trying to write a simple web service using Aegis but am running into some issues. When I try to start the server, I get the following exception: INFO: Creating Service {http://demo/}HelloWorld from class demo.HelloWorld JAXP: find factoryId=javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema Exception in thread main javax.xml.validation.SchemaFactoryFinder$ConfigurationError: Provider http\://www.w3.org/2001/XMLSchema=com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl not found at javax.xml.validation.SchemaFactoryFinder.newInstance(Unknown Source) at javax.xml.validation.SchemaFactoryFinder.findJarServiceProvider(Unknown Source) at javax.xml.validation.SchemaFactoryFinder.find(Unknown Source) at javax.xml.validation.SchemaFactory.newInstance(Unknown Source) at org.apache.cxf.aegis.type.XMLTypeCreator.clinit(XMLTypeCreator.java:115) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:177) at org.apache.cxf.aegis.type.DefaultTypeMappingRegistry.createRootTypeCreator(DefaultTypeMappingRegistry.java:244) at org.apache.cxf.aegis.type.DefaultTypeMappingRegistry.createTypeCreator(DefaultTypeMappingRegistry.java:228) at org.apache.cxf.aegis.type.DefaultTypeMappingRegistry.createTypeMapping(DefaultTypeMappingRegistry.java:209) at org.apache.cxf.aegis.type.DefaultTypeMappingRegistry.createTypeMapping(DefaultTypeMappingRegistry.java:202) at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:144) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:293) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:333) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:151) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:74) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:108) at test.StartServer.usingAegis(StartServer.java:48) at test.StartServer.main(StartServer.java:18) I'm trying to start the server as follows: HelloWorldImpl bean= new HelloWorldImpl (); ServerFactoryBean svrFactory = new ServerFactoryBean(); svrFactory.setServiceClass(HelloWorldImpl.class); svrFactory.setAddress(url); svrFactory.setServiceBean(bean); svrFactory.setDataBinding(new AegisDatabinding()); svrFactory.create(); -- View this message in context: http://www.nabble.com/Aegis-Binding---Hello-World-example-fails-with-SchemaFactoryFinder%24ConfigurationError-tp14324396p14324396.html Sent from the cxf-user mailing list archive at Nabble.com.
array - difference between JAXB and Aegis Binding
Hi, I wrote a simple web service with two methods, one that would take an array and one that would return an array. public String[] getAbc() { String[] strs = new String[3]; strs[0] = a; strs[1] = b; strs[2] = c; return strs; } public String setAbc(String[] args) { return done; } I noticed that with JAXB binding, the WSDL created does not have the wrapper 'ArrayOf...' element present. xsd:schema attributeFormDefault=unqualified elementFormDefault=unqualified targetNamespace=http://server.hw.demo/; xmlns:tns=http://server.hw.demo/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xsd:element name=setAbc type=tns:setAbc/ xsd:complexType name=setAbc xsd:sequence xsd:element maxOccurs=unbounded minOccurs=0 name=arg0 type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=setAbcResponse type=tns:setAbcResponse/ xsd:complexType name=setAbcResponse xsd:sequence xsd:element minOccurs=0 name=return type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=getAbc type=tns:getAbc/ xsd:complexType name=getAbc xsd:sequence/ /xsd:complexType xsd:element name=getAbcResponse type=tns:getAbcResponse/ xsd:complexType name=getAbcResponse xsd:sequence xsd:element maxOccurs=unbounded minOccurs=0 name=return type=xsd:string/ /xsd:sequence /xsd:complexType /xsd:schema However with Aegis binding, the wrapper 'ArrayOf...' elements are present. xsd:schema attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://server.hw.demo/; xsd:complexType name=ArrayOfString xsd:sequence xsd:element maxOccurs=unbounded minOccurs=0 name=string nillable=true type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=setAbc type=tns:setAbc/ xsd:complexType name=setAbc xsd:sequence xsd:element name=arg0 nillable=true type=tns:ArrayOfString/ /xsd:sequence /xsd:complexType xsd:element name=setAbcResponse type=tns:setAbcResponse/ xsd:complexType name=setAbcResponse xsd:sequence xsd:element minOccurs=0 name=return type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=getAbc type=tns:getAbc/ xsd:complexType name=getAbc xsd:sequence/ /xsd:complexType xsd:element name=getAbcResponse type=tns:getAbcResponse/ xsd:complexType name=getAbcResponse xsd:sequence xsd:element name=return nillable=true type=tns:ArrayOfString/ /xsd:sequence /xsd:complexType /xsd:schema I'd like to use Aegis binding. But would like my WSDL to not have the wrapper 'ArrayOf...' elements. Is that possible? thanks, Just as an fyi.. this issue was discussed in this thread: http://www.nabble.com/JAX-WS-Array-Support-tt8483460.html#a8483460 -- View this message in context: http://www.nabble.com/array---difference-between-JAXB-and-Aegis-Binding-tp14325476p14325476.html Sent from the cxf-user mailing list archive at Nabble.com.
Re: newb question - JDOMException with aegis binding?
The dependencies list on http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html was what I was referring to. dkulp wrote: On Wednesday 07 November 2007, BrianP wrote: Thanks! Got it and it's working. Why is that not on the dependency list? What dependency list? It's in the dependencies for the aegis databinding pom so it should pull in. It's also shipped in our lib directory and is in the classpath entry of the manifest jar. Dan With that, it generated a bunch of foo.aegis.xml not found messages for each of the property types of the FullOrder, including the MultiString one. Is there a way to make it ignore most of the properties of my class except the ones I want to expose? Maybe I should start a new thread, since I'm past the JDOMException issue. Also, I went a couple steps further and got another NoClassDefFoundError, this time for jaxen. I found this jar, but it is also not on the dependencies list. You need jdom-1.0.jar. -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog -- View this message in context: http://www.nabble.com/newb-question---JDOMException-with-aegis-binding--tf4767403.html#a13667433 Sent from the cxf-user mailing list archive at Nabble.com.
Re: newb question - JDOMException with aegis binding?
On Wednesday 07 November 2007, BrianP wrote: Thanks! Got it and it's working. Why is that not on the dependency list? What dependency list? It's in the dependencies for the aegis databinding pom so it should pull in. It's also shipped in our lib directory and is in the classpath entry of the manifest jar. Dan With that, it generated a bunch of foo.aegis.xml not found messages for each of the property types of the FullOrder, including the MultiString one. Is there a way to make it ignore most of the properties of my class except the ones I want to expose? Maybe I should start a new thread, since I'm past the JDOMException issue. Also, I went a couple steps further and got another NoClassDefFoundError, this time for jaxen. I found this jar, but it is also not on the dependencies list. You need jdom-1.0.jar. -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
RE: newb question - JDOMException with aegis binding?
Thanks! Got it and it's working. Why is that not on the dependency list? With that, it generated a bunch of foo.aegis.xml not found messages for each of the property types of the FullOrder, including the MultiString one. Is there a way to make it ignore most of the properties of my class except the ones I want to expose? Maybe I should start a new thread, since I'm past the JDOMException issue. Also, I went a couple steps further and got another NoClassDefFoundError, this time for jaxen. I found this jar, but it is also not on the dependencies list. You need jdom-1.0.jar. -- View this message in context: http://www.nabble.com/newb-question---JDOMException-with-aegis-binding--tf4767403.html#a13636856 Sent from the cxf-user mailing list archive at Nabble.com.
Re: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal]
Benson, Dan, Could you elaborate a bit on this or detail the steps because I am not familiar with this. I will then try to test it. Basically, I have only POGO for which I would like to remove systematically a property. Thanks Guillaume On 9/21/07, Benson Margulies [EMAIL PROTECTED] wrote: I have a sudden inspiration here. Make a 'filter' for the TypeCreator interface. Grab the usual type creator chain (from getTypeCreator()) and stick it into your filter object. Make your filter post-edit the Type that it creates to remove the things you don't love. It may be that the registry is final because the idea is that it's just the, well, registry. All the customization-worthy behavior really occurs in the creator chain. Perhaps a Dan can amplify? -Original Message- From: Benson Margulies [mailto:[EMAIL PROTECTED] Sent: Friday, September 21, 2007 4:48 PM To: cxf-user@incubator.apache.org Subject: RE: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] One additional note: before launching down this path, I strongly suggest an experiment in just patching the source of CXF in that method of XMLTypeCreator to prove feasibility. -Original Message- From: Benson Margulies [mailto:[EMAIL PROTECTED] Sent: Friday, September 21, 2007 4:43 PM To: cxf-user@incubator.apache.org Subject: RE: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] I don't have a clue why DefaultTypeMappingRegistry is final. It looks like a mistake. Why put protected methods in a final class? Here's my temporary prescription. 1) make a subclass of XMLTypeCreator. You'll probably have to override createClassInfo(PropertyDescriptor). If you get one of the properties you don't like, return null. (I could be wrong about null). In real life, the ignore property is noted way down in the BeanTypeInfo, and overriding \that/ would be a ton of work. 2) Assembly a chain of type creators like that assembled in the default type mapping registry, with your subclass at the front. Pass it to setTypeCreator on the type mapping registry. Removing the wayward 'final' is an easy patch post 2.0.2, and I'd consider some feature development (in the Configuration) object to allow this from Spring configuration (a pattern of unloved property names?). -Original Message- From: tog [mailto:[EMAIL PROTECTED] Sent: Friday, September 21, 2007 4:22 PM To: cxf-user@incubator.apache.org Subject: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] There seems to be an renewed interest for Aegi on the list (thanks Benson ;-) ) Can someone comment if what I want to achieve is do-able ? According to Dan D. it is. I am clueless regarding step 4 (quoted below) Thanks Guillaume -- Forwarded message -- From: tog [EMAIL PROTECTED] Date: Sep 11, 2007 4:20 PM Subject: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] To: cxf-user@incubator.apache.org Hi Dan, Sorry not to follow up quickly. Actually, the DefaultTypaMappingRegistry is final and cannot be extended as you suggest. Some more insights on what I want to achieve. Today, in GroovyWS, the users have to write a .aegis.xml file for each bean they will write in Groovy. This file is always the same containing the line: property name=metaClass ignore=true/ I would like to modify the behavior of the BeanType inside the Aegis Binding so that if such a field is present it can be ignored. Is there some documentation on how to modify the DefaultTypeMappingRegisty ? Cheers Guillaume Step 4: Write your own type registry to return your own TypeCreator public class MyTypeMappingRegistry extends DefaultTypeMappingRegistry { protected AbstractTypeCreator createDefaultTypeCreator() { AbstractTypeCreator creator = new MyTypeCreator(); creator.setConfiguration(getConfiguration()); return creator; } } Step 5: use it: ServerFactoryBean sfb = new ServerFactoryBean(); AegisDatabinding db = new AegisDataBinding(); db.setTypeMappingRegistry(new MyTypeMappingRegistry()); sfb.setDatabinding(db); ... Hope that works for you! - Dan On 8/27/07, tog [EMAIL PROTECTED] wrote: Hiya I have some automatically generated classes that I use to generate a server using Aegis. This is done programmaticaly. I am using an AegisServiceConfiguration class to avoid publishing methods that I want to remove. I would like similarly to remove some fields/properties from
RE: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal]
1) Create a brand new java POJO that implements TypeCreator, has a field of type TypeCreator, and (initially) delegates all the abstract methods to the field. 2) take your method of TypeCreator that delivers the entire type for a class, and change it from pure delegation to throwing out the things you don't want. I'm not quite clear on the practicality of item #2. I will try to read some code and get back to you later. -Original Message- From: tog [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 26, 2007 9:51 AM To: cxf-user@incubator.apache.org Subject: Re: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] Benson, Dan, Could you elaborate a bit on this or detail the steps because I am not familiar with this. I will then try to test it. Basically, I have only POGO for which I would like to remove systematically a property. Thanks Guillaume On 9/21/07, Benson Margulies [EMAIL PROTECTED] wrote: I have a sudden inspiration here. Make a 'filter' for the TypeCreator interface. Grab the usual type creator chain (from getTypeCreator()) and stick it into your filter object. Make your filter post-edit the Type that it creates to remove the things you don't love. It may be that the registry is final because the idea is that it's just the, well, registry. All the customization-worthy behavior really occurs in the creator chain. Perhaps a Dan can amplify? -Original Message- From: Benson Margulies [mailto:[EMAIL PROTECTED] Sent: Friday, September 21, 2007 4:48 PM To: cxf-user@incubator.apache.org Subject: RE: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] One additional note: before launching down this path, I strongly suggest an experiment in just patching the source of CXF in that method of XMLTypeCreator to prove feasibility. -Original Message- From: Benson Margulies [mailto:[EMAIL PROTECTED] Sent: Friday, September 21, 2007 4:43 PM To: cxf-user@incubator.apache.org Subject: RE: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] I don't have a clue why DefaultTypeMappingRegistry is final. It looks like a mistake. Why put protected methods in a final class? Here's my temporary prescription. 1) make a subclass of XMLTypeCreator. You'll probably have to override createClassInfo(PropertyDescriptor). If you get one of the properties you don't like, return null. (I could be wrong about null). In real life, the ignore property is noted way down in the BeanTypeInfo, and overriding \that/ would be a ton of work. 2) Assembly a chain of type creators like that assembled in the default type mapping registry, with your subclass at the front. Pass it to setTypeCreator on the type mapping registry. Removing the wayward 'final' is an easy patch post 2.0.2, and I'd consider some feature development (in the Configuration) object to allow this from Spring configuration (a pattern of unloved property names?). -Original Message- From: tog [mailto:[EMAIL PROTECTED] Sent: Friday, September 21, 2007 4:22 PM To: cxf-user@incubator.apache.org Subject: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] There seems to be an renewed interest for Aegi on the list (thanks Benson ;-) ) Can someone comment if what I want to achieve is do-able ? According to Dan D. it is. I am clueless regarding step 4 (quoted below) Thanks Guillaume -- Forwarded message -- From: tog [EMAIL PROTECTED] Date: Sep 11, 2007 4:20 PM Subject: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] To: cxf-user@incubator.apache.org Hi Dan, Sorry not to follow up quickly. Actually, the DefaultTypaMappingRegistry is final and cannot be extended as you suggest. Some more insights on what I want to achieve. Today, in GroovyWS, the users have to write a .aegis.xml file for each bean they will write in Groovy. This file is always the same containing the line: property name=metaClass ignore=true/ I would like to modify the behavior of the BeanType inside the Aegis Binding so that if such a field is present it can be ignored. Is there some documentation on how to modify the DefaultTypeMappingRegisty ? Cheers Guillaume Step 4: Write your own type registry to return your own TypeCreator public class MyTypeMappingRegistry extends DefaultTypeMappingRegistry { protected AbstractTypeCreator createDefaultTypeCreator() { AbstractTypeCreator creator = new MyTypeCreator
DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal]
There seems to be an renewed interest for Aegi on the list (thanks Benson ;-) ) Can someone comment if what I want to achieve is do-able ? According to Dan D. it is. I am clueless regarding step 4 (quoted below) Thanks Guillaume -- Forwarded message -- From: tog [EMAIL PROTECTED] Date: Sep 11, 2007 4:20 PM Subject: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] To: cxf-user@incubator.apache.org Hi Dan, Sorry not to follow up quickly. Actually, the DefaultTypaMappingRegistry is final and cannot be extended as you suggest. Some more insights on what I want to achieve. Today, in GroovyWS, the users have to write a .aegis.xml file for each bean they will write in Groovy. This file is always the same containing the line: property name=metaClass ignore=true/ I would like to modify the behavior of the BeanType inside the Aegis Binding so that if such a field is present it can be ignored. Is there some documentation on how to modify the DefaultTypeMappingRegisty ? Cheers Guillaume Step 4: Write your own type registry to return your own TypeCreator public class MyTypeMappingRegistry extends DefaultTypeMappingRegistry { protected AbstractTypeCreator createDefaultTypeCreator() { AbstractTypeCreator creator = new MyTypeCreator(); creator.setConfiguration(getConfiguration()); return creator; } } Step 5: use it: ServerFactoryBean sfb = new ServerFactoryBean(); AegisDatabinding db = new AegisDataBinding(); db.setTypeMappingRegistry(new MyTypeMappingRegistry()); sfb.setDatabinding(db); ... Hope that works for you! - Dan On 8/27/07, tog [EMAIL PROTECTED] wrote: Hiya I have some automatically generated classes that I use to generate a server using Aegis. This is done programmaticaly. I am using an AegisServiceConfiguration class to avoid publishing methods that I want to remove. I would like similarly to remove some fields/properties from the serialization process. How is that possible (programmaticaly) ? Thanks for your help. Guillaume -- Best Regards Guillaume http://cheztog.blogspot.com -- Best Regards Guillaume http://cheztog.blogspot.com -- Best Regards Guillaume http://cheztog.blogspot.com
RE: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal]
I don't have a clue why DefaultTypeMappingRegistry is final. It looks like a mistake. Why put protected methods in a final class? Here's my temporary prescription. 1) make a subclass of XMLTypeCreator. You'll probably have to override createClassInfo(PropertyDescriptor). If you get one of the properties you don't like, return null. (I could be wrong about null). In real life, the ignore property is noted way down in the BeanTypeInfo, and overriding \that/ would be a ton of work. 2) Assembly a chain of type creators like that assembled in the default type mapping registry, with your subclass at the front. Pass it to setTypeCreator on the type mapping registry. Removing the wayward 'final' is an easy patch post 2.0.2, and I'd consider some feature development (in the Configuration) object to allow this from Spring configuration (a pattern of unloved property names?). -Original Message- From: tog [mailto:[EMAIL PROTECTED] Sent: Friday, September 21, 2007 4:22 PM To: cxf-user@incubator.apache.org Subject: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] There seems to be an renewed interest for Aegi on the list (thanks Benson ;-) ) Can someone comment if what I want to achieve is do-able ? According to Dan D. it is. I am clueless regarding step 4 (quoted below) Thanks Guillaume -- Forwarded message -- From: tog [EMAIL PROTECTED] Date: Sep 11, 2007 4:20 PM Subject: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] To: cxf-user@incubator.apache.org Hi Dan, Sorry not to follow up quickly. Actually, the DefaultTypaMappingRegistry is final and cannot be extended as you suggest. Some more insights on what I want to achieve. Today, in GroovyWS, the users have to write a .aegis.xml file for each bean they will write in Groovy. This file is always the same containing the line: property name=metaClass ignore=true/ I would like to modify the behavior of the BeanType inside the Aegis Binding so that if such a field is present it can be ignored. Is there some documentation on how to modify the DefaultTypeMappingRegisty ? Cheers Guillaume Step 4: Write your own type registry to return your own TypeCreator public class MyTypeMappingRegistry extends DefaultTypeMappingRegistry { protected AbstractTypeCreator createDefaultTypeCreator() { AbstractTypeCreator creator = new MyTypeCreator(); creator.setConfiguration(getConfiguration()); return creator; } } Step 5: use it: ServerFactoryBean sfb = new ServerFactoryBean(); AegisDatabinding db = new AegisDataBinding(); db.setTypeMappingRegistry(new MyTypeMappingRegistry()); sfb.setDatabinding(db); ... Hope that works for you! - Dan On 8/27/07, tog [EMAIL PROTECTED] wrote: Hiya I have some automatically generated classes that I use to generate a server using Aegis. This is done programmaticaly. I am using an AegisServiceConfiguration class to avoid publishing methods that I want to remove. I would like similarly to remove some fields/properties from the serialization process. How is that possible (programmaticaly) ? Thanks for your help. Guillaume -- Best Regards Guillaume http://cheztog.blogspot.com -- Best Regards Guillaume http://cheztog.blogspot.com -- Best Regards Guillaume http://cheztog.blogspot.com
RE: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal]
Jacob, I'm definitely the new guy on the volunteer block on Aegis. When Dan isn't off at a conference, he generally jumps on Aegis issues quickly. I'm pitching in as well, but I'm still not entirely confident about some architectural issues. I'm sure we'll get to this stuff. We just added a JIRA category for Aegis, please make sure that your issues have it selected. --benson -Original Message- From: Jacob Marcus [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 7:45 AM To: cxf-user@incubator.apache.org Subject: Re: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] Benson, I have seen a couple of issues related to Aegis binding. 1) If the simple front end POJO has java.lang.Object in it's signature, binding fails if you send subclasses of Object in the soap message. This is fairly easy to reproduce and seems to be related the name space handling in the ObjectType class. I have solved it temporarily by extending the ObjectType. 2) I have logged a Jira issue. (My first issue, so please forgive me if have not filled all the fields correctly). http://issues.apache.org/jira/browse/CXF-992 I hope these are on some one's radar. Thanks, Jacob On 9/12/07, Benson Margulies [EMAIL PROTECTED] wrote: I have some ideas in this area, but we need to finish some of what's currently outstanding. We could enhance the options class. -Original Message- From: tog [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 10:21 AM To: cxf-user@incubator.apache.org Subject: DefaultTypaMappingRegistry issue [was: Aegis binding and property/fiels removal] Hi Dan, Sorry not to follow up quickly. Actually, the DefaultTypaMappingRegistry is final and cannot be extended as you suggest. Some more insights on what I want to achieve. Today, in GroovyWS, the users have to write a .aegis.xml file for each bean they will write in Groovy. This file is always the same containing the line: property name=metaClass ignore=true/ I would like to modify the behavior of the BeanType inside the Aegis Binding so that if such a field is present it can be ignored. Is there some documentation on how to modify the DefaultTypeMappingRegisty ? Cheers Guillaume Step 4: Write your own type registry to return your own TypeCreator public class MyTypeMappingRegistry extends DefaultTypeMappingRegistry { protected AbstractTypeCreator createDefaultTypeCreator() { AbstractTypeCreator creator = new MyTypeCreator(); creator.setConfiguration(getConfiguration()); return creator; } } Step 5: use it: ServerFactoryBean sfb = new ServerFactoryBean(); AegisDatabinding db = new AegisDataBinding(); db.setTypeMappingRegistry(new MyTypeMappingRegistry()); sfb.setDatabinding(db); ... Hope that works for you! - Dan On 8/27/07, tog [EMAIL PROTECTED] wrote: Hiya I have some automatically generated classes that I use to generate a server using Aegis. This is done programmaticaly. I am using an AegisServiceConfiguration class to avoid publishing methods that I want to remove. I would like similarly to remove some fields/properties from the serialization process. How is that possible (programmaticaly) ? Thanks for your help. Guillaume -- Best Regards Guillaume http://cheztog.blogspot.com -- Best Regards Guillaume http://cheztog.blogspot.com
Re: UnsupportedOperationException when using @WebFault with Aegis binding
Has anyone looked into this? I'm pretty sure this is a bug which makes it impossible to use an Aegis binding while using @WebFault. As mentioned in the original post this is happening because Node.class is not being checked for in AegisDatabinding.createWriter(). Any ideas? Zarar Siddiqi wrote: I've created a JIRA for this: https://issues.apache.org/jira/browse/CXF-896 Has anyone gotten Aegis + @WebFault to work together? Zarar Siddiqi wrote: Hi, I'm getting an UnsupportedOperationException using Aegis binding and JAX-WS frontend. Here's my setup starting with the Spring beans: bean id=aegisBean class=org.apache.cxf.aegis.databinding.AegisDatabinding/ jaxws:endpoint id=sportsServiceEndpoint implementor=#sportsService address=/SportsService jaxws:serviceFactory bean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=dataBinding ref=aegisBean/ property name=serviceConfigurations list bean class=org.apache.cxf.jaxws.support.JaxWsServiceConfiguration/ bean class=org.apache.cxf.aegis.databinding.AegisServiceConfiguration/ bean class=org.apache.cxf.service.factory.DefaultServiceConfiguration/ /list /property /bean /jaxws:serviceFactory /jaxws:endpoint Here's the exception class: @WebFault(name=WebServiceException) public class WebServiceException extends RuntimeException { // constructors hidden for brevity public Object getFaultInfo() { } } Here's the stacktrace: java.lang.UnsupportedOperationException at org.apache.cxf.aegis.databinding.AegisDatabinding.createWriter(AegisDatabinding.java:109) at org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor.handleMessage(WebFaultOutInterceptor.java:82) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:90) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:224) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:73) at org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:78) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:231) I can actually see this exception coming. In WebFaultOutInterceptor.handleMessage() the line DataWriter writer = service.getDataBinding().createWriter(Node.class) ; invokes AegisDatabinding.createWriter() where Node.class isn't being looked for: public T DataWriterT createWriter(ClassT cls) { if (cls.equals(XMLStreamWriter.class)) { return (DataWriterT)new XMLStreamDataWriter(this); } else { throw new UnsupportedOperationException(); } } Any ideas how to avoid this exception? Is my configuration wrong or is this a bug? Thanks, Zarar -- View this message in context: http://www.nabble.com/UnsupportedOperationException-when-using-%40WebFault-with-Aegis-binding-tf4231074.html#a12616012 Sent from the cxf-user mailing list archive at Nabble.com.
Re: Aegis binding and property/fiels removal
Hi Guillaume This is a little bit tricky, but doable I think. Step 1: Write your own TypeCreator which initializes a MyBeanType with your own BeanTypeInfo. BeanTypeInfos provides metadata about how to map beans to xml. public class MyTypeCreator extends DefaultTypeCreator { @Override public Type createDefaultType(TypeClassInfo info) { MyBeanType type = new MyBeanType(); type.setSchemaType(createQName(info.getTypeClass())); type.setTypeClass(info.getTypeClass()); type.setTypeMapping(getTypeMapping()); BeanTypeInfo typeInfo = type.getTypeInfo(); typeInfo.setDefaultMinOccurs (getConfiguration().getDefaultMinOccurs()); typeInfo.setExtensibleAttributes (getConfiguration().isDefaultExtensibleAttributes()); typeInfo.setExtensibleElements (getConfiguration().isDefaultExtensibleElements()); return type; } } Step 2: Write the MyBeanType class which creates a MyBeanTypeInfo: public class MyBeanType extends BeanType { public BeanTypeInfo createTypeInfo() { MyBeanTypeInfo inf = new MyBeanTypeInfo(getTypeClass(), getSchemaType().getNamespaceURI()); inf.setTypeMapping(getTypeMapping()); return inf; } } Step3: Write a MyBeanTypeInfo: public class MyBeanTypeInfo extends BeanTypeInfo { ... write constructors protected boolean isElement(PropertyDescriptor desc) { // add some custom logic to determine if you want this property to be mapped return true; } } Step 4: Write your own type registry to return your own TypeCreator public class MyTypeMappingRegistry extends DefaultTypeMappingRegistry { protected AbstractTypeCreator createDefaultTypeCreator() { AbstractTypeCreator creator = new MyTypeCreator(); creator.setConfiguration(getConfiguration()); return creator; } } Step 5: use it: ServerFactoryBean sfb = new ServerFactoryBean(); AegisDatabinding db = new AegisDataBinding(); db.setTypeMappingRegistry(new MyTypeMappingRegistry()); sfb.setDatabinding(db); ... Hope that works for you! - Dan On 8/27/07, tog [EMAIL PROTECTED] wrote: Hiya I have some automatically generated classes that I use to generate a server using Aegis. This is done programmaticaly. I am using an AegisServiceConfiguration class to avoid publishing methods that I want to remove. I would like similarly to remove some fields/properties from the serialization process. How is that possible (programmaticaly) ? Thanks for your help. Guillaume
RE: Aegis binding and property/fiels removal
I tried something like this once in an effort to take control of namespace prefix selection. I failed. However, it looks here as if the protocol facilitates what you want here, unlike (sadly) what I wanted. -Original Message- From: Dan Diephouse [mailto:[EMAIL PROTECTED] Sent: Monday, August 27, 2007 1:23 PM To: cxf-user@incubator.apache.org Subject: Re: Aegis binding and property/fiels removal Hi Guillaume This is a little bit tricky, but doable I think. Step 1: Write your own TypeCreator which initializes a MyBeanType with your own BeanTypeInfo. BeanTypeInfos provides metadata about how to map beans to xml. public class MyTypeCreator extends DefaultTypeCreator { @Override public Type createDefaultType(TypeClassInfo info) { MyBeanType type = new MyBeanType(); type.setSchemaType(createQName(info.getTypeClass())); type.setTypeClass(info.getTypeClass()); type.setTypeMapping(getTypeMapping()); BeanTypeInfo typeInfo = type.getTypeInfo(); typeInfo.setDefaultMinOccurs (getConfiguration().getDefaultMinOccurs()); typeInfo.setExtensibleAttributes (getConfiguration().isDefaultExtensibleAttributes()); typeInfo.setExtensibleElements (getConfiguration().isDefaultExtensibleElements()); return type; } } Step 2: Write the MyBeanType class which creates a MyBeanTypeInfo: public class MyBeanType extends BeanType { public BeanTypeInfo createTypeInfo() { MyBeanTypeInfo inf = new MyBeanTypeInfo(getTypeClass(), getSchemaType().getNamespaceURI()); inf.setTypeMapping(getTypeMapping()); return inf; } } Step3: Write a MyBeanTypeInfo: public class MyBeanTypeInfo extends BeanTypeInfo { ... write constructors protected boolean isElement(PropertyDescriptor desc) { // add some custom logic to determine if you want this property to be mapped return true; } } Step 4: Write your own type registry to return your own TypeCreator public class MyTypeMappingRegistry extends DefaultTypeMappingRegistry { protected AbstractTypeCreator createDefaultTypeCreator() { AbstractTypeCreator creator = new MyTypeCreator(); creator.setConfiguration(getConfiguration()); return creator; } } Step 5: use it: ServerFactoryBean sfb = new ServerFactoryBean(); AegisDatabinding db = new AegisDataBinding(); db.setTypeMappingRegistry(new MyTypeMappingRegistry()); sfb.setDatabinding(db); ... Hope that works for you! - Dan On 8/27/07, tog [EMAIL PROTECTED] wrote: Hiya I have some automatically generated classes that I use to generate a server using Aegis. This is done programmaticaly. I am using an AegisServiceConfiguration class to avoid publishing methods that I want to remove. I would like similarly to remove some fields/properties from the serialization process. How is that possible (programmaticaly) ? Thanks for your help. Guillaume
UnsupportedOperationException when using @WebFault with Aegis binding
Hi, I'm getting an UnsupportedOperationException using Aegis binding and JAX-WS frontend. Here's my setup starting with the Spring beans: bean id=aegisBean class=org.apache.cxf.aegis.databinding.AegisDatabinding/ jaxws:endpoint id=sportsServiceEndpoint implementor=#sportsService address=/SportsService jaxws:serviceFactory bean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=dataBinding ref=aegisBean/ property name=serviceConfigurations list bean class=org.apache.cxf.jaxws.support.JaxWsServiceConfiguration/ bean class=org.apache.cxf.aegis.databinding.AegisServiceConfiguration/ bean class=org.apache.cxf.service.factory.DefaultServiceConfiguration/ /list /property /bean /jaxws:serviceFactory /jaxws:endpoint Here's the exception class: @WebFault(name=WebServiceException) public class WebServiceException extends RuntimeException { // constructors hidden for brevity public Object getFaultInfo() { } } Here's the stacktrace: java.lang.UnsupportedOperationException at org.apache.cxf.aegis.databinding.AegisDatabinding.createWriter(AegisDatabinding.java:109) at org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor.handleMessage(WebFaultOutInterceptor.java:82) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:90) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:224) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:73) at org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:78) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:231) I can actually see this exception coming. In WebFaultOutInterceptor.handleMessage() the line DataWriter writer = service.getDataBinding().createWriter(Node.class) ; invokes AegisDatabinding.createWriter() where Node.class isn't being looked for: public T DataWriterT createWriter(ClassT cls) { if (cls.equals(XMLStreamWriter.class)) { return (DataWriterT)new XMLStreamDataWriter(this); } else { throw new UnsupportedOperationException(); } } Any ideas how to avoid this exception? Is my configuration wrong or is this a bug? Thanks, Zarar -- View this message in context: http://www.nabble.com/UnsupportedOperationException-when-using-%40WebFault-with-Aegis-binding-tf4231074.html#a12037196 Sent from the cxf-user mailing list archive at Nabble.com.
Re: Exception not showing up in WSDL with Aegis binding
If you're using the JAX-WS frontend, then you do need to use the @WebFault annotation per the JAX-WS spec. With the simple frontend there were some bugs in 2.0, but I believe this is fixed in 2.0.1 which will be released in the next few days (fingers crossed - we're voting on it right now). In the mean time you can try a SNAPSHOT build if you want. Cheers, - Dan On 8/3/07, Zarar Siddiqi [EMAIL PROTECTED] wrote: The solution was to specify a name attribute for the @WebFault annotation. Once I specified @WebFault(name=WSException), it appeared in the WSDL. Wouldn't it be better if it defaulted to the class name? It would me more inline with how XFire rendered the WSDL. Zarar Zarar Siddiqi wrote: I'm using the Aegis binding and all is well except that the Exception (Fault) is not showing up in the WSDL. Here's my Spring config. bean id=aegisBean class=org.apache.cxf.aegis.databinding.AegisDatabinding/ bean id=aegisServiceFactoryBean class=org.apache.cxf.aegis.databinding.AegisServiceFactoryBean/ bean class=org.apache.cxf.frontend.ServerFactoryBean init-method=create property name=serviceBean ref=personSoapService/ property name=address value=/PersonService/ property name=dataBinding ref=aegisBean/ property name=serviceFactory ref=aegisServiceFactoryBean/ /bean My interface and implementation classes have methods called: public Email getEmail() throws WSException; public Address getAddress() throws WSException; The Email and and Address objects get translated to complexType name=Email and complexType name=Address but the WSException never shows up in the WSDL. I'm migrating from XFire and this was never a problem there. There's a xsd:complexType name=WSException missing from the WSDL that is generated through CXF which was present in XFire. I tried annotating WSException with the @WebFault annotation but that didn't help. Is this is a bug or am I missing something? Any help is appreciated. Thanks, Zarar -- View this message in context: http://www.nabble.com/Exception-not-showing-up-in-WSDL-with-Aegis-binding-tf4208423.html#a11977298 Sent from the cxf-user mailing list archive at Nabble.com. -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
WSDL Generation problem using Aegis binding
Below is a snippet of the WSDL that's getting generated using Aegis binding with the embedded server and causing errors. We're doing Java first development, no annotations or anything as these are all internal appsl. When the .NET client tried to connect we were getting a bizarre error which I believe I have been able to track down using soapui. At the bottom of this message is a fragment of the wsdl generated. I am very green at wsdl, but the problem seems to be that for every complex type being defined in the schema, before the complexType node there is an element node by the same name. SoapUI is what led me to this conclusion because it rasies an error trying to pull in the wsdl that the type is not defined at http://www.w3.org/2001/XMLSchema. So, I believe the element node that is preceding each complexType node is an error. The bizarre thing is that we have other classes generating wsdl just fine and on those services there is not element node preceding each complexType node of the same name. Any clue what could be causing this error? ?xml version=1.0 encoding=utf-8?wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:ns1=http://service.afp.prg.com/; xmlns:ns2=http://schemas.xmlsoap.org/soap/http; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=AFPManagerService targetNamespace=http://service.afp.prg.com/; wsdl:types schema xmlns=http://www.w3.org/2001/XMLSchema; attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://service.afp.prg.com/; complexType name=ArrayOfString sequence element maxOccurs=unbounded minOccurs=0 name=string nillable=true type=string/ /sequence /complexType element name=getDataWarnings type=getDataWarnings/ complexType name=getDataWarnings sequence element minOccurs=0 name=arg00 type=string/ element name=arg11 type=long/ element name=arg22 type=boolean/ /sequence /complexType element name=getDataWarningsResponse type=getDataWarningsResponse/ complexType name=getDataWarningsResponse sequence element maxOccurs=unbounded minOccurs=0 name=return type=ArrayOfString/ /sequence /complexType element name=finishImport type=finishImport/ complexType name=finishImport sequence element name=arg00 type=long/ element name=arg11 type=boolean/ /sequence /complexType element name=finishImportResponse type=finishImportResponse/ complexType name=finishImportResponse sequence element name=return type=long/ /sequence /complexType /schema Princeton Retirement Group, Inc - Important Terms This E-mail is not intended for distribution to, or use by, any person or entity in any location where such distribution or use would be contrary to law or regulation, or which would subject Princeton Retirement Group, Inc. or any affiliate to any registration requirement within such location. This E-mail may contain privileged or confidential information or may otherwise be protected by work product immunity or other legal rules. No confidentiality or privilege is waived or lost by any mistransmission. Access, copying or re-use of information by non-intended or non-authorized recipients is prohibited. If you are not an intended recipient of this E-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute any portion of this E-mail. The transmission and content of this E-mail cannot be guaranteed to be secure or error-free. Therefore, we cannot represent that the information in this E-mail is complete, accurate, uncorrupted, timely or free of viruses, and Princeton Retirement Group, Inc. cannot accept any liability for E-mails that have been altered in the course of delivery. Princeton Retirement Group, Inc. reserves the right to monitor, review and retain all electronic communications, including E-mail, traveling through its networks and systems (subject to and in accordance with local laws). If any of your details are incorrect or if you no longer wish to receive mailings such as this by E-mail please contact the sender by reply E-mail.
Re: WSDL Generation problem using Aegis binding
Hi Samuel, Just to clarify the error: an element definition like this is fine, the problem in this particular case is that the type for the element is not namespace qualified, so it basically means that for the element name=getDataWarnings type=getDataWarnings/ element, the type getDataWarnings is expected to be in the default namespace (which is the xmlschema namespace, as the error message implies.. ) What's missing is a namespace-prefix declaration for the target namespace and then that prefix on your elements' type.. ie schema xmlns=http://www.w3.org/2001/XMLSchema; attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://service.afp.prg.com/; should be something like schema xmlns=http://www.w3.org/2001/XMLSchema; attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://service.afp.prg.com/; xmlns:tns=http://service.afp.prg.com/; and the element should then be element name=getDataWarnings type=tns:getDataWarnings/ Don't know if this helps you resolve the error, but maybe at least understand it in more detail.. kind regards, and thanks for using soapUI ! /Ole eviware.com Clough, Samuel (USPC.PRG.Atlanta) wrote: Below is a snippet of the WSDL that's getting generated using Aegis binding with the embedded server and causing errors. We're doing Java first development, no annotations or anything as these are all internal appsl. When the .NET client tried to connect we were getting a bizarre error which I believe I have been able to track down using soapui. At the bottom of this message is a fragment of the wsdl generated. I am very green at wsdl, but the problem seems to be that for every complex type being defined in the schema, before the complexType node there is an element node by the same name. SoapUI is what led me to this conclusion because it rasies an error trying to pull in the wsdl that the type is not defined at http://www.w3.org/2001/XMLSchema. So, I believe the element node that is preceding each complexType node is an error. The bizarre thing is that we have other classes generating wsdl just fine and on those services there is not element node preceding each complexType node of the same name. Any clue what could be causing this error? ?xml version=1.0 encoding=utf-8?wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:ns1=http://service.afp.prg.com/; xmlns:ns2=http://schemas.xmlsoap.org/soap/http; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=AFPManagerService targetNamespace=http://service.afp.prg.com/; wsdl:types schema xmlns=http://www.w3.org/2001/XMLSchema; attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://service.afp.prg.com/; complexType name=ArrayOfString sequence element maxOccurs=unbounded minOccurs=0 name=string nillable=true type=string/ /sequence /complexType element name=getDataWarnings type=getDataWarnings/ complexType name=getDataWarnings sequence element minOccurs=0 name=arg00 type=string/ element name=arg11 type=long/ element name=arg22 type=boolean/ /sequence /complexType element name=getDataWarningsResponse type=getDataWarningsResponse/ complexType name=getDataWarningsResponse sequence element maxOccurs=unbounded minOccurs=0 name=return type=ArrayOfString/ /sequence /complexType element name=finishImport type=finishImport/ complexType name=finishImport sequence element name=arg00 type=long/ element name=arg11 type=boolean/ /sequence /complexType element name=finishImportResponse type=finishImportResponse/ complexType name=finishImportResponse sequence element name=return type=long/ /sequence /complexType /schema Princeton Retirement Group, Inc - Important Terms This E-mail is not intended for distribution to, or use by, any person or entity in any location where such distribution or use would be contrary to law or regulation, or which would subject Princeton Retirement Group, Inc. or any affiliate to any registration requirement within such location. This E-mail may contain privileged or confidential information or may otherwise be protected by work product immunity or other legal rules. No confidentiality or privilege is waived or lost by any mistransmission. Access, copying or re-use of information by non-intended or non-authorized recipients is prohibited. If you are not an intended recipient of this E-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute any portion of this E-mail. The transmission and content of this E-mail cannot be guaranteed to be secure or error-free. Therefore, we cannot represent that the information in this E-mail is complete, accurate, uncorrupted, timely or free of viruses, and Princeton Retirement Group, Inc. cannot accept any liability for E-mails
Re: Aegis binding
Thanks Tog, I will fix it ASAP. Cheers Freeman tog wrote: Hi Freeman, Here it is https://issues.apache.org/jira/browse/CXF-697 The test case is included. Cheers Tog On 5/30/07, Freeman Fang [EMAIL PROTECTED] wrote: Hi Tog, Would you please fill a jira issue and append your test case. I saw this ClassCastException several times in different mailthread these days. We need fix it up. Thanks very much Freeman tog wrote: Hiya I would like to know if there have been some changes regarding the Aegis binding recently (within a month or so) since I now get the following exception: Thanks Guillaume [EMAIL PROTECTED]:~/projects/groovy/cplx_groovyws/client$ groovy Client.groovy log4j:WARN No appenders could be found for logger ( org.apache.cxf.bus.spring.BusApplicationContext). log4j:WARN Please initialize the log4j system properly. 29 mai 2007 09:57:32 org.apache.cxf.bus.spring.BusApplicationContextgetConfigResources INFO: Could not find the configuration file cxf.xml on the classpath. java.lang.ClassCastException: org.apache.cxf.service.model.BindingInfo at org.apache.cxf.binding.soap.SoapTransportFactory.createEndpointInfo( SoapTransportFactory.java:208) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildEndpoint( WSDLServiceBuilder.java:453) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices( WSDLServiceBuilder.java:264) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices( WSDLServiceBuilder.java:155) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices( WSDLServiceBuilder.java:142) at org.apache.cxf.wsdl11.WSDLServiceFactory.create( WSDLServiceFactory.java:94) at org.apache.cxf.endpoint.ClientImpl.init(ClientImpl.java:104) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient (DynamicClientFactory.java:150) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient (DynamicClientFactory.java:136) at groovy.net.ws.WSClient.init(WSClient.java:64)
Aegis binding
Hiya I would like to know if there have been some changes regarding the Aegis binding recently (within a month or so) since I now get the following exception: Thanks Guillaume [EMAIL PROTECTED]:~/projects/groovy/cplx_groovyws/client$ groovy Client.groovy log4j:WARN No appenders could be found for logger ( org.apache.cxf.bus.spring.BusApplicationContext). log4j:WARN Please initialize the log4j system properly. 29 mai 2007 09:57:32 org.apache.cxf.bus.spring.BusApplicationContextgetConfigResources INFO: Could not find the configuration file cxf.xml on the classpath. java.lang.ClassCastException: org.apache.cxf.service.model.BindingInfo at org.apache.cxf.binding.soap.SoapTransportFactory.createEndpointInfo( SoapTransportFactory.java:208) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildEndpoint( WSDLServiceBuilder.java:453) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices( WSDLServiceBuilder.java:264) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices( WSDLServiceBuilder.java:155) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices( WSDLServiceBuilder.java:142) at org.apache.cxf.wsdl11.WSDLServiceFactory.create( WSDLServiceFactory.java:94) at org.apache.cxf.endpoint.ClientImpl.init(ClientImpl.java:104) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient (DynamicClientFactory.java:150) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient (DynamicClientFactory.java:136) at groovy.net.ws.WSClient.init(WSClient.java:64)
Re: Aegis binding
Hi Tog, Would you please fill a jira issue and append your test case. I saw this ClassCastException several times in different mailthread these days. We need fix it up. Thanks very much Freeman tog wrote: Hiya I would like to know if there have been some changes regarding the Aegis binding recently (within a month or so) since I now get the following exception: Thanks Guillaume [EMAIL PROTECTED]:~/projects/groovy/cplx_groovyws/client$ groovy Client.groovy log4j:WARN No appenders could be found for logger ( org.apache.cxf.bus.spring.BusApplicationContext). log4j:WARN Please initialize the log4j system properly. 29 mai 2007 09:57:32 org.apache.cxf.bus.spring.BusApplicationContextgetConfigResources INFO: Could not find the configuration file cxf.xml on the classpath. java.lang.ClassCastException: org.apache.cxf.service.model.BindingInfo at org.apache.cxf.binding.soap.SoapTransportFactory.createEndpointInfo( SoapTransportFactory.java:208) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildEndpoint( WSDLServiceBuilder.java:453) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices( WSDLServiceBuilder.java:264) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices( WSDLServiceBuilder.java:155) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices( WSDLServiceBuilder.java:142) at org.apache.cxf.wsdl11.WSDLServiceFactory.create( WSDLServiceFactory.java:94) at org.apache.cxf.endpoint.ClientImpl.init(ClientImpl.java:104) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient (DynamicClientFactory.java:150) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient (DynamicClientFactory.java:136) at groovy.net.ws.WSClient.init(WSClient.java:64)
Re: Aegis binding: What am I doing wrong ?
Anything particularly weird about it? Feel free to create a JIRA issue with the WSDl and I'll take a look... - Dan On 5/9/07, tog [EMAIL PROTECTED] wrote: I have the small following test: package com.acme.test; public class serviceClass { String sayHello(String name){ return Hello + name; } } with: package com.acme.test; import org.apache.cxf.aegis.databinding.AegisDatabinding; import org.apache.cxf.frontend.ServerFactoryBean; import org.apache.cxf.aegis.databinding.AegisServiceConfiguration; public class server { public static void main(String[] args) { ServerFactoryBean sf = new ServerFactoryBean(); sf.setServiceClass(serviceClass.class); sf.setAddress(http://localhost:8080/service;); sf.getServiceFactory().setDataBinding(new AegisDatabinding()); sf.getServiceFactory().getServiceConfigurations().add(0, new AegisServiceConfiguration()); sf.create(); } } This looks quite correct with respect to the cxf users' guide. But the wsdl I got looks quite weierd. I am using cxf-2.0-RC ! Does anyone have an idea of what I am doing wrong ? Cheers Guillaume -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog