Re: how clients handle changing wsdls
Hi Christian, I think if you still use the old wsdl to create the service , the client can still work. I just did a quick test for your case by remove the WSDL2Java generated SEI's method. It can reproduce your case. On the client side if I use the ?wsdl which is generated by CXF to create the service , the client can still work. But if I specified the orginal WSDL , I got the below exception. Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find a matching method for operation {http://apache.org/hello_world_soap_http}greetMeOneWay at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:323) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:184) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:214) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:269) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:146) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:91) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:94) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271) Any thoughts? Willem. Christian Vest Hansen wrote: If you generate a java client from a wsdl, and then add an operation to the wsdl but forget to update the client code - how does CXF handle that situation? Will the client crash or blissfully hum along (but withut being able to invoke the new operation)? I'm asking because it might influence decisions and policies one might define for managing change and backwards compatibility when working with CXF web services and clients.
jaxws validation
Anyone have any ideas how to turn on validation jabx unmarshalling? My service is receiving a request that is invalid however it is being unmarshalled as normal. Thanks -- View this message in context: http://www.nabble.com/jaxws-validation-tf4689811.html#a13403665 Sent from the cxf-user mailing list archive at Nabble.com.
Re: jaxws validation
sweet thanks - is there a list of all these properties/features anywhere so that we aren't bothering all you guys with questions? Willem2 wrote: Hi, You could turn on the validation by configuration like this[1] [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/distribution/src/main/release/samples/wsdl_first/cxf.xml Willem. Adrian C wrote: Anyone have any ideas how to turn on validation jabx unmarshalling? My service is receiving a request that is invalid however it is being unmarshalled as normal. Thanks -- View this message in context: http://www.nabble.com/jaxws-validation-tf4689811.html#a13404133 Sent from the cxf-user mailing list archive at Nabble.com.
RE: undocumented configuration with jetty
What version of jetty? -Original Message- From: Miguel De Anda [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 24, 2007 10:29 PM To: cxf-user@incubator.apache.org Subject: undocumented configuration with jetty i've got an application (my server) that launches its own jetty server for sending files to external nodes. they currently talk to each other using simple xml passed in as a post request and in the response. the external nodes don't run a web server of any kind. i now need to add a soap interface on my server but can't figure out how. this is how my jetty server is started: ServletHolder servlet; org.mortbay.jetty.Server jettyServer = new org.mortbay.jetty.Server(PORT); Context root = new Context(jettyServer, /, Context.SESSIONS); servlet = new ServletHolder(someServlet); root.addServlet(servlet, /*); CXFServlet cxf = new CXFServlet(); servlet = new ServletHolder(cxf); servlet.setName(soap); servlet.setForcedPath(soap); root.addServlet(servlet, /soap/*); HelloWorld hw = new HelloWorldImpl(); Endpoint.publish(/soap/HelloWorld, hw); jettyServer.start(); package a.b.c; import javax.jws.WebService; @WebService public interface HelloWorld { String sayHi(String text); } import javax.jws.WebService; @WebService(endpointInterface = a.b.c.HelloWorld) public class HelloWorldImpl implements HelloWorld { public String sayHi(String text) { return The interesting question becomes is what is soap?; } } i got errors ranging from a null pointer exception when i went to http://localhost:PORT/soap/ to /soap/HelloWorld not being a valid url (in the line Endpoint.publish). i had to set a full url there, when i used http://localhost:PORT/soap/HelloWorld; it told me that the port was being used, so i figured its launching its own internal instance of jetty (or whatever it uses). i then replaced the port to some 8087 and it almost works, but i get a faultstringNo such operation: /faultstring message when viewing http://localhost:8087/soap/HelloWorld i would really like to be able to use the same jetty server, and be able to give access to my existing objects in my application. i'm using spring to load up an object that has all of my configuration settings but not in the same way you would in a typical web app that runs on a webserver. the customer currently has access to that spring config file and it would be wrong to give them access (or force them to configure) the soap services. in other words, my app is launched this way: public static void main(...) { Resource resource = new FileSystemResource(config); BeanFactory factory = new XmlBeanFactory(resource); Config config = (Config)factory.getBean(bean); configApp(config); startServices(); } Actual error messages: (using /soap/... in publish line) Caused by: java.net.MalformedURLException: no protocol: /soap/HelloWorld 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(JettyHTT PD estination.java:87) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDest in ation(JettyHTTPTransportFactory.java:96) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestina ti on(JettyHTTPTransportFactory.java:83) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTran sp ortFactory.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: 10 8) ... 8 more (using http://...:PORT/ in publish line) Exception in thread main java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) ** This email, its content and any attachments is PRIVATE AND CONFIDENTIAL to TANDBERG Television, Part of the Ericsson Group. If received in error please notify the sender and destroy the original message and attachments. www.tandbergtv.com **
Re: how clients handle changing wsdls
I recall seing a stack trace like that, which prompted my query. But if it, in this particular use case, always works if the client refer directly to the ?wsdl from the online service, then it's just something to keep in mind when creating clients. However, this confuses me: I think if you still use the old wsdl to create the service , the client can still work. (...) On the client side if I use the ?wsdl which is generated by CXF to create the service , the client can still work. This sounds contradictory to me, given that one of thos scenarios resulted in the stack trace you provided. Could you clarify? 2007/10/25, Willem Jiang [EMAIL PROTECTED]: Hi Christian, I think if you still use the old wsdl to create the service , the client can still work. I just did a quick test for your case by remove the WSDL2Java generated SEI's method. It can reproduce your case. On the client side if I use the ?wsdl which is generated by CXF to create the service , the client can still work. But if I specified the orginal WSDL , I got the below exception. Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find a matching method for operation {http://apache.org/hello_world_soap_http}greetMeOneWay at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:323) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:184) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:214) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:269) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:146) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:91) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:94) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271) Any thoughts? Willem. Christian Vest Hansen wrote: If you generate a java client from a wsdl, and then add an operation to the wsdl but forget to update the client code - how does CXF handle that situation? Will the client crash or blissfully hum along (but withut being able to invoke the new operation)? I'm asking because it might influence decisions and policies one might define for managing change and backwards compatibility when working with CXF web services and clients. -- Venlig hilsen / Kind regards, Christian Vest Hansen.
Re: undocumented configuration with jetty
Hi, You need to use the bus of the CXFServlet. You could use the CXF Servlet transport with this bus. Please add the below code just before Endpoint.publish(...) Bus bus = cxf.getBus(); BusFactory.setDefaultBus(bus); Willem. Miguel De Anda-2 wrote: i've got an application (my server) that launches its own jetty server for sending files to external nodes. they currently talk to each other using simple xml passed in as a post request and in the response. the external nodes don't run a web server of any kind. i now need to add a soap interface on my server but can't figure out how. this is how my jetty server is started: ServletHolder servlet; org.mortbay.jetty.Server jettyServer = new org.mortbay.jetty.Server(PORT); Context root = new Context(jettyServer, /, Context.SESSIONS); servlet = new ServletHolder(someServlet); root.addServlet(servlet, /*); CXFServlet cxf = new CXFServlet(); servlet = new ServletHolder(cxf); servlet.setName(soap); servlet.setForcedPath(soap); root.addServlet(servlet, /soap/*); HelloWorld hw = new HelloWorldImpl(); Endpoint.publish(/soap/HelloWorld, hw); jettyServer.start(); package a.b.c; import javax.jws.WebService; @WebService public interface HelloWorld { String sayHi(String text); } import javax.jws.WebService; @WebService(endpointInterface = a.b.c.HelloWorld) public class HelloWorldImpl implements HelloWorld { public String sayHi(String text) { return The interesting question becomes is what is soap?; } } i got errors ranging from a null pointer exception when i went to http://localhost:PORT/soap/ to /soap/HelloWorld not being a valid url (in the line Endpoint.publish). i had to set a full url there, when i used http://localhost:PORT/soap/HelloWorld; it told me that the port was being used, so i figured its launching its own internal instance of jetty (or whatever it uses). i then replaced the port to some 8087 and it almost works, but i get a faultstringNo such operation: /faultstring message when viewing http://localhost:8087/soap/HelloWorld i would really like to be able to use the same jetty server, and be able to give access to my existing objects in my application. i'm using spring to load up an object that has all of my configuration settings but not in the same way you would in a typical web app that runs on a webserver. the customer currently has access to that spring config file and it would be wrong to give them access (or force them to configure) the soap services. in other words, my app is launched this way: public static void main(...) { Resource resource = new FileSystemResource(config); BeanFactory factory = new XmlBeanFactory(resource); Config config = (Config)factory.getBean(bean); configApp(config); startServices(); } Actual error messages: (using /soap/... in publish line) Caused by: java.net.MalformedURLException: no protocol: /soap/HelloWorld 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:87) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTPTransportFactory.java:96) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTransportFactory.java:83) 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:108) ... 8 more (using http://...:PORT/ in publish line) Exception in thread main java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) ** This email, its content and any attachments is PRIVATE AND CONFIDENTIAL to TANDBERG Television, Part of the Ericsson Group. If received in error please notify the sender and destroy the original message and attachments. www.tandbergtv.com ** -- View this message in context: http://www.nabble.com/undocumented-configuration-with-jetty-tf4688264.html#a13407166 Sent from the cxf-user mailing list archive at Nabble.com.
Re: how clients handle changing wsdls
I can clarify it. It is because I don't want to right a new WSDL to reproduce your case, I just removed the method for the SEI which generate from the original wsdl. ?wsdl 's wsdl just equals to the older wsdl in your case, and the original wsdl equals newer wsdl in your case. Willem. Christian Vest Hansen wrote: I recall seing a stack trace like that, which prompted my query. But if it, in this particular use case, always works if the client refer directly to the ?wsdl from the online service, then it's just something to keep in mind when creating clients. However, this confuses me: I think if you still use the old wsdl to create the service , the client can still work. (...) On the client side if I use the ?wsdl which is generated by CXF to create the service , the client can still work. This sounds contradictory to me, given that one of thos scenarios resulted in the stack trace you provided. Could you clarify? 2007/10/25, Willem Jiang [EMAIL PROTECTED]: Hi Christian, I think if you still use the old wsdl to create the service , the client can still work. I just did a quick test for your case by remove the WSDL2Java generated SEI's method. It can reproduce your case. On the client side if I use the ?wsdl which is generated by CXF to create the service , the client can still work. But if I specified the orginal WSDL , I got the below exception. Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find a matching method for operation {http://apache.org/hello_world_soap_http}greetMeOneWay at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:323) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:184) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:214) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:269) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:146) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:91) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:94) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271) Any thoughts? Willem. Christian Vest Hansen wrote: If you generate a java client from a wsdl, and then add an operation to the wsdl but forget to update the client code - how does CXF handle that situation? Will the client crash or blissfully hum along (but withut being able to invoke the new operation)? I'm asking because it might influence decisions and policies one might define for managing change and backwards compatibility when working with CXF web services and clients. -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- View this message in context: http://www.nabble.com/how-clients-handle-changing-wsdls-tf4684521.html#a13407403 Sent from the cxf-user mailing list archive at Nabble.com.
RE: CXF First Time User Questions
Hi, You can use the below code to get the conduit. Client client = ClientProxy.getClient(soap); HTTPConduit http = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = http.getClient(); Willem. Asleson, Ryan wrote: Hi Willem, The example here: http://www.nabble.com/Proxy-settings-tf3669285.html#a10252318 Is just what I was hoping to see. One last question: In the example it talks about using the Conduit to set the proxy server and proxy host. However, how do I get a reference to the conduit? This is the code I'm using right now: ClientProxyFactoryBean factory = new ClientProxyFactoryBean(); factory.setServiceClass(ReceiveSoap.class); factory.setAddress(http://www.endpoint.com/webservice.InviteeLink/recei ve.asmx); ReceiveSoap soap = (ReceiveSoap) factory.create(); soap. . So I have a reference to my client object, but how do I get to the conduit? Thank you so much for your help, I really appreciate it!! -Ryan -Original Message- From: Willem Jiang [mailto:[EMAIL PROTECTED] Sent: Thursday, October 25, 2007 5:23 AM To: cxf-user@incubator.apache.org Subject: Re: CXF First Time User Questions Hi Ryan, My comments are in the mail. Asleson, Ryan wrote: Hi Willem, Thanks for the pointers. They were quite helpful. I'm still having trouble understanding how an http proxy host and http proxy port can be specified. This URL: http://cwiki.apache.org/CXF20DOC/client-http-transport.html Briefly mentions something about a http-conf:proxyAuthorization tag, but it doesn't give an example of how to actually specifiy the proxy host and server. In addition, there doesn't seem to be a schema definition available for help. You can find more information here [1] [1]http://www.nabble.com/using-HTTP-firewall-proxy-with-CXF-Spring-confi g-tf4232625.html#a12042089 Could you please be more explicit on how to set up proxy information? I've got to believe that this is a FAQ, especially for those of us in corporate settings. En, I will update the wiki for it. I would really rather specify the proxy host and server programmatically via Java rather than declaratively via XML. Is this not possible at all? You could configure the conduit through the Java code. You can find the sample here[2] [2]http://www.nabble.com/Proxy-settings-tf3669285.html#a10252318 Regards, Willem. Thank you!! -Ryan -Original Message- From: Jiang, Ning (Willem) [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 24, 2007 9:52 AM To: cxf-user@incubator.apache.org; cxf-user@incubator.apache.org Subject: RE: CXF First Time User Questions Hi Please see my comments in the mail. -Original Message- From: Asleson, Ryan [mailto:[EMAIL PROTECTED] Sent: Wed 10/24/2007 21:38 To: cxf-user@incubator.apache.org Subject: CXF First Time User Questions Hello, I'm a first time user of CXF. I've used other web service tools in the past and am now looking at using CXF. I have a series of questions that I hope somebody can answer for me: 1. I used the WSDL2Java tool to generate a web service client from a WSDL. I noticed that none of the generated code contains the web service endpoint URL. Where does this come from? Am I supposed to supply it programmatically at runtime? If so, how? Willem For the server side , you can specify the endpoint publish by using the JAXWS API's Endpoint.publish or by ServerFactoryBean's setAddress method. WillemFor the client side , it mainly come from the WSDL and you can also changed it by using the ProxyFactoryBean's setAddress method. WillemYou can find more information about the client side setting here[1] [1]http://www.nabble.com/Client-question-tf4357978.html#a12419843 2. Related to #1, is there a way to define, programmatically, the web service endpoint URL? We are a web service consumer, but the web service provider has a testing and a production environment. I need to be able to specify, at runtime, the endpoint to use, rather than having to specify it at compile time. Like many organizations, we promote code through various testing environments to a production environment, and I'd hate to have to specify a web service endpoint URL at compile time. Willem I think I already give you the answer. 3. Is there a way, programmatically, to specify a proxy server and proxy port? Our environment does not use the standard http.proxyHost and http.proxyPort system variables (don't ask me why) so I need a way to programmatically set the proxy server and proxy port for a web service client. Willem You can specify it in the configuration file [2] [2]http://cwiki.apache.org/CXF20DOC/client-http-transport.html 4. Is there any way that WSDL2Java can generate Java 1.4 compliant code? I see the output of
Re: jaxws validation
Hi Adrian, I don't find the doc which lists all the properties. It is time to add some documents in the CXF wiki [1] http://cwiki.apache.org/CXF20DOC/index.html Willem Adrian C wrote: sweet thanks - is there a list of all these properties/features anywhere so that we aren't bothering all you guys with questions? Willem2 wrote: Hi, You could turn on the validation by configuration like this[1] [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/distribution/src/main/release/samples/wsdl_first/cxf.xml Willem. Adrian C wrote: Anyone have any ideas how to turn on validation jabx unmarshalling? My service is receiving a request that is invalid however it is being unmarshalled as normal. Thanks -- View this message in context: http://www.nabble.com/jaxws-validation-tf4689811.html#a13407507 Sent from the cxf-user mailing list archive at Nabble.com.
cxf client for non ws-i bp compliant services?
I have an XFire 1.2.6 web service that I wan't to write a CXF client for, but when I invoke operations on this service CXF throws exceptions with messages like Found element {http://www.unwire.dk}vats but could not find matching RPC/Literal part - this is because the XFire web service dosn't comply with the WS-I Basic Profile, and qualifies the SOAP response message parts with a namespace when it shouldn't. Is there any way to lax the CXF strictness? I'de prefer it if I didn't have to touch the XFire code, but if that's the only way to go about this then I'de still like to hear any proposed solutions. Otherwise I see two other options: + scrap CXF for this particular service and do a HttpClient + StAX type of client, or.. + convince the project manager that now is the right time to port the service in question (which is unlikely) -- Venlig hilsen / Kind regards, Christian Vest Hansen.
Re: cxf client for non ws-i bp compliant services?
Can't you just use an XFire client instead? Glen Am Donnerstag, den 25.10.2007, 16:59 +0200 schrieb Christian Vest Hansen: I have an XFire 1.2.6 web service that I wan't to write a CXF client for, but when I invoke operations on this service CXF throws exceptions with messages like Found element {http://www.unwire.dk}vats but could not find matching RPC/Literal part - this is because the XFire web service dosn't comply with the WS-I Basic Profile, and qualifies the SOAP response message parts with a namespace when it shouldn't. Is there any way to lax the CXF strictness? I'de prefer it if I didn't have to touch the XFire code, but if that's the only way to go about this then I'de still like to hear any proposed solutions. Otherwise I see two other options: + scrap CXF for this particular service and do a HttpClient + StAX type of client, or.. + convince the project manager that now is the right time to port the service in question (which is unlikely)
Re: cxf client for non ws-i bp compliant services?
Would be nice to keep the number of dependencies down, but yeah, that would be feasible. I wonder why I didn't think of that. 2007/10/25, Glen Mazza [EMAIL PROTECTED]: Can't you just use an XFire client instead? Glen Am Donnerstag, den 25.10.2007, 16:59 +0200 schrieb Christian Vest Hansen: I have an XFire 1.2.6 web service that I wan't to write a CXF client for, but when I invoke operations on this service CXF throws exceptions with messages like Found element {http://www.unwire.dk}vats but could not find matching RPC/Literal part - this is because the XFire web service dosn't comply with the WS-I Basic Profile, and qualifies the SOAP response message parts with a namespace when it shouldn't. Is there any way to lax the CXF strictness? I'de prefer it if I didn't have to touch the XFire code, but if that's the only way to go about this then I'de still like to hear any proposed solutions. Otherwise I see two other options: + scrap CXF for this particular service and do a HttpClient + StAX type of client, or.. + convince the project manager that now is the right time to port the service in question (which is unlikely) -- Venlig hilsen / Kind regards, Christian Vest Hansen.
Re: undocumented configuration with jetty
using jetty 6.0.2 On Thursday 25 October 2007, Benson Margulies wrote: What version of jetty? -Original Message- From: Miguel De Anda [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 24, 2007 10:29 PM To: cxf-user@incubator.apache.org Subject: undocumented configuration with jetty i've got an application (my server) that launches its own jetty server for sending files to external nodes. they currently talk to each other using simple xml passed in as a post request and in the response. the external nodes don't run a web server of any kind. i now need to add a soap interface on my server but can't figure out how. this is how my jetty server is started: ServletHolder servlet; org.mortbay.jetty.Server jettyServer = new org.mortbay.jetty.Server(PORT); Context root = new Context(jettyServer, /, Context.SESSIONS); servlet = new ServletHolder(someServlet); root.addServlet(servlet, /*); CXFServlet cxf = new CXFServlet(); servlet = new ServletHolder(cxf); servlet.setName(soap); servlet.setForcedPath(soap); root.addServlet(servlet, /soap/*); HelloWorld hw = new HelloWorldImpl(); Endpoint.publish(/soap/HelloWorld, hw); jettyServer.start(); package a.b.c; import javax.jws.WebService; @WebService public interface HelloWorld { String sayHi(String text); } import javax.jws.WebService; @WebService(endpointInterface = a.b.c.HelloWorld) public class HelloWorldImpl implements HelloWorld { public String sayHi(String text) { return The interesting question becomes is what is soap?; } } i got errors ranging from a null pointer exception when i went to http://localhost:PORT/soap/ to /soap/HelloWorld not being a valid url (in the line Endpoint.publish). i had to set a full url there, when i used http://localhost:PORT/soap/HelloWorld; it told me that the port was being used, so i figured its launching its own internal instance of jetty (or whatever it uses). i then replaced the port to some 8087 and it almost works, but i get a faultstringNo such operation: /faultstring message when viewing http://localhost:8087/soap/HelloWorld i would really like to be able to use the same jetty server, and be able to give access to my existing objects in my application. i'm using spring to load up an object that has all of my configuration settings but not in the same way you would in a typical web app that runs on a webserver. the customer currently has access to that spring config file and it would be wrong to give them access (or force them to configure) the soap services. in other words, my app is launched this way: public static void main(...) { Resource resource = new FileSystemResource(config); BeanFactory factory = new XmlBeanFactory(resource); Config config = (Config)factory.getBean(bean); configApp(config); startServices(); } Actual error messages: (using /soap/... in publish line) Caused by: java.net.MalformedURLException: no protocol: /soap/HelloWorld 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(JettyHTT PD estination.java:87) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDest in ation(JettyHTTPTransportFactory.java:96) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestina ti on(JettyHTTPTransportFactory.java:83) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTran sp ortFactory.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: 10 8) ... 8 more (using http://...:PORT/ in publish line) Exception in thread main java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) ** This email, its content and any attachments is PRIVATE AND CONFIDENTIAL to TANDBERG Television, Part of the Ericsson Group. If received in error please notify the sender and destroy the original message and attachments. www.tandbergtv.com ** -- Miguel De Anda Software Engineer TANDBERG Television | Part of the Ericsson Group 100 N. Sepulveda Blvd. Suite 1600 | El Segundo | CA 90245 Tel: 310.591.3041 | Fax: 310.591.3099 Email: [EMAIL
Re: undocumented configuration with jetty
I tried that and nothing changed. I tried moving that block to after the jetty server is running and it doesn't make that much of a difference. Should I be worried that I have to use a full url as the first parameter to Endpoint.publish? In the example I saw, it only had the path. On Thursday 25 October 2007, Willem2 wrote: Hi, You need to use the bus of the CXFServlet. You could use the CXF Servlet transport with this bus. Please add the below code just before Endpoint.publish(...) Bus bus = cxf.getBus(); BusFactory.setDefaultBus(bus); Willem. Miguel De Anda-2 wrote: i've got an application (my server) that launches its own jetty server for sending files to external nodes. they currently talk to each other using simple xml passed in as a post request and in the response. the external nodes don't run a web server of any kind. i now need to add a soap interface on my server but can't figure out how. this is how my jetty server is started: ServletHolder servlet; org.mortbay.jetty.Server jettyServer = new org.mortbay.jetty.Server(PORT); Context root = new Context(jettyServer, /, Context.SESSIONS); servlet = new ServletHolder(someServlet); root.addServlet(servlet, /*); CXFServlet cxf = new CXFServlet(); servlet = new ServletHolder(cxf); servlet.setName(soap); servlet.setForcedPath(soap); root.addServlet(servlet, /soap/*); HelloWorld hw = new HelloWorldImpl(); Endpoint.publish(/soap/HelloWorld, hw); jettyServer.start(); package a.b.c; import javax.jws.WebService; @WebService public interface HelloWorld { String sayHi(String text); } import javax.jws.WebService; @WebService(endpointInterface = a.b.c.HelloWorld) public class HelloWorldImpl implements HelloWorld { public String sayHi(String text) { return The interesting question becomes is what is soap?; } } i got errors ranging from a null pointer exception when i went to http://localhost:PORT/soap/ to /soap/HelloWorld not being a valid url (in the line Endpoint.publish). i had to set a full url there, when i used http://localhost:PORT/soap/HelloWorld; it told me that the port was being used, so i figured its launching its own internal instance of jetty (or whatever it uses). i then replaced the port to some 8087 and it almost works, but i get a faultstringNo such operation: /faultstring message when viewing http://localhost:8087/soap/HelloWorld i would really like to be able to use the same jetty server, and be able to give access to my existing objects in my application. i'm using spring to load up an object that has all of my configuration settings but not in the same way you would in a typical web app that runs on a webserver. the customer currently has access to that spring config file and it would be wrong to give them access (or force them to configure) the soap services. in other words, my app is launched this way: public static void main(...) { Resource resource = new FileSystemResource(config); BeanFactory factory = new XmlBeanFactory(resource); Config config = (Config)factory.getBean(bean); configApp(config); startServices(); } Actual error messages: (using /soap/... in publish line) Caused by: java.net.MalformedURLException: no protocol: /soap/HelloWorld 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(JettyHTTP Destination.java:87) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDesti nation(JettyHTTPTransportFactory.java:96) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestinat ion(JettyHTTPTransportFactory.java:83) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTrans portFactory.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:1 08) ... 8 more (using http://...:PORT/ in publish line) Exception in thread main java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) ** This email, its content and any attachments is PRIVATE AND CONFIDENTIAL to TANDBERG Television, Part of the Ericsson Group. If received in error please notify the sender and destroy the original message and attachments. www.tandbergtv.com **
Re: wsdl2java NPE for liberty-idff-wsdl-v1.1.wsdl
Hi, I tested wsdl:imort for very simple schema, but it does not work at all in any case. types/schema/import worked OK for simple schema and the absolute path also worked OK. But if XSD is complcated, it does not work, I upload one wsdl file wsdl2java failed to generate code. Also CXF wsdl2java does not work with http proxy. http://www.nabble.com/file/p13415060/csta-all.wsdl csta-all.wsdl -- View this message in context: http://www.nabble.com/wsdl2java-NPE-for-liberty-idff-wsdl-v1.1.wsdl-tf4290441.html#a13415060 Sent from the cxf-user mailing list archive at Nabble.com.
Re: wsdl2java NPE for liberty-idff-wsdl-v1.1.wsdl
Hi, What does the following error mean? Both get-csta-features.xsd and extension-types.xsd are deployed in the same web site in my local computer, they are accessible from browser. thanks [java] Caused by: javax.wsdl.WSDLException: WSDLException(at /definitions/types/xs:schema/xsd:schema/xsd:schma): faultCode=OTHER_ERROR: Unable to locate with locator the schema referenced at 'extension-types.xsd' relative to document 'http://localhost/xsd/get-csta-features.xsd' [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) [java] at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:125) [java] ... 8 more -- View this message in context: http://www.nabble.com/wsdl2java-NPE-for-liberty-idff-wsdl-v1.1.wsdl-tf4290441.html#a13415635 Sent from the cxf-user mailing list archive at Nabble.com.
RE: undocumented configuration with jetty
I've done this by letting CXF configure Jetty for me. (Example at the end). You then need to write code in your application to locate the Jetty server and anything you need to connect up to it. If you don't want to do that, I'd suggest configuring your CXF service as a full webapp that deploys the CXFServlet and configures your services with Spring. Then add an org.mortbay.jetty.WebAppContext to your Jetty initialization stack, passing it a base URL and the pathname of the web app (.war or unpacked). Endpoints would look like address=/blooie, and the result is to concatenate /blooie onto the end of the context URL for the WebAppContext. httpj:engine-factory bus=cxf httpj:engine port=8808 httpj:handlers !-- bean class=org.mortbay.jetty.handler.RequestLogHandler property name=requestLog bean class=org.mortbay.jetty.NCSARequestLog property name=filename value=jetty.log/ /bean /property /bean -- bean class=org.mortbay.jetty.webapp.WebAppContext constructor-arg value=${jsunitPathname}/ constructor-arg value=/jsunit/ /bean bean class=org.mortbay.jetty.handler.ContextHandler property name=contextPath value=/${staticResourceBase} / property name=handler bean class=org.mortbay.jetty.handler.ResourceHandler property name=baseResource bean class=org.mortbay.resource.FileResource constructor-arg value=${staticResourceURL} / /bean /property /bean /property /bean /httpj:handlers /httpj:engine /httpj:engine-factory
Re: HELP - org.apache.axis.soap.MessageFactoryImpl - Strange Exception
I don't know if there's a better way to fix this, but try to somehow call: System.setProperty(javax.xml.soap.MessageFactory, com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl); Before the saaj interceptor loads. 2007/10/25, mattmadhavan [EMAIL PROTECTED]: Hello, I have configured my client beans(spring configuraiton) with the org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor and org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor. When I run my client I am getting the following exception. Why is it looking for Apache Axis' Message factory? I am using cxf 2.0.2. Any help will be appreciated. Thanks Matt Exception in thread main javax.xml.soap.SOAPException: Failed to create MessageFactory: org.apache.axis.soap.MessageFactoryImpl at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:55) at com.adobe.cairngorm.samples.store.service.ProductInfoServiceClient.main(ProductInfoServiceClient.java:57) Caused by: java.lang.ClassNotFoundException: org.apache.axis.soap.MessageFactoryImpl at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:50) -- View this message in context: http://www.nabble.com/HELP---org.apache.axis.soap.MessageFactoryImpl---Strange-Exception-tf4693600.html#a13415791 Sent from the cxf-user mailing list archive at Nabble.com. -- Venlig hilsen / Kind regards, Christian Vest Hansen.
Re: HELP - org.apache.axis.soap.MessageFactoryImpl - Strange Exception
Hi Christian, Thanks, It worked! I hope there is a better way then this! Matt Christian Vest Hansen wrote: I don't know if there's a better way to fix this, but try to somehow call: System.setProperty(javax.xml.soap.MessageFactory, com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl); Before the saaj interceptor loads. 2007/10/25, mattmadhavan [EMAIL PROTECTED]: Hello, I have configured my client beans(spring configuraiton) with the org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor and org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor. When I run my client I am getting the following exception. Why is it looking for Apache Axis' Message factory? I am using cxf 2.0.2. Any help will be appreciated. Thanks Matt Exception in thread main javax.xml.soap.SOAPException: Failed to create MessageFactory: org.apache.axis.soap.MessageFactoryImpl at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:55) at com.adobe.cairngorm.samples.store.service.ProductInfoServiceClient.main(ProductInfoServiceClient.java:57) Caused by: java.lang.ClassNotFoundException: org.apache.axis.soap.MessageFactoryImpl at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:50) -- View this message in context: http://www.nabble.com/HELP---org.apache.axis.soap.MessageFactoryImpl---Strange-Exception-tf4693600.html#a13415791 Sent from the cxf-user mailing list archive at Nabble.com. -- Venlig hilsen / Kind regards, Christian Vest Hansen. -- View this message in context: http://www.nabble.com/HELP---org.apache.axis.soap.MessageFactoryImpl---Strange-Exception-tf4693600.html#a13417811 Sent from the cxf-user mailing list archive at Nabble.com.
[FIXED] RE: CXF + Spring : Bean outside WebApp have empty properties
After hours of bloody debugging /tracing through CXF code, I found the root cause of my issue : It has to do with my JBOSS 4.0.4 GA environment I forgot to mention :( For the one who care, I wrote below a detailed explanation + solution Detailed Explanation : JAXBContext is already classloaded via jboss-j2ee.jar (/server/default/lib) prior the one packaged with CXF (jaxb-api-2.0.jar). Jboss's JABXBContext works fine for CXF as long as your JAX Beans are packaged inside the web services application. But once you move your JAX Beans outside the application, things changes in the JAXBEncoderDecoder : line 388 (for CXF 2.0.2) : obj = unmarshalWithClass ? u.unmarshal((XMLStreamReader)source, clazz) : u return an object with null properties as the Unmarshaller is not the right one as its implementor comes from Jboss instead of CXF. Solution : To fix the issue I found no other solution than copying the following jars to JBOSS_HOME/lib/endorsed directory (server/default/lib is not enough) : jaxb-api-2.0.jar jaxb-impl-2.0.5.jar geronimo-activation_1.1_spec-1.0-M1.jar stax-api-1.0.1.jar Hope this will help others ! Cheers, Bastien LEGRAS -- View this message in context: http://www.nabble.com/CXF-%2B-Spring-%3A-Bean-outside-WebApp-have-empty-properties-tf4687334.html#a13419394 Sent from the cxf-user mailing list archive at Nabble.com.
Re: undocumented configuration with jetty
Hi , I write a simple test with your case. The services are all published :) Please see the below code. public class JettyServer { public static void main(String[] args) throws Exception { org.mortbay.jetty.Server httpServer = new Server(9000); ContextHandlerCollection contexts = new ContextHandlerCollection(); httpServer.setHandler(contexts); Context root = new Context(contexts,/,Context.SESSIONS); CXFServlet cxf = new CXFServlet(); ServletHolder servlet = new ServletHolder(cxf); servlet.setName(soap); servlet.setForcedPath(soap); root.addServlet(servlet, /soap/*); httpServer.start(); Bus bus = cxf.getBus(); BusFactory.setDefaultBus(bus); // register service String uri = / +GreeterImpl.class.getSimpleName(); Endpoint.publish(uri, new GreeterImpl()); Endpoint.publish(/hello, new HelloImpl()); } } Willem. Miguel De Anda wrote: I tried that and nothing changed. I tried moving that block to after the jetty server is running and it doesn't make that much of a difference. Should I be worried that I have to use a full url as the first parameter to Endpoint.publish? In the example I saw, it only had the path. On Thursday 25 October 2007, Willem2 wrote: Hi, You need to use the bus of the CXFServlet. You could use the CXF Servlet transport with this bus. Please add the below code just before Endpoint.publish(...) Bus bus = cxf.getBus(); BusFactory.setDefaultBus(bus); Willem. Miguel De Anda-2 wrote: i've got an application (my server) that launches its own jetty server for sending files to external nodes. they currently talk to each other using simple xml passed in as a post request and in the response. the external nodes don't run a web server of any kind. i now need to add a soap interface on my server but can't figure out how. this is how my jetty server is started: ServletHolder servlet; org.mortbay.jetty.Server jettyServer = new org.mortbay.jetty.Server(PORT); Context root = new Context(jettyServer, /, Context.SESSIONS); servlet = new ServletHolder(someServlet); root.addServlet(servlet, /*); CXFServlet cxf = new CXFServlet(); servlet = new ServletHolder(cxf); servlet.setName(soap); servlet.setForcedPath(soap); root.addServlet(servlet, /soap/*); HelloWorld hw = new HelloWorldImpl(); Endpoint.publish(/soap/HelloWorld, hw); jettyServer.start(); package a.b.c; import javax.jws.WebService; @WebService public interface HelloWorld { String sayHi(String text); } import javax.jws.WebService; @WebService(endpointInterface = a.b.c.HelloWorld) public class HelloWorldImpl implements HelloWorld { public String sayHi(String text) { return The interesting question becomes is what is soap?; } } i got errors ranging from a null pointer exception when i went to http://localhost:PORT/soap/ to /soap/HelloWorld not being a valid url (in the line Endpoint.publish). i had to set a full url there, when i used http://localhost:PORT/soap/HelloWorld; it told me that the port was being used, so i figured its launching its own internal instance of jetty (or whatever it uses). i then replaced the port to some 8087 and it almost works, but i get a faultstringNo such operation: /faultstring message when viewing http://localhost:8087/soap/HelloWorld i would really like to be able to use the same jetty server, and be able to give access to my existing objects in my application. i'm using spring to load up an object that has all of my configuration settings but not in the same way you would in a typical web app that runs on a webserver. the customer currently has access to that spring config file and it would be wrong to give them access (or force them to configure) the soap services. in other words, my app is launched this way: public static void main(...) { Resource resource = new FileSystemResource(config); BeanFactory factory = new XmlBeanFactory(resource); Config config = (Config)factory.getBean(bean); configApp(config); startServices(); } Actual error messages: (using /soap/... in publish line) Caused by: java.net.MalformedURLException: no protocol: /soap/HelloWorld 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(JettyHTTP Destination.java:87) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDesti nation(JettyHTTPTransportFactory.java:96) at org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestinat ion(JettyHTTPTransportFactory.java:83) at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTrans portFactory.java:74) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90)
Re: wsdl2java NPE for liberty-idff-wsdl-v1.1.wsdl
Hi, I tested wsdl:imort for very simple schema, but it does not work at all in any case. As I said in the previous email, it should work, I tested it yesterday, there's no problem if you have a case which failed, then it's possibly a bug, please file an issue on jira types/schema/import worked OK for simple schema and the absolute path also worked OK. But if XSD is complcated, it does not work, I upload one wsdl file wsdl2java failed to generate code. Ok, I'm testing it, if it failed, I'll file a jira, latter if you found any issues, please report it in the jira as well Also CXF wsdl2java does not work with http proxy. Again, please file a jira, and brief your descriptions Regards, James http://www.nabble.com/file/p13415060/csta-all.wsdl csta-all.wsdl
Re: Running java_first_pojo sample in a Servlet container
Hi, please remove the below fragment from your web.xml, and then restart it, it should work fine. context-param param-namecontextConfigLocation/param-name param-valueWEB-INF/services.xml/param-value /context-param listener listener-class org.springframework.web.context.ContextLoaderListener /listener-class /listener well, it seems you want to use CXF with spring, please refer to java_first_spring_support for detail. Thanks Jeff. Sinkinson,Andrew [NCR] wrote: Hi All, I am trying to run the java_first_pojo sample in Tomcat 5.5 but I am getting the following error: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pojoservice': 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: 129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) Here is my Web.xml: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-nameCXFServlet/servlet-name display-nameCXF Servlet/display-name servlet-class org.apache.cxf.transport.servlet.CXFServlet /servlet-class /servlet servlet-mapping servlet-nameCXFServlet/servlet-name url-pattern/services/*/url-pattern /servlet-mapping context-param param-namecontextConfigLocation/param-name param-valueWEB-INF/services.xml/param-value /context-param listener listener-class org.springframework.web.context.ContextLoaderListener /listener-class /listener /web-app Here is the configuration file : 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=pojoservice serviceClass=demo.hw.server.HelloWorld address=/hello_world simple:serviceBean bean class=demo.hw.server.HelloWorldImpl / /simple:serviceBean /simple:server /beans I am new to using CXF and any help would be much appreciated. Thanks
Re: wsdl2java NPE for liberty-idff-wsdl-v1.1.wsdl
Here you go https://issues.apache.org/jira/browse/CXF-1140 Regards, James Hi, I tested wsdl:imort for very simple schema, but it does not work at all in any case. types/schema/import worked OK for simple schema and the absolute path also worked OK. But if XSD is complcated, it does not work, I upload one wsdl file wsdl2java failed to generate code. Also CXF wsdl2java does not work with http proxy. http://www.nabble.com/file/p13415060/csta-all.wsdl csta-all.wsdl
Re: [FIXED] RE: CXF + Spring : Bean outside WebApp have empty properties
Hi, Instead of putting jars in the endorsed folder, could you try to put the below jboss-app.xml in your $ear/META-INF to see if it works. jboss-app.xml: ?xml version=1.0 encoding=UTF-8? jboss-app loader-repository org.apache.cxf:loader=your ear name (such as spring_http.ear) loader-repository-config java2ParentDelegation=false /loader-repository-config /loader-repository /jboss-app Detail please refer to: http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration Let me know if it works or not... Thanks Jeff bastien.legras wrote: After hours of bloody debugging /tracing through CXF code, I found the root cause of my issue : It has to do with my JBOSS 4.0.4 GA environment I forgot to mention :( For the one who care, I wrote below a detailed explanation + solution Detailed Explanation : JAXBContext is already classloaded via jboss-j2ee.jar (/server/default/lib) prior the one packaged with CXF (jaxb-api-2.0.jar). Jboss's JABXBContext works fine for CXF as long as your JAX Beans are packaged inside the web services application. But once you move your JAX Beans outside the application, things changes in the JAXBEncoderDecoder : line 388 (for CXF 2.0.2) : obj = unmarshalWithClass ? u.unmarshal((XMLStreamReader)source, clazz) : u return an object with null properties as the Unmarshaller is not the right one as its implementor comes from Jboss instead of CXF. Solution : To fix the issue I found no other solution than copying the following jars to JBOSS_HOME/lib/endorsed directory (server/default/lib is not enough) : jaxb-api-2.0.jar jaxb-impl-2.0.5.jar geronimo-activation_1.1_spec-1.0-M1.jar stax-api-1.0.1.jar Hope this will help others ! Cheers, Bastien LEGRAS