Re: cxf jms with java first
AFAIK, that is what you need to do. Setting the factory's address to be the String which start with jms:// will be OK. BTW, you do not need to include the below files in your spring.configuration import resource=classpath:META-INF/cxf/cxf-extension-local.xml / import resource=classpath:META-INF/cxf/cxf-extension-http.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / And the most important thing is that you need to let this Spring configuration file be load by CXF bus. You can name it as the cxf.xml and put it into the class path, or use the SpringBusFactory to load it. Willem. Christian Schneider wrote: I have found some clues to the necessary configuration. You need to configure a jms:conduit. And of course your JaxWsProxyFactoryBean. But what I did not yet find out is how to connect the two. What I know is that your setAddress Parameter in the factory has to start with jms://. Has anyone an idea how to go on from there? Best regards, Christian mule1 schrieb: Hello, I wanted to configure cxf jms in xml with my java first service implementation. Can you provide me the sample cxf jms configuration? JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.getInInterceptors().add(new LoggingInInterceptor()); factory.getOutInterceptors().add(new LoggingInInterceptor()); factory.setServiceClass(IHello.class); factory.setAddress(jms://{http://service.test/}IHelloService.jms-conduit;); // This dows not seem correct... what is the right address for jms? //factory.setAddress(http://localhost:9000/Hello;); IHello client = (IHello) factory.create(); String reply = client.sayHi(HI); ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:cxf=http://cxf.apache.org/core; xmlns:soap=http://cxf.apache.org/bindings/soap; xmlns:jaxws=http://cxf.apache.org/jaxws; xmlns:jms=http://cxf.apache.org/transports/jms; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schema/bindings/soap.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/transports/jms http://cxf.apache.org/schemas/configuration/jms.xsd import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-extension-local.xml / import resource=classpath:META-INF/cxf/cxf-extension-http.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / import resource=classpath:META-INF/cxf/cxf-extension-jms.xml / jms:conduit name={http://service.test/}IHelloService.jms-conduit; jms:clientConfig clientReceiveTimeout=500 messageTimeToLive=500 / jms:runtimePolicy messageType=binary / jms:sessionPool lowWaterMark=10 highWaterMark=5000 / jms:address destinationStyle=queue jndiConnectionFactoryName=MockConnectionFactory jndiDestinationName=myOwnDestination jndiReplyDestinationName=myOwnReplyDestination connectionUserName=testUser connectionPassword=testPassword jms:JMSNamingProperty name=java.naming.factory.initial value=org.apache.activemq.jndi.ActiveMQInitialContextFactory / jms:JMSNamingProperty name=java.naming.provider.url value=tcp://localhost:61616 / /jms:address /jms:conduit /beans
Re: Spring demo client
Hi, Here is a clue for your issue. Exception in thread main java.lang.NoSuchMethodError: javax.xml.soap.SOAPFactory.createFault()Ljavax/xml/soap/SOAPFault; It could be another SAAJ implementation instead of SUN's SAAJ1.3 was load in the Tomcat. Please check the Tomcat's class path for it. The below URL may help you. http://www.nabble.com/Cxf-spring-client-throws-Cannot-create-SAAJ-factory-instance-tf4055658.html#a11521672 Willem. 曾信誠_thc wrote: hi all. I got a question about spring demo in CXF document. Follow the article, I have built the environment, publish service on Tomcat setting client, etc. However, when I try to get service response, i got a problem just like the article posted on 06 Aug 2007, the title is spring demo client I`ll guess that something going wrong after service try to generate response Dont know if this problem has been solved yet, any suggestion will be appreciate, thx ! here is my error msg: - SOAP : soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Body soap:Fault faultcodesoap:Client/faultcode faultstringError reading XMLStreamReader./faultstring /soap:Fault /soap:Body /soap:Envelope -- Tomcat: 2007/10/24 銝箫? 09:18:14 org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader. at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:186) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:57) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:206) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:67) at org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletDestination.java:100) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:224) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137) at org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:261) at org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.java:239) 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.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Thread.java:595) Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661) at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069) at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:87) ... 24 more - and finally, my client on Eclipse log4j:WARN No appenders could be found for logger
Re: Newbie-question. No bean named 'cfx' is defined.
Hi Do you use the SpringBusFactory to load the Spring configuration file ? If not , you need to include the below files to start a soap over http service. 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-extension-http-jetty.xml/ Willem. thomaslarsson wrote: Hello, During startup of my application which is just a simple jax-ws service I get the message org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cxf' is defined So the obvious question was first if there was a context file within my classpath with a bean named 'cfx'? My lib directory differs a little from the samples. I build my sample with maven and used the suggested pom file (building your cfx project with maven) to define my dependencies. This means my WEB-INF/lib folder contains a whole set of cfx-libs. But all this aside, sure, there is such a bean defined in the cfx-rt-core-2.0.2-incubator jar under META-INF/cfx/cfx.xml. What am I missing here?
Re: Client can't receive the message due to read timed out
Hi , FYI, you can find the how to set the timeout parameters here [1] [1] http://cwiki.apache.org/CXF20DOC/client-http-transport.html Willem. Glen Mazza wrote: I'm not sure how to adjust the timeout parameters--someone else can perhaps respond to that issue. But how long should it take your server to respond? Can you greatly simplify your server so it responds immediately (basically just mock it out so it immediately returns something), to confirm that the 60-second timeout is the real problem (as opposed to the client simply not being able to access the server)? The error you're getting: Caused by: org.apache.cxf.interceptor.Fault: Could not send Message. normally occurs to me when the server is inaccessible for some reason, it can't be reached at all--not just a time-out issue. Are you sure the URL in the WSDL (which I assume your client is reading) is correct? If you call http://localhost:8080/mywarfilename/myservice?wsdl, for example, do you see the WSDL file in the browser? HTH, Glen Am Sonntag, den 21.10.2007, 19:15 -0600 schrieb Shen, Minsheng (MinSheng): Hi All, I am new to this mail list. I am developing a web service using CXF 2.0.2. Everything is tested and works fine on the service side. I used wsdl2java to create a client. When I invoke the client, I got Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not send Message. I believe on the client side the default time out for reading message is 60 seconds and this error is caused by read time out. The following is the stacktrace. Any help you can provide will be greatly appreciated!! Thank you in advance! -Minsheng INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not send Message. Caused by: java.net.SocketTimeoutException: Read timed out
Re: Error with temporary files
Hi, It is a known issue. You can found more information here[1] [1]http://issues.apache.org/jira/browse/CXF-986 Willem. Jean-François Daune wrote: Creating the temp file works fine. I don't know what's wrong. There is enough space on my disk, which uses NTFS. I noticed that turning logging feature off is a workaround. I can live with it. I'll wait for 2.0.3 release. J-F -Message d'origine- De : Daniel Kulp [mailto:[EMAIL PROTECTED] Envoyé : mercredi 17 octobre 2007 16:35 À : cxf-user@incubator.apache.org Cc : Jean-François Daune Objet : Re: Error with temporary files Hmm Caused by: java.io.IOException: No such file or directory at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.checkAndCreate(File.java:1345) at java.io.File.createTempFile(File.java:1434) at java.io.File.createTempFile(File.java:1471) It's having issues creating a temp file. Can you check to make sure your temp directory is available and is writable and has space? Maybe write a simple program that does just File.createTempFile(cxf, null); or similar to see if that works? I did do a bit of work in this area, so you might want to try tha latest 2.0.3 snapshots. With that, I can provide a system property to control where the temp files are created. Dan On Wednesday 17 October 2007, Jean-François Daune wrote: Hi, I got this error in some of my tests. I use version 2.0.1. The problem seems to relate more to Woodstox than CXF. Any idea? Cheers, J-F org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter. at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndi ngInterceptor.handleMessage(SoapOutInterceptor.java:244) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndi ngInterceptor.handleMessage(SoapOutInterceptor.java:226) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto rChain.java:207) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessa ge(AbstractFaultChainInitiatorObserver.java:90) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto rChain.java:224) at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(Outg oingChainInterceptor.java:73) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto rChain.java:207) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitia tionObserver.java:73) at org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletD estination.java:78) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(S ervletController.java:231) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletContr oller.java:139) at org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:271 ) at org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.java:249 ) 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.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi lterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa lve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa lve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja va:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja va:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv e.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java :151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.pr ocessConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoi nt.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFoll owerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPo ol.java:689) at java.lang.Thread.run(Thread.java:595) Caused by: com.ctc.wstx.exc.WstxIOException: No such file or directory at com.ctc.wstx.sw.BaseStreamWriter.finishDocument(BaseStreamWriter.java: 1687) at com.ctc.wstx.sw.BaseStreamWriter.writeEndDocument(BaseStreamWriter.jav a:585) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndi ngInterceptor.handleMessage(SoapOutInterceptor.java:239) ... 28 more Caused by: java.io.IOException: No such file or directory at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.checkAndCreate(File.java:1345) at java.io.File.createTempFile(File.java:1434) at java.io.File.createTempFile(File.java:1471) at
Re: meaning of endpointName in server configuration file?
Hi Glen, The endpointName can map to the wsdl:port name. I will update the wiki with it . Willem. Glen Mazza wrote: Hello, does anyone know the meaning of endpointName in the configuration sample at the top (Configuring an Endpoint) of this page[1]? In particular, what portion of the WSDL endpointName needs to map to (if that is what it refers to.) It is not defined in the glossary just below this sample. Thanks, Glen [1] http://cwiki.apache.org/CXF20DOC/jax-ws-configuration.html
Re: Stopping the jms_queue sample
Hi, Yes, I just did a quick test for it . I saw some ActiveMQ Scheduler thread there. But after I went through the CXF code , I am sure we close the jms consumer connection. I have no idea why the ActiveMQ Scheduler threads are still there after the consumer is closed. Willem. MickeD wrote: Hi When following the jms_queue sample what should I do to close the Endpoint? After calling stop() on the endpoint I still have some of JMS threads up and running so I guess I'm missing something. /Mikael Davidsson
Re: Configuring Interceptors
Hi CXF provides a flexible configuration of interceptor. You can configure the interceptor in Bus level or in Endpoint level. For you case, I think you can define the WSS4J interceptor in your Endpoint B, and add the SAAJ*Interceptor in the bus. In this way, the EndpointA will not check the security any more. jaxws:endpoint id=EndpointB ... jaxws:inInterceptors ref bean=WSS4JInConfiguration/ /jaxws:inInterceptors jaxws:outInterceptors ref bean=WSS4JOutConfiguration/ /jaxws:outInterceptors /jaxws:endpoint Willem. Mayank Mishra wrote: Hi all, I understand the way of plugging in In and Out Interceptors to CXF bus like, bean id=cxf class=org.apache.cxf.bus.CXFBusImpl property name=inInterceptors list ref bean=SAAJInInterceptor/ ref bean=WSS4JInConfiguration/ /list /property property name=outInterceptors list ref bean=SAAJOutInterceptor/ ref bean=WSS4JOutConfiguration/ /list /property /bean bean id =WSS4JIn.. bean id = WSS4JOut... ... We can specify a set of configuration inside each of WSS4J In and Out interceptors. My requirement is to specify an alternative configuration also along with this configuration. So, if service configured for configuration A and B. If the incoming message adheres to Configuration B rather than A, CXFBus can pass the message to WSSInInterceptor configured for B configuration, without WSSInInterceptor A giving Security Failure. Is it somehow feasible using CXF Spring Configuration or the way we specify Interceptors to CXFBus? With Regards, Mayank
Re: Disable access to wsdl in Servlet transport
Hi, I think you can take a look at the WSDLQueryHandler in the CXF core. You can extend it and add some security check here, then register the Handler to the QueryHandlerRegistyImpl. Willem. Egor Samarkhanov wrote: Hello ! How can I restrict access to WSDL of my service? I don't want someone to access the http//host.com/services/myservice?wsdl content. And I use Servlet transport. Thanks, Egor Samarkhanov ([EMAIL PROTECTED])
Re: Redundand Request/Response types in WSDL
Hi, If you are using the simple front end , you need to set the ServerFactoryBean's service wrapped attribute to be false. Willem. James Mao wrote: Hi, Try annotate the SEI with @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) Then the generated elements in the schema will be xsd:element name=echo nillable=true type=xsd:string/ xsd:element name=echoResponse nillable=true type=xsd:string/ James Hi ! I've created a simple service with one method String echo(String str); and CXF created request/response types in WSLD: xs:element name=echo type=tns:echo / xs:complexType name=echo xs:sequence xs:element minOccurs=0 name=arg0 type=xs:string / /xs:sequence /xs:complexType xs:element name=echoResponse type=tns:echoResponse / xs:complexType name=echoResponse xs:sequence xs:element minOccurs=0 name=return type=xs:string / /xs:sequence /xs:complexType ... wsdl:message name=echo wsdl:part element=tns:echo name=parameters / /wsdl:message wsdl:message name=echoResponse wsdl:part element=tns:echoResponse name=result / /wsdl:message ... wsdl:operation name=echo wsdl:input message=tns:echo name=echo / wsdl:output message=tns:echoResponse name=echoResponse / /wsdl:operation ... wsdl:operation name=echo soap:operation soapAction= style=document / wsdl:input name=echo soap:body use=literal / /wsdl:input wsdl:output name=echoResponse soap:body use=literal / /wsdl:output /wsdl:operation Is it possible to make CXF work without these additional echo and echoResponse objects? It would be ideal to work with just strings for input and output messages. Thanks, Egor Samarkhanov ([EMAIL PROTECTED])
Re: Creating a Provider for a WSDL-first WS without annotations?
I don't find a way to set the Provider properties from JAXWS API. If you can tell the @ServiceMode's value from the script engine, I think you can easily pick up a annotated Provider template class. Here is only 2 types service mode. BTW, if you use the JaxWsServerFactoryBean to create the server. You can write your own class which extends JaxWsImplementorInfo for some provider property programming work. Willem. Javier Arauz wrote: Hi, I'm trying to develop an engine that allows me to script WS consumerprovider implementations. I'm using CXF as my underlying WS implementation. For the consumer part I'm using Dispatch instances that delegate work to the script engine code. So far, so good. However, for the provider part I've hit a wall: I can't see a way of writing a generic (i.e. valid for any WS) Provider that delegates work to the script engine, since according to the JAX-WS documentation I need to provide annotations describing the service to the Provider class file. Since annotations can't be set in run-time I can't write my generic Provider. I've thought of writing a Provider template that is completed with annotations and compiled in runtime when a WS is invoked, but it sounds like a cumbersome solution. Does anybody know if there is a programmatic way of setting the Provider properties that these annotations set? Regards, /Javier
Re: JUnit test with local transport failing to find hibernate session
Hi Gilles, I just committed a quick fix for the issue of the CXF local transport direct dispatch model [CXF-1107]. You can try it by using the truck version or waiting few days for the next 2.0.3 snapshot. Willem. Willem Jiang wrote: Hi, I can reproduce the error, it definitely is a CXF local transport bug. I will investigate it later today. Willem. Gilles Durys wrote: Willem Jiang wrote: Hi, Which CXF version are you using? Can you access the service with http transport? I just checked the code in the trunk XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class); * xtw.setPrefix(soapVersion.getPrefix(), soapVersion.getNamespace()); I guess the NPE is came from xtw, but I have no idea why XMLStreamWriter.class is not set into the message. I gripped the code and found it should be set to the message by StaxOutInterceptor. Hi, I came back to this problem and for what I understand looking at LocalConduit.directDispatch, when using direct dispatch, no content is set on the message.
Re: Generated wsdl in XFire Versus CXF
Hi, You can use the simple front end[1] instead of jaxws front end[2]. [1]http://cwiki.apache.org/CXF20DOC/simple-frontend.html [2]http://cwiki.apache.org/CXF20DOC/jax-ws.html Willem. William Leung wrote: I am trying setup a client in vs.net. So sad, that vs.net only reconized the XFire schema format but not the CXF one. From the hello world example, the VS.net reconized the operation as: CXF = HelloWorld Description Methods sayHi ( sayHi As sayHi ) As sayHiResponse while XFire format is well XFire = HelloWorld Description Methods sayHi ( sayHi As string ) As string So can I have an option that to use the XFire format, I preferred java first only. jacobmarcus20 wrote: Hi all, I notice that in CXF, the xsd elements for method names have a type attribute. This was not the case in XFire. Here is an example of what I am talking about. My question is, is there a way to get CXF to spit out wsdl exactly as XFire? Thanks, Jacob XFire == xsd:element name=getAsset xsd:complexType xsd:sequence xsd:element maxOccurs=1 minOccurs=1 name=in0 nillable=true type=xsd:string/ /xsd:sequence /xsd:complexType /xsd:element CXF xs:element name=getAsset type=tns:getAsset/ xs:complexType name=getAsset xs:sequence xs:element minOccurs=0 name=arg0 type=xs:string/ /xs:sequence /xs:complexType
Re: WSDL not recognized by vs net
The WSDL that you got from from CXF is Document/Literal Wrapped. If you want to set it to the Document/Literal model , you need to set the JaxWsServiceFactory's wrapped attribute to be false. Willem. William Leung wrote: I am testing CXF and sadlly found that our method parameters and returns are not recognized in vs net. VS NET recongnized the sayHi function as --- sayHi ( sayHi As sayHi ) As sayHiResponse it should be --- sayHi ( arg0 As string) as string When I change the wsdl manually from xsd:element name=sayHi type=tns:sayHi/ xsd:complexType name=sayHi xsd:sequence xsd:element minOccurs=0 name=arg0 type=xsd:string/ /xsd:sequence /xsd:complexType to xsd:element xsd:complexType xsd:sequence xsd:element minOccurs=0 name=arg0 type=xsd:string/ /xsd:sequence /xsd:complexType /xsd:element It worked, but I have no idea how could I make this changes without switch to wsdl first (I dont want to, I have just too many methods to export) Any help will be very appreciated
Re: JUnit test with local transport failing to find hibernate session
Hi, I can reproduce the error, it definitely is a CXF local transport bug. I will investigate it later today. Willem. Gilles Durys wrote: Willem Jiang wrote: Hi, Which CXF version are you using? Can you access the service with http transport? I just checked the code in the trunk XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class); * xtw.setPrefix(soapVersion.getPrefix(), soapVersion.getNamespace()); I guess the NPE is came from xtw, but I have no idea why XMLStreamWriter.class is not set into the message. I gripped the code and found it should be set to the message by StaxOutInterceptor. Hi, I came back to this problem and for what I understand looking at LocalConduit.directDispatch, when using direct dispatch, no content is set on the message.
Re: cxf plain xml http configuration using simple frontend
It is same with the jaxws:endpoint. You need to create a service factory bean and set it to the simple:server. Here is an example bean id=ReflectionServiceFactoryBean class=org.apache.cxf.service.factory.ReflectionServiceFactoryBean property name=wrapped value=true/ /bean simple:server id=inlineImplementor address=http://localhost:8080/simpleWithAddress; simple:serviceBean bean class=org.apache.cxf.service.factory.HelloServiceImpl/ /simple:serviceBean simple:serviceFactory bean ref=ReflectionServiceFactoryBean /simple:serviceFactory /simple:server BTW, You need to specify different simple:serviceFactory for different simple:server. You can find more information here. http://www.nabble.com/deploy-webservices-tf4591636.html#a13107881 Willem. mule1 wrote: Willem - Thanks. I configured it using that example. With this simple frontend, how can I set 'wrapped = true?
Re: help in setting JaxWsProxyFactoryBean endpoint/url in CXF 2.0.2
You can specify the wsdl url to your local wsdl url. eg. File://C:\svnwork\reg\trunk\reg\reg-ws\ws-madcap\src\wsdl\madcap.wsdl Willem. Jarada, Hussam wrote: my problem is that the wsdl is not accessible from this web service url. Jarada From: James Mao [mailto:[EMAIL PROTECTED] Sent: Tue 10/9/2007 10:15 PM To: cxf-user@incubator.apache.org Subject: Re: help in setting JaxWsProxyFactoryBean endpoint/url in CXF 2.0.2 Jarada, Hussam wrote: Per finding info on setting client url from http://www.nabble.com/Client-question-tf4357978.html#a12419843 I changed my code as follows At which getServiceURL() return http://todev-mda09.tops.aol.com:8080/; MadcapService ss = new MadcapService(); MadcapPort port = ss.getMadcap(); BindingProvider provider = (BindingProvider)port; In this case, Client trying to get the wsdl from the MadcapService, make sure the wsdl is accessible James provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPER TY, getServiceURL()); this.servicePort = port; The problem now MadcapService ss = new MadcapService(); throws this exception. Any help in resolving this cause I am almost running out of solutions for integrating third party web service into my application using CXF 2.0.2 and wsdl2java in Windows XP running on Tomcat. java.lang.IncompatibleClassChangeError at org.apache.cxf.wsdl11.WSDLServiceBuilder.copyExtensionAttributes(WSDLSer viceBuilder.java:125) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilde r.java:229) at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilde r.java:158) at org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java: 117) at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:110) at org.apache.cxf.jaxws.ServiceImpl.init(ServiceImpl.java:101) at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl .java:55) at javax.xml.ws.Service.init(Service.java:57) at com.aol.madcap._2007._06.MadcapService.init(MadcapService.java:41) at com.aol.reg.rsp.adapter.madcap.MADCAPAdapter.getService(MADCAPAdapter.ja va:74) at com.aol.reg.rsp.adapter.madcap.ExtServiceMADCAPImpl.nameSuggestionMADCAP (ExtServiceMADCAPImpl.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.aol.reg.rsp.engine.ProxyImplementor.methodInvoke(ProxyImplementor.ja va:132) at com.aol.reg.rsp.engine.ProxyImplementor.methodInvoke(ProxyImplementor.ja va:79) at com.aol.reg.rsp.engine.ServiceManagerProxy.methodInvoke(ServiceManagerPr oxy.java:349) at com.aol.reg.rsp.engine.ServiceManagerProxy.invoke(ServiceManagerProxy.ja va:258) at $Proxy15.nameSuggestionMADCAP(Unknown Source) at com.aol.reg.rsp.web.SnsReg.doGet(SnsReg.java:207) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1 51) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:87 0) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc essConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint .java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow erWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:685) at java.lang.Thread.run(Thread.java:595) -Original Message- From: Jarada, Hussam [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 09, 2007 11:49 AM To: cxf-user@incubator.apache.org Subject: help in setting JaxWsProxyFactoryBean endpoint/url in CXF 2.0.2 Hi, I have the following code at which I am trying to set factory client endpoint to third party web service Can someone help me with a working sample on how to set
Re: Specify URL for client
Hi , There[1] are lots of ways to specify the service URL for the client. [1]http://www.nabble.com/Client-question-tf4357978.html#a12419843 Willem. Martin Caslavsky wrote: Hello, is it possible for CXF client to specify URL where client should connect to? Martin Caslavsky
Re: cxf plain xml http configuration using simple frontend
Hi, You can use the simple:server tag for it. Here are some examples for it [1] [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/frontend/spring/servers.xml Willem. mule1 wrote: Hello, I wanted to configure my services for exposing my service for plain xml over http by using the simple frontend configuration instead of jaxws. How can I do that? I saw that using jaxws, I can do this, but I want my webservices configured without annotations - so, want to do it with simple frontend. An example I saw for configuration using jaxws: jaxws:endpoint id=hello_world_xml implementor=demo.hw.server.GreeterImpl address=/xml bindingUri=http://cxf.apache.org/bindings/xformat; /jaxws:endpoint Thanks.
Re: Willem, fun with http!
Yes, I need to do some doc work on the wiki. It is on my todo list. Willem. Benson Margulies wrote: Sure, but we still need to fix the Wiki to show an example with more useful results. -Original Message- From: Willem Jiang [mailto:[EMAIL PROTECTED] Sent: Sunday, October 07, 2007 9:42 PM To: cxf-user@incubator.apache.org Subject: Re: Willem, fun with http! Hi Benson , I had committed your test case few days ago, now the resource handler should work :) Willem. Benson Margulies wrote: Willem, Adding a DefaultHandler as per the wiki has the instant result of disabling CXF on that engine. Perhaps we need a different example? I'm struggling to make a ResourceHandler work, if I get it going I could edit the wiki. --benson
Re: deploy webservices
Hi, You can't reuse the service factory for two jaxws endpoints. When the service factory create the endpoint, it will not create a new service model if the service factory's model is already there. You need create a new service factory for endpoint to use. Willem. Olvera Segura Jaime Ivan wrote: Hi i have a little problem I have to publish to webservices, i´m using aegis and 2.0.1 release, the problem is that a only see one wsdl definition, I only get the first one for both, is there something wrong in configuration?? this is my spring.xml: Thanks in advance jaxws:endpoint id=publicador implementor=#publicadorWebService address=/servicio jaxws:properties entry key=mtom-enabled value=true/ /jaxws:properties jaxws:serviceFactory ref bean='jaxws-and-aegis-service-factory' / /jaxws:serviceFactory /jaxws:endpoint jaxws:endpoint id=operabasepublicador implementor=#operaBaseWebService address=/operabase jaxws:serviceFactory ref bean='jaxws-and-aegis-service-factory' / /jaxws:serviceFactory /jaxws:endpoint .
Re: WebServiceContext is null
Hi , Currently I do not find a way to work around and I can't put much time on it now :(. You can monitor the JIRA , and you can still work on you code by removing the tx:annotaiton-driven. This is a common issue of CXF , we will resolved it soon :) Willem. Mustafa Egilmezbilek wrote: Hi, I am using tx:annotation-driven/ in my spring.xml . What's the workaround for this case ? Thanks, Karakoyun On 9/28/07, Willem Jiang [EMAIL PROTECTED] wrote: Hi , How do you set up your endpoint implementor? I know there is an issue that if your implementor is came from a Spring bean which is enhanced by Spirng AOP will not get any WebServiceContext resource injected. You can find the detail information about the JIRA here [1] [1]https://issues.apache.org/jira/browse/CXF-1074 Willem. Mustafa Egilmezbilek wrote: Hi, I am trying to access WebServiceContext to be able use HttpSession as described in: http://cwiki.apache.org/CXF20DOC/servlet-transport.html, but I keep getting null. What might be the reason ? @Resource *public* WebServiceContext wsContext; protected HttpSession getHttpSession() { MessageContext mc = *wsContext*.getMessageContext(); HttpSession session = ((javax.servlet.http.HttpServletRequest )mc.get(MessageContext.SERVLET_REQUEST)).getSession(); return session; } Thanks, Karakoyun
Re: having problem with cxf 2.0.2 using client webservice
Hi , I think I found the key of this issue. It is you bean.xml's definition. If you want to define the value of simple:[EMAIL PROTECTED] with a spring bean's reference, you need to use the prefix '#' for the bean's name, and they should be in the same application context. If you take the CXF wiki's [1] as an example , you need to put the contents in the cxf.xml into beans.xml. Here is an example for it beans.xml beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=http://www.springframework.org/schema/aop; xmlns:util=http://www.springframework.org/schema/util; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:simple=http://cxf.apache.org/simple; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; import resource=classpath:META-INF/cxf/cxf.xml/ import resource=classpath:META-INF/cxf/cxf-extension-soap.xml/ import resource=classpath:META-INF/cxf/cxf-servlet.xml/ bean id=helloService class=com.comp.HelloWorldImpl /bean simple:server id=hello address=/hello serviceClass=com.comp.HelloWorldNew serviceBean=#helloService /simple:server /beans [1]http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html Willem. mule1 wrote: Hello Wellem, I really don't have anything extra on sever side. To make testing this problem simple, I added the HelloWorld sample code in my server side code and it just seems that the client code when trying to use it when deployed on web application gives the error. The configuration on server side is as follow: 1. - I have a cxf.xml which has following: ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:aop=http://www.springframework.org/schema/aop; xmlns:util=http://www.springframework.org/schema/util; xmlns:tx=http://www.springframework.org/schema/tx; xmlns:simple=http://cxf.apache.org/simple; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd; import resource=classpath:META-INF/cxf/cxf.xml/ import resource=classpath:META-INF/cxf/cxf-extension-soap.xml/ import resource=classpath:META-INF/cxf/cxf-servlet.xml/ simple:server id=hello address=/hello serviceClass=com.comp.HelloWorldNew serviceBean=helloService /simple:server /beans 2. --- I have bean.xml, which has -- bean id=helloService class=com.comp.HelloWorldImpl /bean -CXF Sample Client changes done to call the HelloWorld service deployed in tomcat appserv I also tried updating the sample hello world spring client as follow to test this from the sample client: 1. Updates to Client.java public final class Client { private Client() { } public static void main(String args[]) throws Exception { // START SNIPPET: client ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {demo/spring/client/client-beans.xml}); HelloWorld client = (HelloWorld)context.getBean(client); // NOTE: If I use this call, I get the error for javax.xml.ws.WebServiceException: Could not find operation info for web method //String response = client.sayHi(Joe); //NOTE: If I use this call, I get the error for Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class ClientProxyFactoryBean cf = new ClientProxyFactoryBean(); cf.setAddress(http://localhost:8080/services/hello;); cf.setServiceClass(HelloWorld.class); // Optionally specify the service interface HelloWorld service = (HelloWorld) cf.create(); String test = Hello World Test in Tomcat appserv; String response = service.sayHi(test); System.out.println(Response: + response); System.exit(0); // END
Re: Logging small puzzle
Hi Beanson , Do you run the CXF programe with the last version in the trunk? DanK did some update of logging , I do not know if all the log are go to use log4j. Willem. Benson Margulies wrote: I've got a log4j config file as follows. Anyone have a guess as to why I keep seeing CXF 'INFO' level messages? # Set root logger level to ERROR and its only appender to A1. # log4j.rootLogger=ERROR, A1 # A1 is set to be a ConsoleAppender. log4j.appender.A1=org.apache.log4j.ConsoleAppender # A1 uses PatternLayout. log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Re: Local transport
Hi Benson , You can find the examples from AbstractJaxWsTest[1] for the unit test. And you can also find the spring configuration files form servers.xml[2]. [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/AbstractJaxWsTest.java [2]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/servers.xml Willem. Benson Margulies wrote: Could someone please post a recipe for combing the local transport with jaxws?
Re: WebServiceContext is null
Hi , How do you set up your endpoint implementor? I know there is an issue that if your implementor is came from a Spring bean which is enhanced by Spirng AOP will not get any WebServiceContext resource injected. You can find the detail information about the JIRA here [1] [1]https://issues.apache.org/jira/browse/CXF-1074 Willem. Mustafa Egilmezbilek wrote: Hi, I am trying to access WebServiceContext to be able use HttpSession as described in: http://cwiki.apache.org/CXF20DOC/servlet-transport.html, but I keep getting null. What might be the reason ? @Resource *public* WebServiceContext wsContext; protected HttpSession getHttpSession() { MessageContext mc = *wsContext*.getMessageContext(); HttpSession session = ((javax.servlet.http.HttpServletRequest )mc.get(MessageContext.SERVLET_REQUEST)).getSession(); return session; } Thanks, Karakoyun
Re: Omitting the interface level in CXF
Hi , You do not need to change the bean.xml file. I think your implementation has an annotation attribute of the endpointInterface. If you remove it, the methods in you implementor class will show up :) Willem. lukasK wrote: I would like to know if it's possible to omit the interface level in CXF? I would like that my endpoint straightly invoke java class (no interface). I've got class *Service with I would like use like an implementor. beans.xlm looks like: jaxws:endpoint id=*Service implementor=com.*Service address=/adress But methods in *Service are not visible in WSDL. Maybe someone now how to solve this problem,does it require a change in beans.xml or rather annotation in *Service class
Re: having problem with cxf 2.0.2 using client webservice
Hi , It looks like the error was thrown form the server side when the CXF runtime invoke the service implementor. Do you do some extra work on you server side? Can you show me the server side configuration files? Willem. mule1 wrote: Hello Dan, I tried several things to debug to see what is going on. First, I tried to test the sample spring helloworld client application as standalone client that comes with the cxf download and it works with no problem. So, I copied the HelloWorld.java and HelloWorldImpl.java in my application, did the application deploy in tomcat with the address called /hello' exposed for HelloWorld. Then, I ran the testcase using following: ClientProxyFactoryBean cf = new ClientProxyFactoryBean(); cf.setAddress(http://localhost:8083/services/hello;); cf.setServiceClass(HelloWorldNew.class); HelloWorld service = (HelloWorld) cf.create(); String test = Hello World Test in Tomcat appserv; String response = service.sayHi(test); And I see following error on the server side: Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class 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.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:107) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:77) which is resulting in a CxfFault with message org.apache.cxf.interceptor.Fault: object is not an instance of declaring class With debugging, I can see that when NativeMethodAccessorImpl.invoke0 is called, the String message I pass Hello World Test in Tomcat appserv is there. So, not really sure what makes it give IllegalArgumentException. I am attaching some of the lines I copied from debug below: --- Daemon Thread [http-8080-Processor25] (Suspended) IllegalArgumentException.init(String) line: 36 NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 585 BeanInvoker(AbstractInvoker).performInvocation(Exchange, Object, Method, Object[]) line: 107 BeanInvoker(AbstractInvoker).invoke(Exchange, Object, Method, List) line: 77 BeanInvoker(AbstractInvoker).invoke(Exchange, Object) line: 63 ServiceInvokerInterceptor$1.run() line: 56 SynchronousExecutor.execute(Runnable) line: 37 ServiceInvokerInterceptor.handleMessage(Message) line: 92 PhaseInterceptorChain.doIntercept(Message) line: 207 ChainInitiationObserver.onMessage(Message) line: 73 ServletDestination.doMessage(MessageImpl) line: 79 ServletController.invokeDestination(HttpServletRequest, HttpServletResponse, ServletDestination) line: 235 ServletController.invoke(HttpServletRequest, HttpServletResponse) line: 140 CXFServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 710 CXFServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 803 the values just before it fails with the IllegalArgumentException thisNativeMethodAccessorImpl (id=7268) method Method (id=7242) numInvocations 3 parent DelegatingMethodAccessorImpl (id=7264) arg0helloService arg1Object[1] (id=7245) [0] Hello World Test in Tomcat appserv ---The request message seen in the tcpmon is - soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:Bodyns1:sayHi xmlns:ns1=http://comp.com/;arg0 xmlns=http://comp.com/;Hello World Test in Tomcat appserv/arg0/ns1:sayHi/soap:Body/soap:Envelope and the response is: soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/;soap:Bodysoap:Faultfaultcodesoap:Server/faultcodefaultstringobject is not an instance of declaring class/faultstring/soap:Fault/soap:Body/soap:Envelope
Re: CXF and grails...
Hi It looks like org.apache.xerces.jaxp.DocumentBuilderFactoryImpl is not match with javax.xml.parsers.DocumentBuilderFactory in when WSDLManager is creating. CXF uses xercesImpl-2.8.1.jar ,you may check it against your Web container's runtime's class path. Maybe drop this jar in your war's WEB-INF\lib directory will help you out :) Willem. adupre wrote: Here's the error I get while loading Spring... anyone have any idea what I am doing wrong? Thx 2007-09-26 11:42:22.440::WARN: Failed startup of context [EMAIL PROTECTED]/pegasus,c:\projects\pegasus/web-app} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource [META-INF/cxf/cxf.xml]: Inst antiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constr uctor threw exception; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactor y at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531)N(ScriptBytecodeAdapter.java:159) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw exception; nested excep tion is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory Caused by: java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)deAdapter.java:67) at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:75)odInvoke(MetaClassHelper.java:678) at java.util.XMLUtils.load(XMLUtils.java:57)ke0(Native Method)89)oke(ReflectionMetaMethod.java:58)
Re: Creating SOAP Request from WSDL
Hi , You could try the CXF dynamic client http://cwiki.apache.org/CXF20DOC/dynamic-clients.html Or SoapUI http://www.soapui.org/ Willem. Harshit Madania wrote: Hi , I want to create SOAP Requests from the WSDL of service. What I want to do is like dynamically creating RAW SOAP Request from the WSDL and sending it to the Web Service so that the user can directly provide parameters to the service and test it. I am a bit new to apache incubator so just wanted to know is there any API provided with it which can solve my purpose , I tried using WSDLToSOAP but was not able to create a proper SOAP Request from it. Best Regards, Harshit
Re: Can't find the the request for http://localhost:7001/LSPApp/services/HelloWorld's Observer
Hi Roger, If you want to use the https transport by leveraging the Servlet transport , you do not need to specify the httpj:engine-factory in your bean.xml. httpj:engine-factory only take effect if you use the jetty as your http transport engine. After I went through your bean.xml, I can't found any endpoint specification there. You did not publish any endpoint yet, so you got the error of Can't find the the request for http://localhost:7001/LSPApp/services/HelloWorld's Observer Please refer this [1] to publish a service without ssl transport first. Willem. [EMAIL PROTECTED] wrote: all: i want to publish CXF(2.01) webservice with WSS(user token) over SSL to weblogic 9.2. i got this error when a client to call the service. and i donot think weblogic has publish service succesfull,but there is not error happen according to the console: 2007-9-21 9:34:54 org.apache.cxf.transport.servlet.ServletController invoke 警告: Can't find the the request for http://localhost:7001/LSPApp/services/HelloWorld's Observer -cxfServer.xml-- ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:sec=http://cxf.apache.org/configuration/security; xmlns:http=http://cxf.apache.org/transports/http/configuration; xmlns:httpj=http://cxf.apache.org/transports/http-jetty/configuration; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation= http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd; import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / http:destination name={http://interfaces.service.scan.dragonfx.dell.com/}HelloWorldService.HelloWorldImplPort; /http:destination httpj:engine-factory bus=cxf httpj:engine port=7002 httpj:tlsServerParameters sec:keyManagers keyPassword=password sec:keyStore type=JKS password=password file=c:\bea\server\mykeystore/ /sec:keyManagers sec:trustManagers sec:keyStore type=JKS password=password file=c:\bea\server\cacerts/ /sec:trustManagers sec:cipherSuitesFilter sec:include.*_EXPORT_.*/sec:include sec:include.*_EXPORT1024_.*/sec:include sec:include.*_WITH_DES_.*/sec:include sec:include.*_WITH_NULL_.*/sec:include sec:exclude.*_DH_anon_.*/sec:exclude /sec:cipherSuitesFilter sec:clientAuthentication want=true required=true/ /httpj:tlsServerParameters /httpj:engine /httpj:engine-factory !-- We need a bean named cxf -- /beans -sslclient.xml-- ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:sec=http://cxf.apache.org/configuration/security; xmlns:http=http://cxf.apache.org/transports/http/configuration; xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xsi:schemaLocation= http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd; http:conduit name={http://interfaces.service.scan.dragonfx.dell.com/}HelloWorldImplService.HttpConduit; http:tlsClientParameters sec:trustManagers sec:keyStore type=JKS password=password file=c:\bea\server\mykeystore/ /sec:trustManagers sec:keyManagers keyPassword=password sec:keyStore type=JKS password=password file=c:\bea\server\cacerts/ /sec:keyManagers sec:cipherSuitesFilter sec:include.*_EXPORT_.*/sec:include sec:include.*_EXPORT1024_.*/sec:include sec:include.*_WITH_DES_.*/sec:include sec:include.*_WITH_NULL_.*/sec:include sec:exclude.*_DH_anon_.*/sec:exclude /sec:cipherSuitesFilter /http:tlsClientParameters /http:conduit bean id=cxf class=org.apache.cxf.bus.CXFBusImpl /bean /beans thanks for any help
Re: Can't find the the request for http://localhost:7001/LSPApp/services/HelloWorld's Observer
Sorry, I forget to attach the url. It is http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html Willem. Willem Jiang wrote: Hi Roger, If you want to use the https transport by leveraging the Servlet transport , you do not need to specify the httpj:engine-factory in your bean.xml. httpj:engine-factory only take effect if you use the jetty as your http transport engine. After I went through your bean.xml, I can't found any endpoint specification there. You did not publish any endpoint yet, so you got the error of Can't find the the request for http://localhost:7001/LSPApp/services/HelloWorld's Observer Please refer this [1] to publish a service without ssl transport first. Willem. [EMAIL PROTECTED] wrote: all: i want to publish CXF(2.01) webservice with WSS(user token) over SSL to weblogic 9.2. i got this error when a client to call the service. and i donot think weblogic has publish service succesfull,but there is not error happen according to the console: 2007-9-21 9:34:54 org.apache.cxf.transport.servlet.ServletController invoke 警告: Can't find the the request for http://localhost:7001/LSPApp/services/HelloWorld's Observer -cxfServer.xml-- ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:sec=http://cxf.apache.org/configuration/security; xmlns:http=http://cxf.apache.org/transports/http/configuration; xmlns:httpj=http://cxf.apache.org/transports/http-jetty/configuration; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation= http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd; import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / http:destination name={http://interfaces.service.scan.dragonfx.dell.com/}HelloWorldService.HelloWorldImplPort; /http:destination httpj:engine-factory bus=cxf httpj:engine port=7002 httpj:tlsServerParameters sec:keyManagers keyPassword=password sec:keyStore type=JKS password=password file=c:\bea\server\mykeystore/ /sec:keyManagers sec:trustManagers sec:keyStore type=JKS password=password file=c:\bea\server\cacerts/ /sec:trustManagers sec:cipherSuitesFilter sec:include.*_EXPORT_.*/sec:include sec:include.*_EXPORT1024_.*/sec:include sec:include.*_WITH_DES_.*/sec:include sec:include.*_WITH_NULL_.*/sec:include sec:exclude.*_DH_anon_.*/sec:exclude /sec:cipherSuitesFilter sec:clientAuthentication want=true required=true/ /httpj:tlsServerParameters /httpj:engine /httpj:engine-factory !-- We need a bean named cxf -- /beans -sslclient.xml-- ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:sec=http://cxf.apache.org/configuration/security; xmlns:http=http://cxf.apache.org/transports/http/configuration; xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xsi:schemaLocation= http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd; http:conduit name={http://interfaces.service.scan.dragonfx.dell.com/}HelloWorldImplService.HttpConduit; http:tlsClientParameters sec:trustManagers sec:keyStore type=JKS password=password file=c:\bea\server\mykeystore/ /sec:trustManagers sec:keyManagers keyPassword=password sec:keyStore type=JKS password=password file=c:\bea\server\cacerts/ /sec:keyManagers sec:cipherSuitesFilter sec:include.*_EXPORT_.*/sec:include sec:include.*_EXPORT1024_.*/sec:include sec:include.*_WITH_DES_.*/sec:include sec:include.*_WITH_NULL_.*/sec:include sec:exclude.*_DH_anon_.*/sec:exclude
Re: Can't find the the request for http://localhost:7001/LSPApp/services/HelloWorld's Observer
/ /sec:trustManagers sec:keyManagers keyPassword=password sec:keyStore type=JKS password=password file=c:\bea\server\cacerts/ /sec:keyManagers sec:cipherSuitesFilter sec:include.*_EXPORT_.*/sec:include sec:include.*_EXPORT1024_.*/sec:include sec:include.*_WITH_DES_.*/sec:include sec:include.*_WITH_NULL_.*/sec:include sec:exclude.*_DH_anon_.*/sec:exclude /sec:cipherSuitesFilter /http:tlsClientParameters /http:conduit bean id=cxf class=org.apache.cxf.bus.CXFBusImpl /bean /beans -client-bean.xml-- ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xmlns:sec=http://cxf.apache.org/configuration/security; xmlns:http=http://cxf.apache.org/transports/http/configuration; xmlns:httpj=http://cxf.apache.org/transports/http-jetty/configuration; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd; import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / !-- import resource=classpath:sslClient.xml / -- bean id=client class=com.dell.dragonfx.scan.service.interfaces.HelloWorld factory-bean=clientFactory factory-method=create / bean id=clientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=com.dell.dragonfx.scan.service.interfaces.HelloWorld / property name=address value=https://localhost:7002/LSPApp/services/HelloWorld; / property name=outInterceptors list bean class=org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor / bean class=org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor constructor-arg map entry key=action value=UsernameToken / entry key=user value=joe / entry key=passwordType value=PasswordText / entry key=passwordCallbackClass value=com.demo.wss4j.interceptors.ClientPasswordCallback / /map /constructor-arg /bean /list /property /bean !-- http:conduit name={http://backendService.scan.dragonfx.dell.com/}HelloWorldImplPort.http-conduit; http:tlsClientParameters sec:trustManagers sec:keyStore type=JKS password=password file=c:\bea\server\mykeystore / /sec:trustManagers sec:keyManagers keyPassword=password sec:keyStore type=JKS password=password file=c:\bea\server\cacerts / /sec:keyManagers sec:cipherSuitesFilter sec:include.*_EXPORT_.*/sec:include sec:include.*_EXPORT1024_.*/sec:include sec:include.*_WITH_DES_.*/sec:include sec:include.*_WITH_NULL_.*/sec:include sec:exclude.*_DH_anon_.*/sec:exclude /sec:cipherSuitesFilter /http:tlsClientParameters /http:conduit -- /beans thanks Roger -Original Message- From: Willem Jiang [mailto:[EMAIL PROTECTED] Sent: 2007年9月21日 17:18 To: cxf-user@incubator.apache.org Subject: Re: Can't find the the request for http
Re: JUnit test with local transport failing to find hibernate session
Hi, Which CXF version are you using? Can you access the service with http transport? I just checked the code in the trunk XMLStreamWriter xtw = message.getContent(XMLStreamWriter.class); * xtw.setPrefix(soapVersion.getPrefix(), soapVersion.getNamespace()); I guess the NPE is came from xtw, but I have no idea why XMLStreamWriter.class is not set into the message. I gripped the code and found it should be set to the message by StaxOutInterceptor. Maybe I need your test case to dig out the real problem. Willem. Gilles Durys wrote: Jiang, Ning (Willem) wrote: Hi Gilles, Do you need to use the Client to invoke the service in your unit test? If so , you need to use the below code to trigger the LocalConduit direct dispatch. Thank you. It works But now I have to find why I get a NullPointerException in SoapOutInterceptor java.lang.NullPointerException at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart(SoapOutInterceptor.java:94) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:76) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleMessage(SoapOutInterceptor.java:57) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135) at $Proxy53.getAuthenticationChallenge(Unknown Source) at org.taktik.nadi.ws.NadiWebServicesTest.testAuthenticate(NadiWebServicesTest.java:145) 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 junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.access$001(AbstractAnnotationAwareTransactionalTests.java:47) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests$1.run(AbstractAnnotationAwareTransactionalTests.java:113) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runTest(AbstractAnnotationAwareTransactionalTests.java:176) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runTestTimed(AbstractAnnotationAwareTransactionalTests.java:150) at org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.runBare(AbstractAnnotationAwareTransactionalTests.java:109) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Re: AW: AW: CXFServlet and the EndPoint API?
Hi , You can have a look at the CXFServlet code[1] to see how it setup the default transport to servlet transport :) I remember there is a way to get the servlet's reference from other servlet , may be you need use google to find them. [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java Willem. Andreas Bucksteeg wrote: Hi Willem, I know that I have to set the CXFServelt Bus, but I do not see a way to get a reference of the CXFServlet in my test JSP. I find some mails where the setting of the CXFServlet bus was described, but I did not find any info, on how the obtain this reference. Is there maybe a way to set the default transport factory to CXFServletTransportFactory ? Andreas -Ursprüngliche Nachricht- Von: Willem Jiang [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 21. September 2007 05:20 An: cxf-user@incubator.apache.org Betreff: Re: AW: CXFServlet and the EndPoint API? Hi Andreas, From your stack trace , I think you did not use the right bus when you publish the endpoint. Because it uses the JettyHttpTransportFactory , not the CXFServletTransportFactory Can you get the CXFServlet's reference cxfServlet? If so , you can take a look at this blew codes, which just uses the cxfServlet already loaded bus. BusFactory.setThreadDefaultBus(cxfServlet.getBus()); Endpoint.publish(/Greeter, new GreeterImpl()); BusFactory.setThreadDefaultBus(null); Willem. Andreas Bucksteeg wrote: Hi, I have the same problem and I understand what the code should do, but I dont see, how I should get access to the CXFServlet from my code. I am trying to setup my service using the CXFServlet running in an Tomcat using the Endpoint API. http://cwiki.apache.org/CXF20DOC/servlet-transport.html describes to configure the servlet in the web.xml of the webapp and then just to use Endpoint.publish(/Greeter, new GreeterImpl()); I am not sure, where to put this code. For tests I used a jsp in the webapp I configured the CXFServlet and using the above line results in: java.net.MalformedURLException: no protocol: /HelloWorldService java.net.URL.init(URL.java:567) java.net.URL.init(URL.java:464) java.net.URL.init(URL.java:413) org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyH TT PDestination.java:86) org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDe st ination(JettyHTTPTransportFactory.java:96) org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDesti na tion(JettyHTTPTransportFactory.java:83) org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTr an sportFactory.java:74) How should I get the CXFServlet to set its bus as the default bus? I search the docs and the mailing list, some people had the same problem to get CXFServlet running without xml configuration in Tomcar, but I havent found a solution yet... Any ideas? Cheers, Andreas
Re: question for using CXF2
Hi, I think you can go to cxf_zh to ask for the CXF Chinese support. BTW CXF uses JAXB as the default data binding, you can build a Map with the following steps[2] [1]http://groups.google.com/group/cxf-zh [2]http://weblogs.java.net/blog/kohsuke/archive/2005/04/xmladapter_in_j.html Willem. skliu wrote: dir sir: I meet a question when i use cxf2.0 to develope web service . the question is: cxf2.0 can't return a customerize data type. the field value of this java customerize data type is null.but it is correnct when use xfire1.x . the attachment is the source. an other question is than how to treat the web service's method return type than is java.lang.Map in cxf2.0 and when can i get enough information beside http://incubator.apache.org/cxf/ ? thinks for your help! your best user!
Re: AW: CXFServlet and the EndPoint API?
Hi Andreas, From your stack trace , I think you did not use the right bus when you publish the endpoint. Because it uses the JettyHttpTransportFactory , not the CXFServletTransportFactory Can you get the CXFServlet's reference cxfServlet? If so , you can take a look at this blew codes, which just uses the cxfServlet already loaded bus. BusFactory.setThreadDefaultBus(cxfServlet.getBus()); Endpoint.publish(/Greeter, new GreeterImpl()); BusFactory.setThreadDefaultBus(null); Willem. Andreas Bucksteeg wrote: Hi, I have the same problem and I understand what the code should do, but I dont see, how I should get access to the CXFServlet from my code. I am trying to setup my service using the CXFServlet running in an Tomcat using the Endpoint API. http://cwiki.apache.org/CXF20DOC/servlet-transport.html describes to configure the servlet in the web.xml of the webapp and then just to use Endpoint.publish(/Greeter, new GreeterImpl()); I am not sure, where to put this code. For tests I used a jsp in the webapp I configured the CXFServlet and using the above line results in: java.net.MalformedURLException: no protocol: /HelloWorldService java.net.URL.init(URL.java:567) java.net.URL.init(URL.java:464) java.net.URL.init(URL.java:413) org.apache.cxf.transport.http_jetty.JettyHTTPDestination.init(JettyHTT PDestination.java:86) org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDest ination(JettyHTTPTransportFactory.java:96) org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestina tion(JettyHTTPTransportFactory.java:83) org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTran sportFactory.java:74) How should I get the CXFServlet to set its bus as the default bus? I search the docs and the mailing list, some people had the same problem to get CXFServlet running without xml configuration in Tomcar, but I havent found a solution yet... Any ideas? Cheers, Andreas
Re: CXF without Spring?
Hi, I think you need to look up your class path if there any spring related class. Here is part of CXFServlet init code: String springCls = org.springframework.context.ApplicationContext; try { ClassLoaderUtils.loadClass(springCls, getClass()); loadSpringBus(servletConfig); } catch (ClassNotFoundException e) { loadBusNoConfig(servletConfig); } If you want to create bus from CXFBusfactory , you need to remove the spring related jars first. Willem. bobbydole wrote: Thanks, I'm using Tomcat 6 in windows. So I added -Dorg.apache.cxf.bus.factory=org.apache.cxf.bus.CXFBusFactory under the Java tab. Then I checked the System.properties and I saw that it property had been set: org.apache.cxf.bus.factory org.apache.cxf.bus.CXFBusFactory However I still get the message: Sep 20, 2007 2:52:45 PM org.apache.cxf.transport.servlet.CXFServlet loadSpringBus in my catalina log. And I still get the following exception: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:84) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:159) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) when the servlet starts up. Thanks again for the help. I feel like you guys have gone out of your way to help me on this... Do you have any other suggestions? Willem2 wrote: Hi It looks like the servlet transport factory did not set up the transport id for you to use. If you just want CXF Servlet to use the CXFBusFactory , you can add this option -Dorg.apache.cxf.bus.factory=org.apache.cxf.bus.CXFBusFactory to your WebContainer's start up script. Willem. bobbydole wrote: Hello, I downloaded the latest snapshot, apache-cxf-2.1-incubator-20070918.014642-3, I'm still getting the same error: java.lang.NullPointerException at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:172) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:110) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:107) at com.bob.dole.super.servlet.AppInit.init(AppInit.java:105) So I sort of switched gears and tried to get it up and running without using the simple-frontend. So I added the CXFServlet to my web.xml, and removed the ServerFactory code, and replaced it with the EndpointPublish code. Here's the bit of my code: org.apache.cxf.bus.CXFBusFactory busFactory = new org.apache.cxf.bus.CXFBusFactory(); BusFactory.setDefaultBus(busFactory.createBus()); BusFactory.setThreadDefaultBus(busFactory.createBus()); Endpoint.publish(/test/Hello, new TestService()); However this brings me back to my original error: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:152) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) Since it's creating the Bus in the CXFServlet it makes sense that my setDefaultBus in the code doesn't affect it at all. How can I set the CXFServlet to use the CXF Bus instead of the SpringBus? Dan had mentioned setting setting the system property to org.apache.cxf.bus.CXFBusFactory. But I am unsure how to do that. Once again thanks for all your help! Willem2 wrote: Hi, I just check the stack trace , current CXF trunk add a null pointer checker at that point , can you try the latest SNAPSHOT? If you want to use the ServletTransport with the simple front end API, you still need to add the CXFServlet into you web.xml. The cxf-servlet.xml just contains the Endpoint Information, if you had some place to put the code which calls the ServerFactoryBean, you can drop the cxf-servlet.xml. Willem. bobbydole wrote: Thank you so much! I ended up doing this: org.apache.cxf.bus.CXFBusFactory busFactory = new org.apache.cxf.bus.CXFBusFactory(); BusFactory.setDefaultBus(busFactory.createBus()); BusFactory.setThreadDefaultBus(busFactory.createBus()); ServerFactoryBean svrFactory = new ServerFactoryBean(); However now I'm running into another problem. It seems to want to use the Jetty jars (for a JettyHTTPTransportFactory), which I'm pretty sure I don't
Re: Using Client in WebApplication (JBoss)
How about try to put the saaj*.jar to the jboss lib's endorsed directory? Willem. Axel Becker wrote: Hello, i wrote a small webapplikation to display some small webservice results. but on the first call i got these error javax.xml.ws.WebServiceException: Cannot create SAAJ factory instance. org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl.getSOAPFactory(SOAPBindingImpl.java:118) org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:151) $Proxy142.test(Unknown Source) de.beckercoding.prod.aec.web.MenuForm.execute(MenuForm.java:16) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404) i'm using jboss JBoss_4_2_1_GA. i tried to delete the jboss-saaj.jar from the default/lib folder and put the saaj*.jar into it, but it doenst work... any ideas? axel
Re: Sharing session with multiple services
Hi, I don't think it can be done by adding the interceptor now , because CXF HttpConduit [1] just holds the cookies as it's member variable. And for each Client proxy, CXF will set up a different HttpConduit for the http connection. If you want to accomplish the task, you need do some extract work on HttpConduit. I will see if you can set the http header some place and let the HttpConduit consumer it later today. [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Willem. John McLaughlin wrote: Hi, I've just started to look at CXF, and have successfully managed to quickly develop/deploy. The scenario I have is that I will have multiple web services running in Tomcat, and I want to maintain a session across them. I'm defining the services using JAX-WS (newbie here too!) I can set BindingProvider.SESSION_MAINTAIN_PROPERTY on the client side to true, and this works fine on an individual proxy with JSESSIONID sent received, and I can access the appropriate session on the server side. However, when I call a second service it results in another session being started. I've been trawling through APIs and the mail archives all afternoon, but haven't come up with any answers. Is it possible to retrieve the JSESSIONID from the first service and stuff it into the second service? I'm guessing an Interceptor on the client would be the way to go, but I haven't been able to find any examples. Failing all that, would it be a valid approach to add an Interceptor which would add/extract a header on messages? I'd prefer to go with the JSESSIONID as I can let Tomcat take care of the session management, so if anybody can point me in the right direction, I'd much appreciate it! Thanks, John
Re: JUnit test with local transport failing to find hibernate session
Hi I just went through the code and Xfire JIRA, it may relate to the different send and receive thread on the client side. You just need to add this pair (org.apache.cxf.transport.local.LocalConduit.directDispatch, true) in your request context, to let the LocalConduit not fork a new thread to receive the message. Here is a code snippet to show you how to set the request message context. HelloWorldPortType greeter = service.getPort(portName, HelloWorldPortType.class); InvocationHandler handler = Proxy.getInvocationHandler(greeter); BindingProvider bp = null; if (handler instanceof BindingProvider) { bp = (BindingProvider)handler; MapString, Object requestContext = bp.getRequestContext(); requestContext.put(LocalConduit.DIRECT_DISPATCH, true); } Willem. Gilles Durys wrote: Jiang, Ning (Willem) wrote: Hi , I don't know if it relates to the http header staff(it is the major different between the http transport and local transport. I did not write any code about DAO, so may be I am wrong. Could you send me the stake trace or the work space. May be I can debug it to find out the real reason. Here's the stack trace org.apache.cxf.interceptor.Fault: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:86) at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:82) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:62) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56) at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:73) at org.apache.cxf.transport.local.LocalConduit$1.run(LocalConduit.java:131) at java.lang.Thread.run(Thread.java:595) Caused by: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here at org.springframework.orm.hibernate3.AbstractSessionFactoryBean$TransactionAwareInvocationHandler.invoke(AbstractSessionFactoryBean.java:299) at $Proxy0.getCurrentSession(Unknown Source) at org.taktik.nadi.dao.impl.ContextDAOImpl.getContext(ContextDAOImpl.java:38) at org.taktik.nadi.logic.impl.ContextLogicImpl.getContext(ContextLogicImpl.java:92) 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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy4.getContext(Unknown Source) at org.taktik.ws.impl.NadiWebServicesImpl.authenticate(NadiWebServicesImpl.java:217) 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.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:99) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:73) ... 9 more Could this http://jira.codehaus.org/browse/XFIRE-605 be somewhat related? Thanks.
Re: CXF without Spring?
Hi It looks like the servlet transport factory did not set up the transport id for you to use. If you just want CXF Servlet to use the CXFBusFactory , you can add this option -Dorg.apache.cxf.bus.factory=org.apache.cxf.bus.CXFBusFactory to your WebContainer's start up script. Willem. bobbydole wrote: Hello, I downloaded the latest snapshot, apache-cxf-2.1-incubator-20070918.014642-3, I'm still getting the same error: java.lang.NullPointerException at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:172) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:110) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:107) at com.bob.dole.super.servlet.AppInit.init(AppInit.java:105) So I sort of switched gears and tried to get it up and running without using the simple-frontend. So I added the CXFServlet to my web.xml, and removed the ServerFactory code, and replaced it with the EndpointPublish code. Here's the bit of my code: org.apache.cxf.bus.CXFBusFactory busFactory = new org.apache.cxf.bus.CXFBusFactory(); BusFactory.setDefaultBus(busFactory.createBus()); BusFactory.setThreadDefaultBus(busFactory.createBus()); Endpoint.publish(/test/Hello, new TestService()); However this brings me back to my original error: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:52) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:152) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) Since it's creating the Bus in the CXFServlet it makes sense that my setDefaultBus in the code doesn't affect it at all. How can I set the CXFServlet to use the CXF Bus instead of the SpringBus? Dan had mentioned setting setting the system property to org.apache.cxf.bus.CXFBusFactory. But I am unsure how to do that. Once again thanks for all your help! Willem2 wrote: Hi, I just check the stack trace , current CXF trunk add a null pointer checker at that point , can you try the latest SNAPSHOT? If you want to use the ServletTransport with the simple front end API, you still need to add the CXFServlet into you web.xml. The cxf-servlet.xml just contains the Endpoint Information, if you had some place to put the code which calls the ServerFactoryBean, you can drop the cxf-servlet.xml. Willem. bobbydole wrote: Thank you so much! I ended up doing this: org.apache.cxf.bus.CXFBusFactory busFactory = new org.apache.cxf.bus.CXFBusFactory(); BusFactory.setDefaultBus(busFactory.createBus()); BusFactory.setThreadDefaultBus(busFactory.createBus()); ServerFactoryBean svrFactory = new ServerFactoryBean(); However now I'm running into another problem. It seems to want to use the Jetty jars (for a JettyHTTPTransportFactory), which I'm pretty sure I don't want to use since I'm using Tomcat. So I set destinationFactory as follows: svrFactory.setDestinationFactory(new ServletTransportFactory()); svrFactory.setServiceClass(Test.class); svrFactory.setAddress(http://localhost/Test/Hello;); svrFactory.setServiceBean(test); svrFactory.create(); However now I get NullPointerException java.lang.NullPointerException at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:166) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:104) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:108) Maybe it would help if I described what I want to get done. Currently I have 2 servlets running in tomcat that I need to turn into services. I'm sort of lost and confused on what my next time would be. If I want to use the simple frontend method do I need to add the CXFServlet to my web.xml? I dropped the cxf-servlet.xml in my web-inf directory, how ever it doesn't seem to do anything. Do I have to add it to a another file to get it to load? Thanks for all the help, I feel like I'm so close! dkulp wrote: You probably could call: org.apache.cxf.bus.CXFBusFactory.createBus(); first to cause it to create an Extension based bus. You may need to call BusFactory.setDefaultBus(...) and BusFactory.setThreadDefaultBus(...) with the return of the createBus() to force the bus to be there and avoid trying to create a spring one. You could also set the system property: org.apache.cxf.bus.factory to: org.apache.cxf.bus.CXFBusFactory That should work as well. Dan On Monday 17 September 2007, bobbydole wrote:
Re: CXF without Spring?
Hi, I just check the stack trace , current CXF trunk add a null pointer checker at that point , can you try the latest SNAPSHOT? If you want to use the ServletTransport with the simple front end API, you still need to add the CXFServlet into you web.xml. The cxf-servlet.xml just contains the Endpoint Information, if you had some place to put the code which calls the ServerFactoryBean, you can drop the cxf-servlet.xml. Willem. bobbydole wrote: Thank you so much! I ended up doing this: org.apache.cxf.bus.CXFBusFactory busFactory = new org.apache.cxf.bus.CXFBusFactory(); BusFactory.setDefaultBus(busFactory.createBus()); BusFactory.setThreadDefaultBus(busFactory.createBus()); ServerFactoryBean svrFactory = new ServerFactoryBean(); However now I'm running into another problem. It seems to want to use the Jetty jars (for a JettyHTTPTransportFactory), which I'm pretty sure I don't want to use since I'm using Tomcat. So I set destinationFactory as follows: svrFactory.setDestinationFactory(new ServletTransportFactory()); svrFactory.setServiceClass(Test.class); svrFactory.setAddress(http://localhost/Test/Hello;); svrFactory.setServiceBean(test); svrFactory.create(); However now I get NullPointerException java.lang.NullPointerException at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo(AbstractEndpointFactory.java:166) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:104) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:108) Maybe it would help if I described what I want to get done. Currently I have 2 servlets running in tomcat that I need to turn into services. I'm sort of lost and confused on what my next time would be. If I want to use the simple frontend method do I need to add the CXFServlet to my web.xml? I dropped the cxf-servlet.xml in my web-inf directory, how ever it doesn't seem to do anything. Do I have to add it to a another file to get it to load? Thanks for all the help, I feel like I'm so close! dkulp wrote: You probably could call: org.apache.cxf.bus.CXFBusFactory.createBus(); first to cause it to create an Extension based bus. You may need to call BusFactory.setDefaultBus(...) and BusFactory.setThreadDefaultBus(...) with the return of the createBus() to force the bus to be there and avoid trying to create a spring one. You could also set the system property: org.apache.cxf.bus.factory to: org.apache.cxf.bus.CXFBusFactory That should work as well. Dan On Monday 17 September 2007, bobbydole wrote: Thanks for the reply! Is there any way to over ride this behavior? We are using Spring, but I've been told not to stay away from the spring JARs in CXF. I think that we're using an older version of spring, and we don't want to mess with upgrading at this time.. I don't know how to include the newer spring files without messing with the old ones. Any suggestions? This has been driving me mad all day.. :( Dan Diephouse-2 wrote: Hiya, I believe that the BusFactory will not create a new Bus unless it detects spring on your classpath. The fact that you're getting a NoClassDefFoundError supports this - otherwise you would have a ClassNotFoundException. So I would double check your classpath. Cheers, - Dan bobbydole wrote: Hello, I'm trying to get a simple web service setup using CXF. Basically I'm following the simple frontend example. However when I run it it I get this exception: java.lang.NoClassDefFoundError: org/springframework/beans/factory/xml/NamespaceHandlerResolver at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFacto ry.java:83) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFacto ry.java:65) at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFacto ry.java:52) at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69) at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:58) at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:98) at org.apache.cxf.frontend.AbstractEndpointFactory.getBus(AbstractEndp ointFactory.java:274) at org.apache.cxf.frontend.AbstractEndpointFactory.initializeServiceFa ctory(AbstractEndpointFactory.java:150) at org.apache.cxf.frontend.ServerFactoryBean.initializeServiceFactory( ServerFactoryBean.java:144) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(Abst ractEndpointFactory.java:80) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean. java:108) Which looks to me like it requires the Spring of some sort, or at least it appears to want to use Spring. All I want to do is get a simple frontend service running without spring (as I can't use it) Any one got any ideas? Thanks! -- Dan Diephouse MuleSource http://mulesource.com | http://netzooid.com/blog -- J. Daniel Kulp Principal Engineer IONA
Re: CXF+ACEGI
Hi Matt I did not see any url in your mail below :(. Could you send them again ? Willem. mattmadhavan wrote: Hello All, Please refer to this blog. Seems to be one of the most popular blog. Please look at the client code! (Test case). Any ideas? If some one has a complete ACEGI security solution and posts it it will be Awesome! Ray do you mind posting a complete sample. It will be greatly beneficial to everybody. Matt dkulp wrote: Ray, On Monday 17 September 2007, Ray Krueger wrote: The authorization and authentication concerns are addressed at the protocol layer first, and can then be extended into lower levels of the application via AOP and such. So, if you're interested in securing your application at that level, then CXF doesn't even really enter into the discussion. Meaning that you're going to put the Acegi filter out there, and configure it to protect whatever URLs your CXF services are published on. Acegi wouldn't know anything about CXF in that case. This currently works fine if you use the CXFServlet approach and deploy your application as a war into some sort of Servlet container. However, if you do a J2SE standalone mode application, this is quite hard to do right now and is something we should make a bit easier. Currently, you would need to grab the raw Jetty listeners, use the Jetty API's to add the filters, etc (Note: this also applies if you want to secure your decoupled destination for a ws-rm/ws-a interaction) We probably should allow filters to be added via the spring configuration for the destination. That would simplify things quite a bit. From there you can decide in your endpoints how you consider the 'Principal'. You could retrieve it from Acegi without it being part of WS-Security and keep it loose that way. Or you could find some means of integrating Acegi into a WS-Security provider for CXF somehow. This was the interceptor I mentioned before. An interceptor after the WS-Sec interceptors would have access to the stuff decoded from the message. The interceptor could create the principal object and pass that into Acegi. Dan The application I am building will support both plain xml over http and soap over http. So in that case it makes sense for me to place security at the http layer, and avoid relying on something like WS-Security. On 9/17/07, Daniel Kulp [EMAIL PROTECTED] wrote: Interesting you should ask this.I first heard about ACEGI last week in a different conversation and have just started to look into it a bit. I'd LOVE to have your input into this as to what you think is needed or what you would consider good integration. Here are my thoughts so far: (keep in mind, I had never heard of ACEGI till last week so I could be completely off base) 1) If you deploy your app as a war using the spring webapp stuff and setting up to use aop for your service, it should just work. The acegi filter should grab the basic-auth stuff, setup the security context stuff it needs, and when we call invoke on the service, the acegi stuff should grant/deny it. 2) Longer term, we could write an interceptor that grabs the AuthorizationPolicy object and HTTPS/WS-Sec stuff from our message and fills in the acegi contexts with the details.That really wouldn't be a huge amount of work to do. Dan On Thursday 13 September 2007, mattmadhavan wrote: Hello, Can some one point me to some docs on the CXF and ACEGI integration or CXF and security like authentication and authorization. Some sample app will even be great. I found some blogs on the CXF+ACEGI, but it is Java centric. On the client side we need to set the which class handles the security on the Server side! But if I am using some other language for clients like C# it does n't seem to be the proper way! Any ideas will be greatly appreciated. Thanks Matt -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: HashMap as parameter for web service call
FYI , this blog shows you how to use HashMap in the JAXB. http://weblogs.java.net/blog/kohsuke/archive/2005/04/xmladapter_in_j.html Willem. James Mao wrote: Jaxb is quite plugable, you can use XmlTypeAdapter to marshal/unarshal to/from HashMap James HashMap is not supported by JAXB binding. More discussions about this can be found from http://www.nabble.com/DataBinding-problems-%28Timestamp-and-HashMap%29-using-JAXB-tf4283645.html#a12193877 Cheers, Jervis -Original Message- From: Kaleb Walton [mailto:[EMAIL PROTECTED] Sent: 2007?9?19? 5:59 To: cxf-user@incubator.apache.org Subject: HashMap as parameter for web service call I cannot seem to get a HashMap to work as a parameter when making a web service call via PHP. Has anyone else experienced this? I want to encapsulate my parameters in a more complex object that extends HashMap. Regards, Kaleb IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: CXF exception
Hi Ramanand, It is [1], and you can find more information about CXF from its official wiki [2] [1]http://issues.apache.org/jira/browse/CXF [2]http://cwiki.apache.org/CXF/ Willem. Singh, Ramanand wrote: Glen, What is the URL for creating JIRA? All, Does anybody know why I am getting the following exception? Exception in thread main java.lang.NoClassDefFoundError: com.sun.org.apache.xerces.internal.dom.ElementNSImpl at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:228) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148) at java.net.URLClassLoader.defineClass(URLClassLoader.java:556) at java.net.URLClassLoader.access$400(URLClassLoader.java:119) at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961) at java.security.AccessController.doPrivileged(AccessController.java:275) at java.net.URLClassLoader.findClass(URLClassLoader.java:487) at java.lang.ClassLoader.loadClass(ClassLoader.java:607) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327) at java.lang.ClassLoader.loadClass(ClassLoader.java:573) at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:228) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148) at java.net.URLClassLoader.defineClass(URLClassLoader.java:556) at java.net.URLClassLoader.access$400(URLClassLoader.java:119) at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961) at java.security.AccessController.doPrivileged(AccessController.java:275) at java.net.URLClassLoader.findClass(URLClassLoader.java:487) at java.lang.ClassLoader.loadClass(ClassLoader.java:607) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327) at java.lang.ClassLoader.loadClass(ClassLoader.java:573) at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:228) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148) at java.net.URLClassLoader.defineClass(URLClassLoader.java:556) at java.net.URLClassLoader.access$400(URLClassLoader.java:119) at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961) at java.security.AccessController.doPrivileged(AccessController.java:275) at java.net.URLClassLoader.findClass(URLClassLoader.java:487) at java.lang.ClassLoader.loadClass(ClassLoader.java:607) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327) at java.lang.ClassLoader.loadClass(ClassLoader.java:573) at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl.createFault(SO APFactory1_1Impl.java:62) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:150) at $Proxy9.validateUser(Unknown Source) at com.geico.ibu.service.insite.common.authentication.EAuthClient.main(EAut hClient.java:40) Regards, Ramanand Singh Architecture Team GEICO IBU Service 301.986.2791 -Original Message- From: Glen Mazza [mailto:[EMAIL PROTECTED] Sent: Friday, September 14, 2007 4:04 PM To: cxf-user@incubator.apache.org Subject: Re: CXF exception Somebody overrode a final method apparently. It would be nice if you could log a JIRA on this. Thanks, Glen Am Donnerstag, den 13.09.2007, 11:54 -0400 schrieb Singh, Ramanand: I just wrote a web service using CXF. It works okay. However, every time it gets called, it throws an exception shown below. Am I missing something? 2007-09-13 11:36:10,148 [main] [] WARN xml.DefaultNamespaceHandlerResolver - Ignoring namespace handler [org.apache.cxf.bus.spring.NamespaceHandler]: problem with handler class file or dependent class java.lang.VerifyError: final method overridden (class: org/apache/cxf/bus/spring/BusDefinitionParser method: getIdOrName(Lorg/w3c/dom/Element;)Ljava/lang/String;) at pc: 0 This email/fax message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution of this email/fax is prohibited. If you are not the intended recipient, please destroy all paper and electronic copies of the original message.
Re: CXF and EJB Web Services
Hi, I think Dan just show a way (some CXF internal API) to get your EJB object be called. It don't relaid on the NumberServiceSessionBeanProxy (Spring EJB stuff). I just went through the code , now the EJBInvoker is not bundled with CXF, you need to add it by yourself. I think you will not face any trouble to configure it with spring , we already have the invoker setter in the ServerFactoryBean. If you have other thoughts, you can also fill a JIRA[1] with your wishes. [1]http://issues.apache.org/jira/browse/CXF Willem. Srepfler Srgjan wrote: Dan Diephouse wrote: Srepfler Srgjan wrote: Is something like exposing J2EE EJB's explained in this blog post http://www.tsolak.com/?p=15 available for CXF as well? Thanks, Srgjan You may want to look at this page: http://cwiki.apache.org/CXF20DOC/invokers.html - Dan Hi Dan, I'm not really sure how is this related, are you telling me EJBInvoker is bundled with CFX and can be configured using spring to do the same function like the tsolak example? That is the main functionality I'm trying to achieve, that is not write any additional code beside the EJB and the configuration file. On that note I've had an issue it seems with xfire and I've posted it on the xfire mailing list (method invokations end up on wrong methods). Srgjan
Re: No conduit initiator
Hi Kevin, You need to include the cxf-rt-transports-http-jetty-*-incubator.jar in you class path, or add the cxf-rt-transports-http-jetty dependency in you pom.xml. Willem. kevin Wong wrote: Hi, I am trying to create a client, com.none.SportsClient. When I ran it, the following exceptions occur. Any idea what are those? What is conduit initiator ? Thanks. Exception in thread main *javax.xml.ws.soap.SOAPFaultException*: No conduit initiator was fond for the namespace http://schemas.xmlsoap.org/soap/http. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(*JaxWsClientProxy.java:175*) at $Proxy26.getData(Unknown Source) at com.none.SportsClient.main(*SportsClient.java:39*) Caused by: org.apache.cxf.interceptor.Fault: No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http. at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(* AbstractConduitSelector.java:89*) at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(* UpfrontConduitSelector.java:61*) at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(* ClientImpl.java:417*) at org.apache.cxf.endpoint.ClientImpl.invoke(*ClientImpl.java:251*) at org.apache.cxf.endpoint.ClientImpl.invoke(*ClientImpl.java:205*) at org.apache.cxf.frontend.ClientProxy.invokeSync(*ClientProxy.java:73*) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(*JaxWsClientProxy.java:135*) ... 2 more Caused by: *org.apache.cxf.BusException*: No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http. at org.apache.cxf.transport.ConduitInitiatorManagerImpl.getConduitInitiator( *ConduitInitiatorManagerImpl.java:96*) at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(* AbstractConduitSelector.java:70*) ... 8 more
Re: Failed to deploy the sample helloworld.war to WebLogic Server 9.2
JUST FYI , Here is a related thread[1] in the CXF Chinese Google group cxf-zh. [1] http://groups.google.com/group/cxf-zh/browse_thread/thread/5a31ac860999df2 Willem. william_w_hu wrote: I'm using apache-cxf-2.0.1-incubaor and WebLogic Server 9.2. I was able to run the helloworld sample coming from cxf in tomcat smoothly. But when i tried to deploy it to WLS 9.2 I always got a ClassNotFoundException as following. Anyone has encounterred similar problem? Help is highly appreciated. Thanks. ps. i build helloworld using ant war command according to the README. And copied all files in lib and modules except for modules/integration to C:\Program Files\bea\weblogic92\samples\domains\wl_server\lib. I deployed the helloworld.war using WLS admin console into the examplesServer. === Stack trace=== Error HTTP whu-t60 examplesServer [STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)' WLS Kernel 1189664354656 BEA-101216 Servlet: cxf failed to preload on startup in Web application: helloworld. org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from /WEB-INF/cxf-servlet.xml; nested exception is org.springframework.beans.FatalBeanException: Could not load class: demo.hw.server.GreeterImpl; nested exception is java.lang.ClassNotFoundException: demo.hw.server.GreeterImpl at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:375) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280) at org.apache.cxf.transport.servlet.CXFServlet.loadAdditionalConfig(CXFServlet.java:194) at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:164) at org.apache.cxf.transport.servlet.CXFServlet.init(CXFServlet.java:98) at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:276) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:68) at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58) at weblogic.servlet.internal.StubLifecycleHelper.init(StubLifecycleHelper.java:48) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1698) at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1675) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1595) at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2734) at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:892) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:336) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60) at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200) at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117) at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60) at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26) at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:641) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:229) at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154) org.springframework.beans.FatalBeanException: Could not load class: demo.hw.server.GreeterImpl; nested exception is java.lang.ClassNotFoundException: demo.hw.server.GreeterImpl at org.apache.cxf.jaxws.spring.EndpointDefinitionParser.loadImplementor(EndpointDefinitionParser.java:133) at org.apache.cxf.jaxws.spring.EndpointDefinitionParser.doParse(EndpointDefinitionParser.java:84) at
Re: CXF exception
Hi Ramanand Can you tell us the Spring version and CXF version that you currently use? I just checked the code, CXF trunk version and Spring 2.0.4, there are no any final method definitions of getIdOrName in BusDefinitionParser or its parent class. It is just protected String getIdOrName(Element elem) Willem. Singh, Ramanand wrote: I just wrote a web service using CXF. It works okay. However, every time it gets called, it throws an exception shown below. Am I missing something? Regards, Ramanand Singh Architecture Team GEICO IBU Service 301.986.2791 2007-09-13 11:36:09,773 [main] [] INFO support.ClassPathXmlApplicationContext - Refreshing [EMAIL PROTECTED] c9e: display name [EMAIL PROTECTED] 5c9e]; startup date [Thu Sep 13 11:36:09 EDT 2007]; root of context hierarchy 2007-09-13 11:36:09,883 [main] [] INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [conf/spring/eauthClientContext.xml] 2007-09-13 11:36:10,148 [main] [] WARN xml.DefaultNamespaceHandlerResolver - Ignoring namespace handler [org.apache.cxf.bus.spring.NamespaceHandler]: problem with handler class file or dependent class java.lang.VerifyError: final method overridden (class: org/apache/cxf/bus/spring/BusDefinitionParser method: getIdOrName(Lorg/w3c/dom/Element;)Ljava/lang/String;) at pc: 0 at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:228) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148) at java.net.URLClassLoader.defineClass(URLClassLoader.java:556) at java.net.URLClassLoader.access$400(URLClassLoader.java:119) at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961) at java.security.AccessController.doPrivileged(AccessController.java:275) at java.net.URLClassLoader.findClass(URLClassLoader.java:487) at java.lang.ClassLoader.loadClass(ClassLoader.java:607) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327) at java.lang.ClassLoader.loadClass(ClassLoader.java:573) at
Re: CXF simple front end and HTTPS ?
Hi , You can get the HttpConduit with these codes after creating the service object. Client client = ClientProxy.getClient(service); HttpConduit conduit = (HttpConduit) client.getConduit(); Willem. Chris Campbell wrote: I cannot figure out how to use SSL in a simple front end client like the following JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setBus( bus ); factory.setAddress( https://somewhere/service; ); factory.setServiceClass( Service.class ); Service = (Service) factory.create(); I see examples where people are adding new TLSClientParameters() to the HTTPConduit, but I cannot figure out how to get the HTTPConduit in this example.
Re: Code first sample without ant
Hi, The web.xml just help you to set up the servlet transport for the CXF runtime. If you want to publish your service you still need to some thing like the wiki [1]said. Such as write the cxf-servlet.xml or write the code using JAXWS API or CXF ServerFactoryBean. And there is another option which uses spring to initialize the endpoint. You can find the reference doc from [2] [1]http://cwiki.apache.org/CXF20DOC/servlet-transport.html [2]http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html Willem. Jeff.Yu wrote: Yes, but you also need the cxf-servlet.xml which configures your endpoint. I would recommend you see this WIKI[1] page for your scenario, it is simple POJO based. Thanks Jeff [1] http://cwiki.apache.org/CXF20DOC/simple-frontend.html Diego Pires Plentz wrote: Excellent. Just one more question. To run this ws in a container like tomcat, all I must do is set up web.xml as in http://cwiki.apache.org/CXF20DOC/servlet-transport.html? ?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 /web-app On 9/12/07, Jeff.Yu [EMAIL PROTECTED] wrote: Hi, Yep, you can build and run demo without ANT. please refer to this README[1], see the Building the demo using javac and Running the demo using java section. Thanks Jeff [1] http://svn.apache.org/repos/asf/incubator/cxf/trunk/distribution/src/main/release/samples/java_first_jaxws/README.txt Diego Pires Plentz wrote: Hi Guys! I'm migrating from XFire and I'm looking for a sample like the purchase-order sample from XFire: just simple pojos/classes, little configuration and no necessary ant calls. There is a way to do this in CXF? I'm already looked at the samples dir in the dist zip, but the README file tells to use the ant builders (even in the hello_world_code_fist sample). Thanks
Re: jaxws:endpoint and depends-on attribute
Hi Doug, After I reviewed your stack trace , I just found you need to set the servicePreference in the FileUtilities first. Willem. java.lang.NullPointerException at au.net.mmsn.pfc.servlet.serbices.rfio.impl.FileUtilities.getServicePrefer ence(FileUtilities.java:76) at au.net.mmsn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl.init(RemoteFi leImpl.java:29) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) doug wrote: Hi Willem, Thanks to you both for that. Now the depends-on attribute parses ok in the jaxws:endpoint elements of the beans.xml file, but I still have the same error as before. i.e. it doesn't seem to have preloaded the depends-on bean. thanks again Doug On Thursday 06 September 2007 17:56, Willem Jiang wrote: Hi doug , I just committed a patch CXF-955 which is contributed by Fred into the trunk. It added the depends-on attribute in the jaxws:endpoint. I think you just want that :) You can try latest version in the trunk , or wait for the next snapshot. Willem. doug wrote: I have implemented some services and configure them in a WEB-INF/beans.xml file. I was using this file to specify some initialization parameters that get stored in a bean (FileUtilities) and which are subsequently accessed by several other jaxws:endpoint definedservices. I thought everything was configured ok because all services are loaded without problems on my development server, running apache-tomcat-5.5.20 Unfortunately when I try to deploy to our production server, apache-tomcat-5.5.16 it fails to load, on account of the error below. Basically, it seems to me that the FileUtilities bean hasn't been loaded or initialized at the time the endpoint is being instatiated, whereas it was under tomcat 5.5.20. I read that there is a bean depends-on=otherID attribute that induces otherID beans to be loaded and initialized first, but apparently that doesn't exist for jaxws:endpoint Is there another way to achieve the same result? Thanks Doug 879 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext r esource [/WEB-INF/beans.xml]; nested exception is org.springframework.beans.FatalBeanException: Could not load class: au.net.mm sn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl; nested exception is java.lang.NullPointerException Caused by: org.springframework.beans.FatalBeanException: Could not load class: au.net.mmsn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl; nested exception is java.lang.NullPointerException Caused by: java.lang.NullPointerException at au.net.mmsn.pfc.servlet.serbices.rfio.impl.FileUtilities.getServicePrefer ence(FileUtilities.java:76) at au.net.mmsn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl.init(RemoteFi leImpl.java:29) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAc cessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConst ructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
Re: NameSpaceHandling error
Hi, The commons logging issue should be missing the commons-logging-1.1.jar in the CXF lib directory. Willem. Jon Mountjoy wrote: WebLogic Server has an interesting prefer-web-inf-classes setting that you can define which changes its default class loader behaviour - see http://e-docs.bea.com/wls/docs91/programming/classloading.html#1073478 Perhaps that will help. BTW - you should describe what commons logging problem you actually get to help people here try and help you. Regards, Jon On 11 Sep 2007, at 21:46, Sureka, Sushil wrote: The issue is that since I placed the cxf incubator jar file in the system classpath, org/apache/cxf/binding/soap/spring/NamespaceHandler class is loaded by the system classpath. Since this class has a dependency to spring bean classes, the loading fails. If I placed all the spring jar files, it does go past the problem I reported earlier but it fails while looking for commons logging. So obviously putting all the classes in the bootloader classpath would work but that is defintely not what I am looking for. Any suggestions on what can be done here? Sushil -Original Message- From: Sureka, Sushil [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 11:46 AM To: cxf-user@incubator.apache.org; [EMAIL PROTECTED] Subject: RE: NameSpaceHandling error I definitely have all the classes in the classpath. I can see all the handler classes in the jar files. It may have something to do with classloader issue. Due to weblogic issues, I placed the C:\Apps\apache-cxf-2.0.1-incubator\lib\cxf-2.0.1-incubator.ja r this path in front of my classpath. Rest all the jars from CXF library distribution has been copied over to WEB-INF/lib. I did follow the tutorial and that's how I have configured my project. Sushil -Original Message- From: Dale Peakall [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 10:24 AM To: cxf-user@incubator.apache.org Subject: Re: NameSpaceHandling error From the Java documentation for NoClassDefFoundException: The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found. Looks like you're missing a Jar file. Please make sure you're including all the Jars referenced here: http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html Sureka, Sushil wrote: I am afraid we will have to abandon our effort to get CXF in our project if we can not go past this issue. If any one has any suggestion, please advise Thanks -Original Message- From: Sureka, Sushil [mailto:[EMAIL PROTECTED] Sent: Monday, September 10, 2007 4:57 PM To: cxf-user@incubator.apache.org Subject: NameSpaceHandling error I am just trying to do a very simple web service using Spring but have run into an issue. I get the following excpetion when weblogic is starting up SEVERE: Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsin gException : Config uration problem: Unable to locate NamespaceHandler for namespace [http://cxf.apa che.org/jaxws] Offending resource: ServletContext resource [/WEB-INF/beans.xml] at org.springframework.beans.factory.parsing.FailFastProblemReporter.err or(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC ontext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC ontext.java:80) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.er ror(BeanDefinitionParserDelegate.java:261) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa rseCustomElement(BeanDefinitionParserDelegate.java:) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa rseCustomElement(BeanDefinitionParserDelegate.java:1104) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe .. There are number of warnings on these lines before the actual error occurs WARNING: Ignoring namespace handler [org.apache.cxf.binding.soap.spring.Namespac eHandler]: problem with handler class file or dependent class java.lang.NoClassDefFoundError: org/apache/cxf/binding/soap/spring/NamespaceHand ler : org/springframework/beans/factory/xml/NamespaceHandlerSupport at java.lang.ClassLoader.defineClass(Ljava.lang.String;[BIILjava.securit y.ProtectionDomain;)Ljava.lang.Class;(Unknown Source) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12 Here is the simple bean.xml file beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; import
Re: CXF and SSL
Hi Ryan , It is wired because there is only one difference in the the transport layer between the http and https. So I am wonder whether you create two different projects (one for http , the other for https) or not. Maybe there are some difference between your two projects setting. Willem. Ryan Moquin wrote: So things have only gotten worse in regards to things going haywire with CXF and the webservice I'm trying to communicate with. I'm able to send a soap request directly to the webservice without an SSL problems, but I always get a handshake error no matter what I try with CXF. Here is my current cxf.xmlfile: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:sec=http://cxf.apache.org/configuration/security; xmlns:http=http://cxf.apache.org/transports/http/configuration; xsi:schemaLocation=http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd; http:conduit name={ http://testnotification/notification}NotificationPort.http-conduit; http:tlsClientParameters secureSocketProtocol=SSL sec:trustManagers sec:keyStore type=JKS password=changeit file=c:\jdk1.5.0_12\jre\lib\security\cacerts/ /sec:trustManagers sec:keyManagers keyPassword= sec:keyStore type=JKS password=changeit file=c:\jdk1.5.0_12\jre\lib\security\cacerts/ /sec:keyManagers /http:tlsClientParameters /http:conduit /beans this is the same store that my manual connection to the webservice is using, yet with cxf I get: Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java :150) at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java :117) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert( SSLSocketImpl.java:1584) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord( SSLSocketImpl.java:866) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake( SSLSocketImpl.java:1030) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake( SSLSocketImpl.java:1057) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake( SSLSocketImpl.java:1041) at sun.net.www.protocol.https.HttpsClient.afterConnect( HttpsClient.java:402) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect( AbstractDelegateHttpsURLConnection.java: 166) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream( HttpURLConnection.java:857) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream (HttpsURLConnectionImpl.java:230) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching (HTTPConduit.java:1787) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite( HTTPConduit.java:1755) at org.apache.cxf.io.AbstractWrappedOutputStream.write( AbstractWrappedOutputStream.java:42) at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:96) at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java :214) at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311) Any ideas? I'm about at the end of my rope... I cannot for the life of me get this to work. I did try to send a request without SSL just so I could see what it's sending, if I simply comment out the SSL config in my cxf.xml, then CXF will start complaining that it can't serialize my jaxb objects because of a missing XMLRoot which makes no sense because with SSL turned on, it magically has no problem serializing my JAXB objects. Also, with SSL off, all I get in TCPMon is just some headers sent to the webservice with no soap in the body. Does anyone know why this is so screwy? I'm using 2.0.1: Caused by: javax.xml.bind.MarshalException - with linked exception: [com.sun.istack.SAXException2: unable to marshal type testnotification.NotificationInfo as an element b ecause it is missing an @XmlRootElement annotation] at com.sun.xml.bind.v2.runtime.MarshallerImpl.write( MarshallerImpl.java:295) at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal( MarshallerImpl.java:221) at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal( AbstractMarshallerImpl.java:70) at org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject( JAXBEncoderDecoder.java:187) at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall( JAXBEncoderDecoder.java:156) ... 54 more Caused by: com.sun.istack.SAXException2: unable to marshal type testnotification.NotificationInfo as an element because it is missing an @XmlRootElement annotation at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(
Re: Adding headers to soap request
Hi Ryan, We are just voting 2.0.2 in the cxf-dev, you can get staged kit from [1] [1]http://people.apache.org/~dkulp/stage_cxf/2.0.2-incubator-take1/ Willem. Ryan Moquin wrote: No problem. Do you have any idea how stable 2.1 is? I notice that my issue with the IndexOutOfBounds with the one Interceptor doesn't happen on 2.1 but does on 2.0.1 (so somehow it have been fixed, directly or indirectly). Is it helpful to know if it's a problem on 2.1? Is it relatively safe to use 2.1 snapshots? On 9/11/07, James Mao [EMAIL PROTECTED] wrote: Great, That's definitely helpful. Thanks Ryan, James Sure, I'll see if I can somehow get my test case working that fails, though maybe it doesn't fail and the bug with the interceptor that I mentioned earlier is causing it to fail no matter how I run wsdl2java. I'll see if I can finish getting a small test case. On 9/11/07, James Mao [EMAIL PROTECTED] wrote: Hi Ryan, I was able to get this to work now with my scaled down test wsdl, but not the full wsdl that I need it to work with, I'll do my best to help you with what I know about this. I did notice your thread that sounded familiar. Apparently if you add the -exsh true parameter to wsdl2java, you'll end up with an extra parameter in your method signature of your port class implementation. This extra parameter is the header specified in your wsdl. If you don't add the exsh, you won't get the parameter and end up with an IndexOutOfBounds error because cxf is expecting the header. I'm not sure why cxf would assume you are including the header if you never generated your classes to accept one. If exsh not turned on, then there'll not generate the extra header parameter, and it should not fail the runtime, otherwise there's a bug in the runtime. the header parameter is optional, I remember that i fixed this in both the tools and runtime, but maybe there's one case that i didn't cover, so, do you mind send your case (simplified) which i can reproduce, If you can file a jira, that will be great. Regards, James I know my classes weren't setting the header because when I did a find usages on my AuthCredentials class, which is put in the header, it wasn't used anywhere. Actually the generated client code, didn't even actually make calls to invoke the webservice. It would just create a response object set to null and return it, and that was it. So the generated client in my opinion was useless anyhow. On 9/11/07, Gamble, Wesley (WG10) [EMAIL PROTECTED] wrote: Ryan, All I get currently is an IndexOutOfBoundsException when CXF tries to create the header of the SOAP message to send, sounds suspiciously like my problem (thread: Can't get at SOAP error from Web service...). I'm getting an index out of bounds exception as well on the header processing. What is the -exsh flag on wsdl2java supposed to do for you? What does Enables or disables processing of extended soap header message binding. mean? How would I know the difference between a regular and an extended soap header message? How do you know that the generated client classes do NOT set the header that is specified in the binding? Wes -Original Message- From: Ryan Moquin [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 9:36 AM To: cxf-user@incubator.apache.org Subject: Adding headers to soap request I'm writing this as a new message, but I'm hoping that it's answer will solve my other issue I'm writing about. I think I'm having having trouble understanding how to add a header to my request using cxf. In short, I have a WSDL that defines this element: s:element name=AuthCredentials type=tns:AuthCredentials/ s:complexType name=AuthCredentials s:sequence s:element minOccurs=0 maxOccurs=1 name=username type=s:string/ s:element minOccurs=0 maxOccurs=1 name=password type=s:string/ /s:sequence /s:complexType and then defines a binding that uses it: wsdl:operation name=sendNotification soap:operation soapAction=urn://testnotification/sendNotification style=document/ wsdl:input soap:body use=literal/ soap:header message=tns:sendNotificationAuthCredentials part=AuthCredentials use=literal/ /wsdl:input wsdl:output soap:body use=literal/ /wsdl:output /wsdl:operation When I run this WSDL through wsdltojava using -exsh true, the generated client classes do NOT set the header that is specified in the
Re: jaxws:endpoint and depends-on attribute
Hi Doug, To be honestly, I know nothing about the applet jars downloading work. Maybe you need resend you letter somewhere to discuss with some applet experts. BTW, I am also interesting with answer, you are the pioneer to use the CXF client in the applet :) Willem. doug wrote: Thank you Willem, and many apologies for wasting your time. I just discovered an hour ago that apparently I accidently had two versions of the compiled classfiles floating aroundand the older tomcat loaded preferentially from WEB-INF/classes whereas the newer tomcat loaded from my WEB-INF/lib/ jar file (discovered after rewriting the class to eliminate any traces of servicePreference and still getting the same error with bogus line numbers) Now my server loads and works, but my applet client still takes forever to properly establish a connection - as I described in another email: http://www.nabble.com/CXF-based-applet-initialization-worries-tf4375613.html#a12472137 Basically the applet is making about 200 calls to the server for nonexistent jaxb.properties files and http://192.168.98.46:8080/pfc/lib/jaxb-impl-2.0.5.jar I have no idea what the significance of that is, but it adds about 2 to 5 minutes to the startup time of the applet. Also, the jar file was already downloaded and cached by the JRE. Any insights into this one would be much appreciated! Thanks again Doug On Wednesday 12 September 2007 11:55, Willem Jiang wrote: Hi Doug, After I reviewed your stack trace , I just found you need to set the servicePreference in the FileUtilities first. Willem. java.lang.NullPointerException at au.net.mmsn.pfc.servlet.serbices.rfio.impl.FileUtilities.getServicePref er ence(FileUtilities.java:76) at au.net.mmsn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl.init(Remote Fi leImpl.java:29) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) doug wrote: Hi Willem, Thanks to you both for that. Now the depends-on attribute parses ok in the jaxws:endpoint elements of the beans.xml file, but I still have the same error as before. i.e. it doesn't seem to have preloaded the depends-on bean. thanks again Doug On Thursday 06 September 2007 17:56, Willem Jiang wrote: Hi doug , I just committed a patch CXF-955 which is contributed by Fred into the trunk. It added the depends-on attribute in the jaxws:endpoint. I think you just want that :) You can try latest version in the trunk , or wait for the next snapshot. Willem. doug wrote: I have implemented some services and configure them in a WEB-INF/beans.xml file. I was using this file to specify some initialization parameters that get stored in a bean (FileUtilities) and which are subsequently accessed by several other jaxws:endpoint definedservices. I thought everything was configured ok because all services are loaded without problems on my development server, running apache-tomcat-5.5.20 Unfortunately when I try to deploy to our production server, apache-tomcat-5.5.16 it fails to load, on account of the error below. Basically, it seems to me that the FileUtilities bean hasn't been loaded or initialized at the time the endpoint is being instatiated, whereas it was under tomcat 5.5.20. I read that there is a bean depends-on=otherID attribute that induces otherID beans to be loaded and initialized first, but apparently that doesn't exist for jaxws:endpoint Is there another way to achieve the same result? Thanks Doug 879 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext r esource [/WEB-INF/beans.xml]; nested exception is org.springframework.beans.FatalBeanException: Could not load class: au.net.mm sn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl; nested exception is java.lang.NullPointerException Caused by: org.springframework.beans.FatalBeanException: Could not load class: au.net.mmsn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl; nested exception is java.lang.NullPointerException Caused by: java.lang.NullPointerException at au.net.mmsn.pfc.servlet.serbices.rfio.impl.FileUtilities.getServicePref er ence(FileUtilities.java:76) at au.net.mmsn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl.init(Remote Fi leImpl.java:29) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructor Ac cessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCon st ructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
Re: CXF and SSL
Hi Ryan, Just FYI, you can take the systest's http package [1] as an example when you write a test case for you case. [1] https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http We can trace the bug more easily with your test case . Willem. Ryan Moquin wrote: Nope, I'll show you exactly what I change where one gets a handshake error and the other can't construct the XML message: I change the URL between these two (depending on whether I was ssl or not obviously): https://localhost:8084/webservices/messaging.asmx http://localhost:8084/webservices/messaging.asmx The only other change I make is to comment out the SSL contents of cfx.xml: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:sec=http://cxf.apache.org/configuration/security; xmlns:http=http://cxf.apache.org/transports/http/configuration; xsi:schemaLocation=http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd; http:conduit name={ http://www.sendwordnow.com/notification}SWN_x0020_Messaging_x0020_Web_x0020_ServiceSoap.http-conduit !--http:tlsClientParameters secureSocketProtocol=SSL sec:trustManagers sec:keyStore type=JKS password=changeit file=c:\jdk1.5.0_12\jre\lib\security\cacerts/ /sec:trustManagers sec:keyManagers keyPassword= sec:keyStore type=JKS password=changeit file=c:\jdk1.5.0_12\jre\lib\security\cacerts/ /sec:keyManagers /http:tlsClientParameters-- /http:conduit /beans It's prob hard to see but I commented the http:tlsClientParameters element. So I use the http url and the commented cfx.xml and then I use the https url and the uncommented cfx.xml. When I do, the http one will fail because it claims the XML can't be created, the other one generates a handshake error. Nothing else is changed. This problem also occurs on 2.1. I can see if I can get a test case to demonstrate this as well. On 9/11/07, Willem Jiang [EMAIL PROTECTED] wrote: Hi Ryan , It is wired because there is only one difference in the the transport layer between the http and https. So I am wonder whether you create two different projects (one for http , the other for https) or not. Maybe there are some difference between your two projects setting. Willem. Ryan Moquin wrote: So things have only gotten worse in regards to things going haywire with CXF and the webservice I'm trying to communicate with. I'm able to send a soap request directly to the webservice without an SSL problems, but I always get a handshake error no matter what I try with CXF. Here is my current cxf.xmlfile: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:sec=http://cxf.apache.org/configuration/security; xmlns:http=http://cxf.apache.org/transports/http/configuration; xsi:schemaLocation= http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd; http:conduit name={ http://testnotification/notification}NotificationPort.http-conduit; http:tlsClientParameters secureSocketProtocol=SSL sec:trustManagers sec:keyStore type=JKS password=changeit file=c:\jdk1.5.0_12\jre\lib\security\cacerts/ /sec:trustManagers sec:keyManagers keyPassword= sec:keyStore type=JKS password=changeit file=c:\jdk1.5.0_12\jre\lib\security\cacerts/ /sec:keyManagers /http:tlsClientParameters /http:conduit /beans this is the same store that my manual connection to the webservice is using, yet with cxf I get: Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure at com.sun.net.ssl.internal.ssl.Alerts.getSSLException( Alerts.java :150) at com.sun.net.ssl.internal.ssl.Alerts.getSSLException( Alerts.java :117) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert( SSLSocketImpl.java:1584) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord( SSLSocketImpl.java:866) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake( SSLSocketImpl.java:1030) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake( SSLSocketImpl.java:1057) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake( SSLSocketImpl.java:1041) at sun.net.www.protocol.https.HttpsClient.afterConnect( HttpsClient.java:402) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect( AbstractDelegateHttpsURLConnection.java
Re: Error when trying to contact service over SSL on a specific port
Hi It looks like that wstx can't consume the incoming message. Can you try to call the service without the SSL socket wrap first? And there also another question, how did you generate the client side artifacts ? We need to find out the issue come from the SSL configuration or from the wired message. For the spring configuration with SSL on the client , there are some threads in the cxf-user which talk about it , you can search the tile with http-conf or Setting the timeout on the client side, and we also have a JIRA[1] to trace it. [1]https://issues.apache.org/jira/browse/CXF-922 Willem. pdog wrote: I've been trying to figure this one out for a while now and have not been having much luck. This new error is not something I have seen on this forum yet so I was wondering if anyone has seen before or not. I am trying to contact a service that is over ssl to a particular port, eg https://somedomain:1040/something.asmx?wsdl Here is the client that I have configured based on other suggestions in the forums: QName SERVICE_NAME = new QName(http://com.comments.client/;, ClientCommentsService); URL wsdlURL = new URL(https://somedomain:1040/clientservices/ClientCommentsService.asmx?WSDL;); ClientCommentsService ss = new ClientCommentsService(wsdlURL, SERVICE_NAME); ClientCommentsServiceSoap port = ss.getClientCommentsServiceSoap(); Client c = ClientProxy.getClient(port); HTTPConduit conduit = (HTTPConduit)c.getConduit(); HTTPClientPolicy httpPolicy = new HTTPClientPolicy(); httpPolicy.setConnection(ConnectionType.KEEP_ALIVE); httpPolicy.setMaxRetransmits(1); httpPolicy.setAllowChunking(false); httpPolicy.setContentType(text/xml); conduit.setClient(httpPolicy); TLSClientParameters tlsParams = new TLSClientParameters(); tlsParams.setSecureSocketProtocol(SSL); conduit.setTlsClientParameters(tlsParams); SaveCommentResponseType _saveComment__return = port.saveComment(4823048230484203, 48230482304, Note, Note, My Name, 09/11/2007); Now when this is run it throws this error: 14:42:47,095 ERROR [STDERR] Sep 11, 2007 2:42:47 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL INFO: Creating Service {http://com.comments.client/}ClientCommentsService from WSDL: https://somedomain:1040/clientservices/ClientCommentsService.asmx?WSDL 14:42:47,251 ERROR [STDERR] Sep 11, 2007 2:42:47 PM org.apache.cxf.transport.https.SSLUtils getCiphersuites INFO: The cipher suites have not been configured, falling back to cipher suite filters. 14:42:47,251 ERROR [STDERR] Sep 11, 2007 2:42:47 PM org.apache.cxf.transport.https.SSLUtils getCiphersuites INFO: The cipher suite filters have not been configured, falling back to default filters. 14:42:47,251 ERROR [STDERR] Sep 11, 2007 2:42:47 PM org.apache.cxf.transport.https.SSLUtils getCiphersFromList INFO: The cipher suites have been set to SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, SSL_RSA_WITH_NULL_MD5, SSL_RSA_WITH_NULL_SHA, SSL_DH_anon_WITH_DES_CBC_SHA, SSL_DH_anon_EXPORT_WITH_RC4_40_MD5, SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, TLS_KRB5_WITH_DES_CBC_SHA, TLS_KRB5_WITH_DES_CBC_MD5, TLS_KRB5_EXPORT_WITH_RC4_40_SHA, TLS_KRB5_EXPORT_WITH_RC4_40_MD5, TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA, TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5. 14:42:47,470 ERROR [STDERR] Sep 11, 2007 2:42:47 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader. at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:187) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:56) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:395) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1932) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1790) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:576) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at
Re: Can't figure out why I'm getting this error or how to troubleshoot it
Hi Ryan, I don't know if you had resolved theh SSL configuration issue. You configuration file looks good to me. I just went through the stack trace, I found it caused by a soap header build up problem. Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.RangeCheck(ArrayList.java:546) at java.util.ArrayList.get(ArrayList.java:321) at org.apache.cxf.message.MessageContentsList.get( MessageContentsList.java:76) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.handleHeaderPart( SoapOutInterceptor.java:179) at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor.writeSoapEnvelopeStart (SoapOutInterceptor.java:124) And I also dig the code of JaxWsClientProxy, and found you will never get the wired message because the exception is thrown before the message go out to the transport layer. So please give us the wsdl (or just some part of soap header messages) and the steps which you created the Java artifacts from wsdl. Willem. Ryan Moquin wrote: I've been trying to use the generated files from my WSDL to access an external webservice that uses SSL and authentication. I setup an http-conduit (I was getting the protocol error when I didn't have it setup) for SSL and now I get the following error, anyone have any ideas what I can do from here?: javax.xml.ws.soap.SOAPFaultException: Index: 1, Size: 1 at org.apache.cxf.jaxws.JaxWsClientProxy.invoke( JaxWsClientProxy.java:169) at $Proxy101.sendNotification(Unknown Source) at service.NotificationServiceClient.sendNotification( NotificationServiceClient.java:88) at service.NotificationServiceClientTest.testSendNotification( NotificationServiceClientTest.java:62) 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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java :552) at org.testng.internal.Invoker.invokeMethod(Invoker.java:411) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:785) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java :114) at org.testng.TestRunner.privateRun(TestRunner.java:693) at org.testng.TestRunner.run(TestRunner.java:574) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:241) at org.testng.SuiteRunner.run(SuiteRunner.java:145) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:901) at org.testng.TestNG.runSuitesLocally(TestNG.java:863) at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG( TestNGExecutor.java:64) at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute( TestNGXmlTestSuite.java:75) at org.apache.maven.surefire.Surefire.run(Surefire.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess( SurefireBooter.java:225) at org.apache.maven.surefire.booter.SurefireBooter.run( SurefireBooter.java:139) at org.apache.maven.plugin.surefire.SurefirePlugin.execute( SurefirePlugin.java:376) at org.apache.maven.plugin.DefaultPluginManager.executeMojo( DefaultPluginManager.java:443) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle (DefaultLifecycleExecutor.java:480 ) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal( DefaultLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (DefaultLifecycleExecutor.java :311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) at org.apache.maven.cli.MavenCli.main(MavenCli.java:272) 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
Re: Can't figure out why I'm getting this error or how to troubleshoot it
Hi Ryan, Can you tell me how you generate the soap header message with the wsdl2java? Did you specify the option -exsh true when you call wsdl2java? If not , please try it again. Willem. Ryan Moquin wrote: I actually just got my breakpoint to be hit: It's choking on an element of my WSDL that looks like this: s:element name=AuthCredentials type=tns:AuthCredentials/ s:complexType name=AuthCredentials s:sequence s:element minOccurs=0 maxOccurs=1 name=username type=s:string/ s:element minOccurs=0 maxOccurs=1 name=password type=s:string/ /s:sequence /s:complexType I would like to post the whole WSDL, but I'm not sure I'm allowed to. Something related to this element is causing an arraylist to not fill itself with something. I notice that the type variable in the MessagePartInfo class is null when representing this element. No idea why. typeClass variable is also null as well maybe it doesn't like something with how this is defined? On 9/10/07, Benson Margulies [EMAIL PROTECTED] wrote: If it really is never talking to the server (which would be really surprising) then you should be able to create a standalone test case that we could debug into? -Original Message- From: Ryan Moquin [mailto:[EMAIL PROTECTED] Sent: Monday, September 10, 2007 8:39 PM To: cxf-user@incubator.apache.org Subject: Re: Can't figure out why I'm getting this error or how to troubleshoot it I tried and it appears that no request has been sent. I used TCPMonitor and changed the URL that my client was pointing to. When I run the client, no message comes across TCPMonitor and I still get the same error. It appears that it's trying to do something with the headers when constructing the SOAP message? I was trying get a debug point to work in netbeans in order to try to get an idea what CXF is trying to do at the time the exception occurs, but so far I haven't had luck getting netbeans to make the association to the source code so that the breakpoint is hit. On 9/10/07, Benson Margulies [EMAIL PROTECTED] wrote: The service you are talking to is very unhappy with you. Can you get a trace of the message traffic? -Original Message- From: Ryan Moquin [mailto:[EMAIL PROTECTED] Sent: Monday, September 10, 2007 7:59 PM To: cxf-user@incubator.apache.org Subject: Can't figure out why I'm getting this error or how to troubleshoot it I've been trying to use the generated files from my WSDL to access an external webservice that uses SSL and authentication. I setup an http-conduit (I was getting the protocol error when I didn't have it setup) for SSL and now I get the following error, anyone have any ideas what I can do from here?: javax.xml.ws.soap.SOAPFaultException: Index: 1, Size: 1 at org.apache.cxf.jaxws.JaxWsClientProxy.invoke( JaxWsClientProxy.java:169) at $Proxy101.sendNotification(Unknown Source) at service.NotificationServiceClient.sendNotification( NotificationServiceClient.java:88) at service.NotificationServiceClientTest.testSendNotification( NotificationServiceClientTest.java:62) 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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java :552) at org.testng.internal.Invoker.invokeMethod(Invoker.java:411) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:785) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java :114) at org.testng.TestRunner.privateRun(TestRunner.java:693) at org.testng.TestRunner.run(TestRunner.java:574) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:241) at org.testng.SuiteRunner.run(SuiteRunner.java:145) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:901) at org.testng.TestNG.runSuitesLocally(TestNG.java:863) at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG( TestNGExecutor.java:64) at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute( TestNGXmlTestSuite.java:75) at org.apache.maven.surefire.Surefire.run(Surefire.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at
Re: Can't figure out why I'm getting this error or how to troubleshoot it
Hi Ryan, I just tested your wsdl with the latest CXF using the wsdl2java to generate both client and server code. It is wsdl2java -all -exsh true wsdlname. They work fine to me. Here is the client out going message: soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Header AuthCredentials xmlns=urn://testnotification usernameuserName/username passwordpassword/password /AuthCredentials /soap:Header soap:Body parameters xmlns:ns2=urn://testnotificationhell world /parameters/soap:Body/soap:Envelope Can I know you CXF version? Maybe you need to update it :) Willem. Ryan Moquin wrote: Here you go, I created a scaled down wsdl that is as simple as I can think of, but still representative of the wsdl I'm working with that exploits this problem. I'll post the wsdl here that I created and then I'll also try the -exsh option, which I haven't been using. Here is a wsdl that will give you the problem I'm having when you call the operation it has defined: ?xml version=1.0 encoding=UTF-8? wsdl:definitions xmlns:http=http://schemas.xmlsoap.org/wsdl/http/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:s=http://www.w3.org/2001/XMLSchema; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:tns=urn://testnotification xmlns:tm=http://microsoft.com/wsdl/mime/textMatching/; xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/; targetNamespace=urn://testnotification xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; wsdl:types s:schema elementFormDefault=qualified targetNamespace=urn://testnotification s:element name=AuthCredentials type=tns:AuthCredentials/ s:complexType name=AuthCredentials s:sequence s:element minOccurs=0 maxOccurs=1 name=username type=s:string/ s:element minOccurs=0 maxOccurs=1 name=password type=s:string/ /s:sequence /s:complexType /s:schema /wsdl:types wsdl:message name=notificationInput wsdl:part name=parameters type=s:string/ /wsdl:message wsdl:message name=notificationOutput wsdl:part name=parameters type=s:string/ /wsdl:message wsdl:message name=sendNotificationAuthCredentials wsdl:part name=AuthCredentials element=tns:AuthCredentials/ /wsdl:message wsdl:portType name=NotificationServicePort wsdl:operation name=sendNotification wsdl:input message=tns:notificationInput/ wsdl:output message=tns:notificationOutput/ /wsdl:operation /wsdl:portType wsdl:binding name=NotificationServicePort type=tns:NotificationServicePort soap:binding transport=http://schemas.xmlsoap.org/soap/http; style=document/ wsdl:operation name=sendNotification soap:operation soapAction=urn://testnotification/sendNotification style=document/ wsdl:input soap:body use=literal/ soap:header message=tns:sendNotificationAuthCredentials part=AuthCredentials use=literal/ /wsdl:input wsdl:output soap:body use=literal/ /wsdl:output /wsdl:operation /wsdl:binding wsdl:service name=NotificationService documentation xmlns=http://schemas.xmlsoap.org/wsdl// wsdl:port name=NotificationServicePort binding=tns:NotificationServicePort soap:address location=https://localhost/webservice/notification.asmx / /wsdl:port /wsdl:service /wsdl:definitions On 9/10/07, Willem Jiang [EMAIL PROTECTED] wrote: Hi Ryan, Can you tell me how you generate the soap header message with the wsdl2java? Did you specify the option -exsh true when you call wsdl2java? If not , please try it again. Willem. Ryan Moquin wrote: I actually just got my breakpoint to be hit: It's choking on an element of my WSDL that looks like this: s:element name=AuthCredentials type=tns:AuthCredentials/ s:complexType name=AuthCredentials s:sequence s:element minOccurs=0 maxOccurs=1 name=username type=s:string/ s:element minOccurs=0 maxOccurs=1 name=password type=s:string/ /s:sequence /s:complexType I would like to post the whole WSDL, but I'm not sure I'm allowed to. Something related to this element is causing an arraylist to not fill itself with something. I notice that the type variable in the MessagePartInfo class is null when representing this element. No idea why. typeClass variable is also null as well maybe it doesn't like something with how this is defined? On 9/10/07, Benson Margulies [EMAIL PROTECTED] wrote: If it really is never talking to the server (which would be really surprising) then you should be able to create a standalone test case that we could debug into? -Original Message- From: Ryan Moquin [mailto:[EMAIL PROTECTED] Sent: Monday, September 10, 2007 8:39 PM To: cxf-user@incubator.apache.org Subject: Re: Can't figure out why I'm getting this error or how to troubleshoot it I tried and it appears that no request has been sent. I used TCPMonitor and changed the URL
Re: Memory leak in client?
Hi If you use the Jaxws API getPort to create the client proxy. CXF will try to get a default bus first , if the default bus is not exit, it will create a bus and set default bus and default thread local bus for you. So the thread local object in your case should be the bus :) Here are some code snippets which can help you to know better about the default Bus and bus.shutdown() 1. Bus creation public CXFBusImpl(MapClass, Object extensions) { if (extensions == null) { extensions = new ConcurrentHashMapClass, Object(); } else { extensions = new ConcurrentHashMapClass, Object(extensions); } this.extensions = extensions; state = BusState.INITIAL; CXFBusFactory.possiblySetDefaultBus(this); } 2. CXFBusFactory.possiblySetDefaultBus(this); public static synchronized boolean possiblySetDefaultBus(Bus bus) { // there is a thread location variable which store the default thread local bus if (localBus.get() == null) { localBus.set(bus); } if (defaultBus == null) { defaultBus = bus; return true; } return false; } 3. CXFBusImpl.shutdown(boolean wait) public void shutdown(boolean wait) { BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class); if (null != lifeCycleManager) { lifeCycleManager.preShutdown(); } synchronized (this) { state = BusState.SHUTDOWN; notifyAll(); } if (null != lifeCycleManager) { lifeCycleManager.postShutdown(); } if (BusFactory.getDefaultBus(false) == this) { BusFactory.setDefaultBus(null); } } You can find more information about bus by reading the source code. CXFBusImpl https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java CXFBusFactory https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusFactory.java Willem. Joe Sunday wrote: Is that a done with the client or done with the application call? If there's something I need to call when I'm done with a particular port, I can deal with that. I don't see it documented anywhere though. --Joe On Sep 6, 2007, at 3:21 PM, Daniel Kulp wrote: Joe, One thing to keep in mind: the Bus would still be around. You'd need to get the default Bus and call shutdown() on it if you're completely done. Dan -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: jaxws:endpoint and depends-on attribute
Hi doug , I just committed a patch CXF-955 which is contributed by Fred into the trunk. It added the depends-on attribute in the jaxws:endpoint. I think you just want that :) You can try latest version in the trunk , or wait for the next snapshot. Willem. doug wrote: I have implemented some services and configure them in a WEB-INF/beans.xml file. I was using this file to specify some initialization parameters that get stored in a bean (FileUtilities) and which are subsequently accessed by several other jaxws:endpoint definedservices. I thought everything was configured ok because all services are loaded without problems on my development server, running apache-tomcat-5.5.20 Unfortunately when I try to deploy to our production server, apache-tomcat-5.5.16 it fails to load, on account of the error below. Basically, it seems to me that the FileUtilities bean hasn't been loaded or initialized at the time the endpoint is being instatiated, whereas it was under tomcat 5.5.20. I read that there is a bean depends-on=otherID attribute that induces otherID beans to be loaded and initialized first, but apparently that doesn't exist for jaxws:endpoint Is there another way to achieve the same result? Thanks Doug 879 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext r esource [/WEB-INF/beans.xml]; nested exception is org.springframework.beans.FatalBeanException: Could not load class: au.net.mm sn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl; nested exception is java.lang.NullPointerException Caused by: org.springframework.beans.FatalBeanException: Could not load class: au.net.mmsn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl; nested exception is java.lang.NullPointerException Caused by: java.lang.NullPointerException at au.net.mmsn.pfc.servlet.serbices.rfio.impl.FileUtilities.getServicePreference(FileUtilities.java:76) at au.net.mmsn.pfc.servlet.serbices.rfio.impl.RemoteFileImpl.init(RemoteFileImpl.java:29) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
Re: API config of http:conduit
Hi, OK , I got what did you want. I went through the code you showed to me , they should be workable. I found the stack trace said No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http.; It just the conduit initiator finding problem, it may relate to your class path setting. Are you using the spring bundle jar ? If not , do you include the cxf-rt-transports-http-jetty-*.jar in you class path? Willem. Christian Vest Hansen wrote: Ah, this dosn't work. The thing is that sometimes I don't want to load the cxf.xml file. See, the XML file configures HTTPS on a number of endpoints. HTTPS is required to access these endpoints in the production environment (and in staging), however, we don't have HTTPS in the test environmnet. My component (that accesses these endpoints) will know which environment it operates in, and will have to configure HTTPS appropriately at runtime. So, how can I do this? How can I replace the http:conduit element with a set of API calls? 2007/9/5, Christian Vest Hansen [EMAIL PROTECTED]: Thanks! Renaming beans.xml to cxf.xml seams suitable to my situation :) 2007/9/5, Willem Jiang [EMAIL PROTECTED]: Hi, You could name the beans.xml to cxf.xml and put it into the class path. CXF will load it automatically. You could also use -Dcxf.config.file=beans.xml load the configuration file in the class path, or you could use -Dcxf.config.file.url={beans.xml url} to load the configuration file. Another option is you could load the bus with this beans.xml [1] [1]http://www.nabble.com/Setting-the-timeout-on-the-client-side-tf4361130.html#a12429634 Willem. Christian Vest Hansen wrote: Hi, I have a beans.xml file containing: http:conduit name={http://ws.unwire.dk/ldap/MyService/v1}MyService1Staging.http-conduit; http:tlsClientParameters secureSocketProtocol=SSL /http:tlsClientParameters /http:conduit And a little test client that does this in it's main() method: ApplicationContext ac = new ClassPathXmlApplicationContext(beans.xml); MyService1_Service service = new MyService1_Service(); MyService1 my = service.getMyService1Staging(); Client c = ClientProxy.getClient(my); HTTPConduit conduit = (HTTPConduit) c.getConduit(); TLSClientParameters tlsParams = new TLSClientParameters(); conduit.setTlsClientParameters(tlsParams); System.out.println(my.someOperation()); And that works and all is well. However, if I comment the creation of the ApplicationContext out, I get the following error: INFO: Creating Service {http://ws.unwire.dk/ldap/MyService/v1}MyService1 from WSDL: https://staging.unwire.dk/ldapservice/services/MyService1?wsdl Exception in thread main org.apache.cxf.interceptor.Fault: No conduit initiator was found for the namepsace http://schemas.xmlsoap.org/soap/http. at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:89) at org.apache.cxf.endpoint.UpfrontConduitSelector.selectConduit(UpfrontConduitSelector.java:71) at org.apache.cxf.endpoint.ClientImpl.getConduit(ClientImpl.java:413) at dk.unwire.ws.ldap.myservice.v1.MyService1_Service.main(Main.java:95) Caused by: org.apache.cxf.BusException: No conduit initiator was found for the namepsace http://schemas.xmlsoap.org/soap/http. at org.apache.cxf.transport.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:96) at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:70) ... 3 more So, is it possible to perform the same configuration using the API as would otherwise have been done by the ApplicationContext and the http:conduit element? This whole thing is being used in a component intended for other projects to use, so I could simplify my public interface and configuration overhead if I could make all the default configurations built in. -- Venlig hilsen / Kind regards, Christian Vest Hansen.
Re: SOAP 1.2 spring config
Hi, Here is an example for you :) beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xmlns:soap=http://cxf.apache.org/bindings/soap; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; import resource=classpath:META-INF/cxf/cxf.xml/ import resource=classpath:META-INF/cxf/cxf-extension-xml.xml/ import resource=classpath:META-INF/cxf/cxf-extension-soap.xml/ import resource=classpath:META-INF/cxf/cxf-extension-http-jetty.xml/ jaxws:endpoint id=simpleWithBinding implementor=#greeter address=http://localhost:8080/simpleWithAddress; jaxws:binding soap:soapBinding mtomEnabled=true version=1.2/ /jaxws:binding /jaxws:endpoint /beans Willem. Dušan Mamrilla wrote: Hi, I wonder whether it is possible to set SOAP 1.2 binding from spring configuration file. I was searching for this possibility but with no success. I am using jaxws annotation based webservice using jaxws:endpoint spring xml configuration. Thanks in advance, DM
Re: http-conf:conduit - spring config - again ...
Hi Burki, This issue is caused by current CXF bus will not load the configuration when the clients are created from spring configuration. Here is a JIRA[1] for tracing it, currently I provide a walk around method in the JIRA comments. I think it will take some time to really fix it after we do some refactoring work on the configuration part. [1]https://issues.apache.org/jira/browse/CXF-922 Willem. burki wrote: I generated a client for the HelloWorld sample (slightly modified) and am able to set http-conf:conduit parameters just fine. The client is generated from the wsdl below. The http-conf section looks like: http-conf:conduit name={http://websvc.s1.com/}HelloWorldServicePort.http-conduit; http-conf:client Connection=close ConnectionTimeout=3000 ReceiveTimeout=1 ProxyServer=127.0.0.1 ProxyServerPort=/ /http-conf:conduit I'm passing the config to the client on the command line (-Dcxf.config.file=...) everything works like a charm. But the same config loaded into a client developed in code-first approach does nothing for the http-conf section - nana, zilch. The rest of the config, setting interceptors, etc works just fine. The client code is lifted from the sample in the cxf dist: public final class HelloWorldClient { private HelloWorldClient() { } public static void main(String args[]) throws Exception { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {com/s1/wsdemo/hello/apiclient/config/client-beans.xml}); HelloWorld client = (HelloWorld)context.getBean(client); String response = client.sayHi(Dan); System.out.println(Response: + response); System.exit(0); } } client-beans.xml is below. Is there something I'm missing? Am I using a differently named port - or is another call to initialize cxf needed? Thanks a bunch for any pointers! --dan client-beans.xml: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xmlns:http-conf=http://cxf.apache.org/transports/http/configuration; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http-conf:conduit name={http://websvc.s1.com/}HelloWorldServicePort.http-conduit; http-conf:client Connection=close ConnectionTimeout=3000 ReceiveTimeout=1 ProxyServer=127.0.0.1 ProxyServerPort=/ /http-conf:conduit bean id=client class=com.s1.wsdemo.hello.api.HelloWorld factory-bean=clientFactory factory-method=create/ bean id=clientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=com.s1.wsdemo.hello.api.HelloWorld/ property name=address value=http://localhost:8080/HelloWorld-070828/services/HelloWorld/ !-- start turn on logging -- property name=inInterceptors list bean class=org.apache.cxf.interceptor.LoggingInInterceptor/ /list /property property name=outInterceptors list bean class=org.apache.cxf.interceptor.LoggingOutInterceptor/ /list /property property name=outFaultInterceptors list bean class=org.apache.cxf.interceptor.LoggingOutInterceptor/ /list /property !-- end turn on logging -- /bean /beans wsdl: ?xml version=1.0 encoding=utf-8?wsdl:definitions xmlns:ns1=http://websvc.s1.com/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=HelloWorldService targetNamespace=http://websvc.s1.com/; wsdl:types xsd:schema xmlns=http://websvc.s1.com/; attributeFormDefault=unqualified elementFormDefault=qualified targetNamespace=http://websvc.s1.com/; xsd:element name=yourName nillable=true type=xsd:string/ xsd:element name=helloMessage nillable=true type=xsd:string/ /xsd:schema /wsdl:types wsdl:message name=SayHi wsdl:part element=ns1:yourName
Re: jetty configuration help
Hi , yogen, First how can you tell the CXF did not pick up the configuration file ? Can you show me the log for it. If you read the log to get the information, then please check your class path with these two things: 1. Spring* jars are in your class path. Because you use the JAXWS API to publish the endpoint , CXF will get a default bus for you, if the default bus is null and you do not include the spring* jars, CXF will use the ExtesionBusFactory instead of the SpringBusFactory to create a bus. Also if the you already set the default bus, CXF will not create a bus for you and use the already set bus. 2. cxf-jetty-config.xml is in the root directory of you class path. CXF use load the configuration file form class with the spring ClassPathResource class. ClassPathResource cpr = new ClassPathResource(cfgFile); BTW. CXF jetty configuration is base on the port, so if your endpoint publish with other port such as http://localhost:9002/helloworld;, the configuration you set will not take effect. Willem. Yadav, Yogendra (IT) wrote: Hi, I am trying to configure the Jetty thread pool. Looked at this page and started configuring Jetty thread pool. http://cwiki.apache.org/CXF20DOC/jetty-configuration.html I created a config file called cxf-jetty-config.xml. Put this in classpath and started my service with command line arg as -Dcxf.config.file=cxf-jetty-config.xml. CXF doesn't pick-up this file. My service is a JAXWS service and I use Endpoint to publish it using a main() program. The file looks like this: httpj:engine-factory bus=cxf httpj:engine port=9000 httpj:threadingParameters minThreads=5 maxThreads=5 / httpj:connector beans:bean class=org.mortbay.jetty.bio.SocketConnector beans:property name = port value=9000 / /beans:bean /httpj:connector httpj:handlers beans:bean class=org.mortbay.jetty.handler.DefaultHandler/ /httpj:handlers httpj:sessionSupporttrue/hj:sessionSupport /httpj:engine /httpj:engine-factory /beans I tried to rename the file as cxf-extension-xml.xml, it still doesn't pick-up the config. Any help is appreciated. thanx -yogen NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: API config of http:conduit
Hi, You could name the beans.xml to cxf.xml and put it into the class path. CXF will load it automatically. You could also use -Dcxf.config.file=beans.xml load the configuration file in the class path, or you could use -Dcxf.config.file.url={beans.xml url} to load the configuration file. Another option is you could load the bus with this beans.xml [1] [1]http://www.nabble.com/Setting-the-timeout-on-the-client-side-tf4361130.html#a12429634 Willem. Christian Vest Hansen wrote: Hi, I have a beans.xml file containing: http:conduit name={http://ws.unwire.dk/ldap/MyService/v1}MyService1Staging.http-conduit; http:tlsClientParameters secureSocketProtocol=SSL /http:tlsClientParameters /http:conduit And a little test client that does this in it's main() method: ApplicationContext ac = new ClassPathXmlApplicationContext(beans.xml); MyService1_Service service = new MyService1_Service(); MyService1 my = service.getMyService1Staging(); Client c = ClientProxy.getClient(my); HTTPConduit conduit = (HTTPConduit) c.getConduit(); TLSClientParameters tlsParams = new TLSClientParameters(); conduit.setTlsClientParameters(tlsParams); System.out.println(my.someOperation()); And that works and all is well. However, if I comment the creation of the ApplicationContext out, I get the following error: INFO: Creating Service {http://ws.unwire.dk/ldap/MyService/v1}MyService1 from WSDL: https://staging.unwire.dk/ldapservice/services/MyService1?wsdl Exception in thread main org.apache.cxf.interceptor.Fault: No conduit initiator was found for the namepsace http://schemas.xmlsoap.org/soap/http. at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:89) at org.apache.cxf.endpoint.UpfrontConduitSelector.selectConduit(UpfrontConduitSelector.java:71) at org.apache.cxf.endpoint.ClientImpl.getConduit(ClientImpl.java:413) at dk.unwire.ws.ldap.myservice.v1.MyService1_Service.main(Main.java:95) Caused by: org.apache.cxf.BusException: No conduit initiator was found for the namepsace http://schemas.xmlsoap.org/soap/http. at org.apache.cxf.transport.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:96) at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:70) ... 3 more So, is it possible to perform the same configuration using the API as would otherwise have been done by the ApplicationContext and the http:conduit element? This whole thing is being used in a component intended for other projects to use, so I could simplify my public interface and configuration overhead if I could make all the default configurations built in.
Re: Request context ?
Hi , If you are want to look up the user credentials in an interceptor, you could use the below codes public void handleMessage(Message message) throws Fault { AuthorizationPolicy policy = message.getContent(AuthorizationPolicy.class); ... } Willem. Daniel Kulp wrote: On Tuesday 04 September 2007, Chris Campbell wrote: I am using basic-auth with an Interceptor to look up user credentials. However, in my WebService implementations I need to get the result of that lookup. Is there a sanctioned/best way to do this in CXF? Is there some sort of request context that I am missing? Assuming JAX-WS, add: @Resource protected WebServiceContext wsContext; to your impl. The context will get injected into your impl. From there, you should be able to do: MessageContext mc = wsContext.getMessageContext(); mc.get(AuthorizationPolicy.class.getName()); or: mc.get(BindingProvider.USER_NAME); or similar to pull stuff out.
Re: Different wsdl:port
Hi For the Server side If you are using the JAXS API , you can Endpoint.publish() the service with different address. Object implementor1 = new AnonymousComplexTypeImpl(); String address = http://localhost:9000/anonymous_complex_typeSOAP;; Endpoint.publish(address, implementor1); If you are using the JaxwsServerFactoryBean to create the server, you can set the endpoint address whit JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean(); svrFactory.setServiceClass(HelloWorld.class); // set the service publish address svrFactory.setAddress(http://localhost:9000/Hello;); svrFactory.setServiceBean(helloWorldImpl); svrFactory.create(); For the Client side: You can take a look at the related discussion in nabble [1] [1]http://www.nabble.com/Client-question-tf4357978.html#a12419843 Willem. jackal1100 wrote: Hi to all, I need to have a great number of clients pointing to some servers. The wsdl is the same for all services , except for the wsdl:port.../wsdl:port. The configuration of the clients/servers is stored in the database. Is possible to set a runtime the wsdl:port contents ? Otherwise how is possible to have a flexible configuration ( except the case of to have multiple wsdl files ) ? thanks a lot -- Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind http://i-mode.wind.it/
Re: Setting the timeout on the client side
Hi CXF will load the cxf.xml as the default configuration file from the class path. If your configuration file's name is services.xml you need to specify it with java command line option -Dcxf.config.file=some_other_config.xml or load the configuration file with SpringBusFactory first. Here are the code snap Bus bus = new SpringBusFactory().createBus(configFileURL, true)); BusFactory.setDefaultBus(bus); BusFactory.setThreadDefaultBus(bus); You can also find some useful information from CXF wiki [1], I also write a doc about CXF bus[1] , but it is chinese , you may use google translate to read about it[3]. [1]http://cwiki.apache.org/CXF20DOC/configuration.html [2]http://willem.bokeland.com/blog/794/6089/2007/06/24/207642 [3]http://www.google.com/translate?u=http%3A%2F%2Fwillem.bokeland.com%2Fblog%2F794%2F6089%2F2007%2F06%2F24%2F207642langpair=zh%7Cenhl=enie=UTF8 Willem. Verachten Bruno wrote: Hi, Please take a look at the CXF 2.0 user doc :) http://cwiki.apache.org/CXF20DOC/client-http-transport.html Sorry, I have read this doc and didn't see this info. :-/ If you want all the http-conduit with same client policy, you could specify the conduit name like this, http-conf:conduit name=*.http-conduit ... I put http-conf:conduit name=*.http-conduit http-conf:client Connection=Keep-Alive MaxRetransmits=3 ConnectionTimeout=6 ReceiveTimeout=6 AllowChunking=true / /http-conf:conduit in services.xml, which is located in a directory referenced in the classpath. I still have errors with the sending of big messages; I got an error 32s after the beginning of the call. I'm sure I missed something. Is the services.xml read by the client? Thanks, Bruno Verachten
Re: [U] RE: No Service found
Hi Frankie, It just looks like there is no observer of http://localhost/website2/ws/HelloWorld;, No I can't figure out the reason of this issue, the configuration is right. Please check the below things: 1. Does your war name be website2.war ? 2. Can you tell the version number of the CXF that you used? I 3. How do you publish the service? Did you just do like the wiki said? Willem. FrankieHuang wrote: Hi Willem, I got the No service was found. at url http://localhost/website2/ws/HelloWorld/services; and http://localhost/website2/ws/services;. and I try to access this service via a client code, I got a Fault: --- org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:206) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:253) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:204) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at org.apache.cxf.frontend.ClientProxy.invoke(ClientProxy.java:68) at $Proxy14.sayHi(Unknown Source) at test.ws.ClientTest.testSayHiWithSpringConfig(ClientTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.io.IOException: Not Found at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1781) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1698) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 29 more --- and server side tomcat console a warnning: 2007-8-31 14:02:23 org.apache.cxf.transport.servlet.ServletController invoke WARN: Can't find the the request for http://localhost/website2/ws/HelloWorld's Observer My client test code: package test.ws; import static org.junit.Assert.assertEquals; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.hiany.accounts.ws.HelloWorld; public final class ClientTest { private static ClassPathXmlApplicationContext context; @BeforeClass public static void beforeClass() { context = new ClassPathXmlApplicationContext(
Re: [U] RE: No Service found
OK, The exception was thrown from the jaxb, so please check the JAXB jars in you class path. Are you using JDK 1.6 ? Current CXF just use JAXB 2.0.5. BTW Please try CXF 2.0.1 or the latest snap shot , there are lots of bug fixings beyond the CXF 2.0. Willem. FrankieHuang wrote: Hi Willem, 1. My war name is website2.war; 2. My CXF version is 2.0-incubator. I use maven2 as my build tool. 3. I just following the Writing a service with Spring in How-Tos, wrote service code, declared service bean in beans.xml and wrote CXFServlet and let it load-on-startup at web.xml. And then put the war file to Tomcat 6.0's webapps. I found an Severe error in localhost.2007-08-31.log of tomcat: - Severe: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CollectiveServices': 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.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:269) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:220) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:248) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:136) at org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:83) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:89) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:142) at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:277) at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:223) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:175) at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:329) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1160) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1122) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1085) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:308) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:252) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:221) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:115) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4044) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
Re: Null Pointer in WSDLServiceFactory
Hi , It looks like the WSDLServiceFactory can 't get the WSDLManager from the bus when you try to create a service model for the client. public WSDLServiceFactory(Bus b, String url, QName sn) { setBus(b); try { // use wsdl manager to parse wsdl or get cached definition definition = getBus().getExtension(WSDLManager.class).getDefinition(url); // The NPE is thrown form here } catch (WSDLException ex) { throw new ServiceConstructionException(new Message(SERVICE_CREATION_MSG, LOG), ex); } serviceName = sn; } It could be your WSDLManager does not be set to the bus. Can you tell me how did you initialize the bus? Did you use the spring configuration or load the bus by other means? Maybe you can set the log level to INFO for more information. Willem. green804 wrote: I have this code working in my development environment, but when I employ to our test environment I'm getting a null pointer. I'm not sure why this is happening. Can someone give me any pointers? I'm really desperate to find a solution. java.lang.NullPointerException at org.apache.cxf.wsdl11.WSDLServiceFactory.init(WSDLServiceFactory.java:81) at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:112) at org.apache.cxf.jaxws.ServiceImpl.init(ServiceImpl.java:104) at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:55) at javax.xml.ws.Service.init(Service.java:57) at com.mysite.services.news.NewsService.init(NewsService.java:41) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) From code: @WebServiceClient(name = NewsService, targetNamespace = http://services.mysite.com/News;, wsdlLocation = http://mysite.com/services/NewsService.svc?wsdl;) public class NewsService extends Service { private final static URL WSDL_LOCATION; private final static QName SERVICE = new QName(http://services.mysite.com/News;, NewsService); private final static QName BasicHttpBinding = new QName(http://services.mysite.com/News;, basicHttpBinding); static { URL url = null; try { url = new URL(http://mysite.com/services/NewsService.svc?wsdl;); } catch (MalformedURLException e) { System.err.println(Can not initialize the default wsdl from http://mysite.com/services/NewsService.svc?wsdl;); // e.printStackTrace(); } WSDL_LOCATION = url; } public NewsService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } public NewsService() { super(WSDL_LOCATION, SERVICE); } /** * * @return * returns BasicHttpBinding */ @WebEndpoint(name = basicHttpBinding) public NewsServiceContract getBasicHttpBinding() { return (NewsServiceContract)super.getPort(BasicHttpBinding, NewsServiceContract.class); }
Re: Obtaining source address and operation name
Hi , I just answer the get source(IP) address question, because Jervis has showed your the code how to get the wsdl operation. You can get the client request object from the message context. Then you can get the client address from the request. Here are the code snaps HttpServletRequest request = (HttpServletRequest)message.get(AbstractHTTPDestination.HTTP_REQUEST); if (null != request) { String clientAddress = request.getRemoteAddr(); } Cheers, Willem. James Royalty wrote: Hi, I'm trying to write an in interceptor, using org.apache.cxf.interceptor.LoggingInInterceptor as a starting point. I'm trying to log - the source (IP) address that originate the (SOAP) Message; - the SOAP operation that was invoked. Any hints on how I can obtain either of these? I've tried adding the interceptor at various phases (RECEIVE, PRE_INVOKE, INVOKE) and getting several values from the Messsage: WSDL_OPERATION, WSDL_PORT, WSDL_SERVICE, INVOCATION_CONTEXT, ENDPOINT_ADDRESS. All these end up being null. Thanks!
Re: Client question
Hi, If you use JAXWS API , you can using the add port to add the other port for your client to access. URL wsdlURL = MyService.class.getClassLoader.getResource(service2.wsdl); QName serviceName = new QName(urn:service2, MyService); QName portName = new QName(urn:service2, ServicePort); MyService service = new MyService(wsdlURL, serviceName); service.addPort(portName, http://schemas.xmlsoap.org/soap/;, https://localhost/sdk/myService;); // pass the SEI class that is generated by wsdl2java ServicePort proxy = service.getPort(portName, SEI.class); If you use CXF API , you could set the endpoint address directly to the ClientProxyFactoryBean. BTW, if you want to access the service by using https protocol, you need to do some configuration on the client side. You can find more information from this url [1] [1]http://www.nabble.com/Generated-client-to-connect-to-a-https-ws-tf4061903.html Willem. Joe Sunday wrote: Sorry if this one is easy, but I can't seem to find it... I've got an interface I generated from a local wsdl, and the wsdl files are both available on my classpath: definitions targetNamespace=urn:myService xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:interface=urn:service2 import location=service2.wsdl namespace=urn:service2 / service name=MyService port binding=interface:ServiceBinding name=ServicePort soap:address location=https://localhost/sdk/myService; / How do I create a client for this wsdl against a random url? The binding classes seem to only accept the urn and address specified in the wsdl, which doesn't work if the url I actually want to talk to isn't localhost/sdk/myService URL wsdlURL = MyService.class.getClassLoader.getResource(myService.wsdl); QName serviceName = new QName(urn:myService, MyService); MyService service = new MyService(wsdlURL, serviceName); ServicePort client = service.getServicePort(); I don't see a generated ServiceLocator in the classes wsdl2java generated anywhere. --Joe
Re: [U] RE: No Service found
Hi Frankie Current CXF does not support to get the service list with the ?serviceList, I think you can get the service list with this url http://localhost/website2/ws/HelloWorld/services Willem. FrankieHuang wrote: Hi Willem2, I got the similar question, but can not resolve it accordding at the answer above. I saw the info in Tomcat 6.0 console: 2007-8-31 12:10:32 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass Info: Creating Service {http://ws.accounts.hiany.com/}HelloWorldImplService from class com.hiany.accounts.ws.HelloWorldImpl But when I open browser at http://localhost/website2/ws/?serviceList;, I got a No service was found. I wrote a interface HelloWorld.java and a class HelloWorldImpl.java. And my cxf-servlet.xml = beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; !-- Web Service -- 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 / !-- bean id=jaxWsServiceFactoryBean class=org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean property name=wrapped value=true / property name=dataBinding ref=aegisBean / /bean bean id=aegisBean class=org.apache.cxf.aegis.databinding.AegisDatabinding / -- jaxws:endpoint id=CollectiveServices implementor=com.hiany.accounts.ws.HelloWorldImpl address=/HelloWorld /jaxws:endpoint /beans === my web.xml: === ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd; version=2.5 .. servlet servlet-nameCXFServlet/servlet-name servlet-class org.apache.cxf.transport.servlet.CXFServlet /servlet-class load-on-startup1/load-on-startup /servlet ... servlet-mapping servlet-nameCXFServlet/servlet-name url-pattern/ws/*/url-pattern /servlet-mapping ... /web-app Thanks!
Re: Controlling http transport threads in CXF
Hi, If you use the jetty http transport, jetty will use BoundedThreadPool as the default thread pool. If you want to take control of the Jetty's thread number, here is a doc for it. [1] http://cwiki.apache.org/CXF20DOC/jetty-configuration.html Willem Yadav, Yogendra (IT) wrote: Hi, I am using CXF dist out of the box. I have not specified any cxf.xml config file of my own. I am using CXF's http transport which is Jetty by default. I understand that jetty is configured because of this extension present in META-INF cxf-extension-http-jetty.xml. I want to control the number of transport threads, I think they are defaulted to 10. thanx -yogen NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: Executor thread pool not utilized by JAXWS SEI
Hi Yogen, If you take a look at the code (ServiceInvokerInterceptor) , CXF just use the JAXWS specified executor when it dispatch the call to the implementor object. And the most of the works ( marshaling/ unmarshaling the messages by the intercepter chain) are done in the transport thread. So if you debug the code, you will find the the Jetty transport thread most time. But when you set the break point in the implementor method and run into it, you will get to see the ThreadPool which you set to the endpoint. Willem. Yadav, Yogendra (IT) wrote: Hi, I have configured / published the POJO service endpoint class using JAXWS Endpoint API. I am providing executor thread pool to the Endpoint. I don't see the executor thread pool being used by runtime. All I see is Jetty transport threads in debugger in EclipseIDE. POJOClass c = new POJOClass(); String address = http://localhost:9000/POJOService;; ep = Endpoint.create( c ); ExecutorService es = Executors.newFixedThreadPool( 4 ); ep.setExecutor( es ); ep.publish( address ); What am I missing here ? -yogen NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: SOAP Attachment question/problem
Hi, You can take a look of the below two documents. [1] http://cwiki.apache.org/CXF20DOC/mtom.html [2]http://cwiki.apache.org/CXF20DOC/mtom-attachments.html And you can find the simple MTOM from CXF bin distribution . Willem. Pawel Janusz wrote: Hello, I'm starting using CXF to use them as WebService. I cannot find anywhere example on how to add SOAP attachment in service class. Could anyone help me ? Some example code will be very helpful.
Re: CXF and Jetty - Class not found exception
Hi I found your fault , you misspelling the CXFServlet by CFXServlet. Your web.xml should be !-- CXF Web Services -- servlet servlet-nameCXFServlet/servlet-name servlet-classorg.apache.cxf.transport.servlet.CXFServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameCXFServlet/servlet-name url-pattern/services/*/url-pattern /servlet-mapping Willem. green804 wrote: I am migrating from xfire to to cxf. I am using jetty and spring. When I try to start up my application, I'm getting the following error message. FATAL 2007-08-22 08:17:39,301 [main] - testapp.TestApplication - Could not start the Jetty server: org.mortbay.util.MultiException[java.lang.ClassNotFoundException: org.apache.cxf.transport.servlet.CFXServlet] This is the mapping in my web.xml file. !-- CFX Web Services -- servlet servlet-nameCFXServlet/servlet-name servlet-classorg.apache.cxf.transport.servlet.CFXServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameCFXServlet/servlet-name url-pattern/services/*/url-pattern /servlet-mapping This is where the problem is. If I remove this, the application starts up fine. I've made sure that this jar is in my classpath. Does any have any other options for me? I need to get this up and running this morning.
Re: Why the HTTPS hassle
Hi Please see my comment in the mail. Fred Dushin wrote: On Aug 20, 2007, at 6:15 AM, Christian Vest Hansen wrote: Hi, I don't get why I must do all this configuration of cxf in order to make it access external web services over HTTPS when my web browser is able to access web sites over HTTPS so easily. Can someone explain this? I'm not sure what you mean here. CXF is a piece of infrastructure. It can't really make the same assumptions that a Web browser -- an end-user piece of software -- can. In particular, CXF gives you the ability to make fine-grained trust decisions that web browsers aren't really capable of -- mostly because of the trust model they are based on. Besides, if I must provide all sorts of configurations in a http:conduit element in my beans.xml, then isn't there a way to make this configuration apply to more than one service/port pair? That's certainly a valid question, and one for which I don't think there is a real answer, currently. All configuration for SSL is done at endpoint granularity. Feel free to raise an enhancement request, though. Current CXF configuration supports configuring with wild card , eg. http:conduit name=*.http-conduit . /http:conduit CXF will apply the upper configuration to all HttpConduit class instance. -- Venlig hilsen / Kind regards, Christian Vest Hansen. Willem.
Re: enable MTOM client
Hi, You can take [1]'s inlineSoapBinding bean as a example to configure the MTOM on the client side. [1]https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml Willem. nuka wrote: I didn't configure MTOM on the client side. The only configuration I've made is - jaxws endpoint configuration for MTOM (beans.xml) - MIMEType annotation application/octet-stream for the binary data I don't know how to configure the client via xml (or by code). I use jaxws as frontend. I saw that the client can be configured by xml (in the beans.xml file ) but I don't know how. I would appreciate if you can show me a sample. thanks in advance Nuka Dan Diephouse wrote: What does your client code look like? You probably aren't configuring MTOM right on the client side. Cheers, - Dan On 8/20/07, nuka [EMAIL PROTECTED] wrote: Hello, I have some problems when enabling MTOM for CXF generated client. I've made the configuration for MTOM as suggested in the user guide for both client and server side. - jaxws endpoint configuration for MTOM (beans.xml) - MIMEType annotation application/octet-stream for the binary data The server is ok, its responses support MTOM. But the client requests are not MTOM based. The binary data is embedded in the SOAP body. I believe I've missed something on the client side configuration but I don't know what. Thanks in advance Nuka -- View this message in context: http://www.nabble.com/enable-MTOM-client-tf4300910.html#a12242043 Sent from the cxf-user mailing list archive at Nabble.com. -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
Re: CXF client applet ServiceConstructionException
Hi It looks like the Service Name is not a right one from the exception's message. Please check the Service QName with the wsdl which you get from the http://192.168.98.46:8080/pfc/services/PfC?wsdl Willem. doug wrote: Hi, I think I have my server set up ok because if I visit this page: http://192.168.98.46:8080/pfc/services/ I get a list of the services I implemented: {http://impl.chat.serbices.servlet.pfc.mmsn.net.au/}ChatServiceImplPort {http://impl.rfio.serbices.servlet.pfc.mmsn.net.au/}RemoteFileImplPort {http://impl.imageshare.serbices.servlet.pfc.mmsn.net.au/}ImShServiceImplPort {http://impl.rfio.serbices.servlet.pfc.mmsn.net.au/}RemoteFileSystemImplPort {http://impl.rfio.serbices.servlet.pfc.mmsn.net.au/}RemoteFileIOImplPort {http://impl.serbices.servlet.pfc.mmsn.net.au/}PfCServicesImplPort The last one is a link to http://192.168.98.46:8080/pfc/services/PfC?wsdl and serves up the appropriate wsdl description of the PfC interface. The problem is that when I try to get a handle on the PfC interface from within my client applet, I end up with the error: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {urn:srv}PfCService. I used the following client side code (both the client and server side service code were generated from wsdl2java): serviceAddress = http://; + (String)configOpts.get(hostName) + : + (String)configOpts.get(port) + serviceURI +?wsdl; // i.e. http://192.168.98.46:8080/pfc/services/PfC?wsdl URL url = new URL(serviceAddress); QName SERVICE = new QName(urn:srv, PfCService); PfCService service = new PfCService(url, SERVICE ); PfC pfc = service.getPfC(); Sorry, I am new to all this, so likely I am doing something foolish. Hope this is enough to work from. Thanks for any insights Doug
Re: CXF client applet ServiceConstructionException
The Service QName should be QName SERVICE = new QName(http://impl.serbices.servlet.pfc.mmsn.net.au/ , PfCServicesImplService); Willem. doug wrote: I get the following WSDL, but I am not sure exactly what the Service QName should be trying to match. Thanks Doug wsdl:definitions name=PfCServicesImplService targetNamespace=http://impl.serbices.servlet.pfc.mmsn.net.au/; wsdl:import location=http://192.168.98.46:8080/pfc/services/PfC?wsdl=PfC.wsdl; namespace=urn:srv/ wsdl:binding name=PfCServicesImplServiceSoapBinding type=ns1:PfC soap:binding style=document transport=http://schemas.xmlsoap.org/soap/http/ wsdl:operation name=getApplicationPushletIDs soap:operation soapAction= style=document/ [snip] /wsdl:binding wsdl:service name=PfCServicesImplService wsdl:port binding=ns2:PfCServicesImplServiceSoapBinding name=PfCServicesImplPort soap:address location=http://192.168.98.46:8080/pfc/services/PfC/ /wsdl:port /wsdl:service /wsdl:definitions On Wednesday 22 August 2007 13:10, Willem Jiang wrote: Hi It looks like the Service Name is not a right one from the exception's message. Please check the Service QName with the wsdl which you get from the http://192.168.98.46:8080/pfc/services/PfC?wsdl Willem. doug wrote: Hi, I think I have my server set up ok because if I visit this page: http://192.168.98.46:8080/pfc/services/ I get a list of the services I implemented: {http://impl.chat.serbices.servlet.pfc.mmsn.net.au/}ChatServiceImplPort {http://impl.rfio.serbices.servlet.pfc.mmsn.net.au/}RemoteFileImplPort {http://impl.imageshare.serbices.servlet.pfc.mmsn.net.au/}ImShServiceImpl Port {http://impl.rfio.serbices.servlet.pfc.mmsn.net.au/}RemoteFileSystemImplP ort {http://impl.rfio.serbices.servlet.pfc.mmsn.net.au/}RemoteFileIOImplPort {http://impl.serbices.servlet.pfc.mmsn.net.au/}PfCServicesImplPort The last one is a link to http://192.168.98.46:8080/pfc/services/PfC?wsdl and serves up the appropriate wsdl description of the PfC interface. The problem is that when I try to get a handle on the PfC interface from within my client applet, I end up with the error: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {urn:srv}PfCService. I used the following client side code (both the client and server side service code were generated from wsdl2java): serviceAddress = http://; + (String)configOpts.get(hostName) + : + (String)configOpts.get(port) + serviceURI +?wsdl; // i.e. http://192.168.98.46:8080/pfc/services/PfC?wsdl URL url = new URL(serviceAddress); QName SERVICE = new QName(urn:srv, PfCService); PfCService service = new PfCService(url, SERVICE ); PfC pfc = service.getPfC(); Sorry, I am new to all this, so likely I am doing something foolish. Hope this is enough to work from. Thanks for any insights Doug
Re: HTTPS Server
Hi, The conduit name should be the port's Qname + .http-conduit http:conduit name={http://client.webservice.crm.ecot.com/ws/student}StudentService.http-conduit; In your configuration, it looks like the http:conduit's name attribute is set to be the service's Qname + .http-conduit Willem. Julio Arias wrote: Hi - I have the following example spring config file: But still getting the same error, do I'm missing something?? ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:sec=http://cxf.apache.org/configuration/security; xmlns:http=http://cxf.apache.org/transports/http/configuration; xmlns:jaxws=http://java.sun.com/xml/ns/jaxws; xsi:schemaLocation= http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd; bean id=studentWebServiceClient class=com.ecot.crm.webservice.client.ws.student.StudentService factory-bean=studentWebServiceClientFactory factory-method=create/ bean id=studentWebServiceClientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=com.ecot.crm.webservice.client.ws.student.StudentService/ property name=address value=${webservices.url}/StudentService/ /bean bean id=userWebServiceClient class=com.ecot.crm.webservice.client.ws.user.UserService factory-bean=userWebServiceClientFactory factory-method=create/ bean id=userWebServiceClientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=com.ecot.crm.webservice.client.ws.user.UserService/ property name=address value=${webservices.url}/UserService/ /bean bean id=teacherWebServiceClient class=com.ecot.crm.webservice.client.ws.teacher.TeacherService factory-bean=teacherWebServiceClientFactory factory-method=create/ bean id=teacherWebServiceClientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=com.ecot.crm.webservice.client.ws.teacher.TeacherService/ property name=address value=${webservices.url}/TeacherService/ /bean http:conduit name={http://client.webservice.crm.ecot.com/ws/teacher}TeacherService.http-conduit; http:tlsClientParameters sec:trustManagers sec:keyStore type=JKS password=password file=/home/jperez/IdeaProjects/crm/certs/truststore.jks/ /sec:trustManagers sec:keyManagers keyPassword=password sec:keyStore type=JKS password=password file=/home/jperez/IdeaProjects/crm/certs/wibble.jks/ /sec:keyManagers sec:cipherSuitesFilter sec:include.*_EXPORT_.*/sec:include sec:include.*_EXPORT1024_.*/sec:include sec:include.*_WITH_DES_.*/sec:include sec:include.*_WITH_NULL_.*/sec:include sec:exclude.*_DH_anon_.*/sec:exclude /sec:cipherSuitesFilter /http:tlsClientParameters /http:conduit http:conduit name={http://client.webservice.crm.ecot.com/ws/user}UserService.http-conduit; http:tlsClientParameters sec:trustManagers sec:keyStore type=JKS password=password file=/home/jperez/IdeaProjects/crm/certs/truststore.jks/ /sec:trustManagers sec:keyManagers keyPassword=password sec:keyStore type=JKS password=password file=/home/jperez/IdeaProjects/crm/certs/wibble.jks/ /sec:keyManagers sec:cipherSuitesFilter sec:include.*_EXPORT_.*/sec:include sec:include.*_EXPORT1024_.*/sec:include sec:include.*_WITH_DES_.*/sec:include sec:include.*_WITH_NULL_.*/sec:include sec:exclude.*_DH_anon_.*/sec:exclude /sec:cipherSuitesFilter /http:tlsClientParameters /http:conduit http:conduit name={http://client.webservice.crm.ecot.com/ws/student}StudentService.http-conduit; http:tlsClientParameters sec:trustManagers sec:keyStore type=JKS password=password file=/home/jperez/IdeaProjects/crm/certs/truststore.jks/ /sec:trustManagers sec:keyManagers keyPassword=password sec:keyStore type=JKS password=password file=/home/jperez/IdeaProjects/crm/certs/wibble.jks/ /sec:keyManagers sec:cipherSuitesFilter sec:include.*_EXPORT_.*/sec:include sec:include.*_EXPORT1024_.*/sec:include sec:include.*_WITH_DES_.*/sec:include sec:include.*_WITH_NULL_.*/sec:include sec:exclude.*_DH_anon_.*/sec:exclude /sec:cipherSuitesFilter
Re: wsdl2java versus ?wsdl URL processing
Hi Benson, Please see the comments in the mail. Benson Margulies wrote: I've just used wsdl2java in CXF for the first time. My goal here is to migrate an existing service from a C++ web service toolkit to CXF. While I'm starting with an existing WSDL, from here I'd like to treat the generated JAXB/JAX-WS code as normative. So, I'd like to ensure that the usual ?wsdl URL behaves itself via the usual mechanism. Question 1: If I just change the generated @javax.jws.WebService to take out the wsdl location option, will the default collapse to the standard ?wsdl location? If you specify the wsdl location in the WebService annotation , CXF will load the wsdl to build up the service model. If you do not specify the wsdl location in the WebService annotation. CXF will build the service model from Java class (SEI). And CXF's ?wsdl function is based on the service model to wsdl file. If we can make sure the service models which we build from the wsdl and which we build from the java class are same to each other, there should be no difference whether you set the wsdl location in the WebService annotation or not. In most case , I can say it is true in CXF and I prefer the wsdl first approach if you are jump between C++ and Java. Question 2: Does CXF has a side-door so that I can put a WSDL file on classpath and have its contents served up as the response to ?wsdl? Obviously, if I avail myself of this, I'm continuing to treat the wsdl as normative, but I'm avoiding having to make my own arrangements to serve it up. As I had said , we just do not support to response the ?wsdl with your specified wsdl file now. But we have a JIRA [1]task for it . Maybe you can monitor it to see if it is ready to use. [1] https://issues.apache.org/jira/browse/CXF-341 Willem.
Re: SV: Multiple JMS services
Hi , It looks like you don't want the implicit headers pass into the paramArray. I am not sure what you want to deal with the soap header. If you do not want the header info pass to the invoker, you can add a customer interceptor into you endpoint to remove the list parameter content which is set by SoapHeaderInterceptor. BTW, If you want to solve the problem quickly and effectively , my suggestion is you send the mail to the mail-list. There are lots of warm hearted people will give you their hands and they can also learn from your question. Willem. Morten Andersen wrote: Hi Thanks for you quick response. I have followed your guide and for now that part seems to work :o) The next problem I ran into was about the method invocation and I'm not sure it is relative to the thread. I'm using implicit headers and I can see that when org.apache.cxf.service.invoker.AbstractInvoker performInvocation(exchange, serviceObject, m, paramArray) is called, it expect that the implicit header is given to the method. I have used org.apache.cxf.tools.wsdlto.WSDLToJava to generate my classes with argument -fe jaxws. The wsdl looks like this: message name=oneRequest part name=body element=tls:.../ /message message name=oneRequestHeader part name=header element=header:.../ /message message name=oneResponse part name=body element=tls:.../ /message portType name=OnePort operation name=saySomething input message=tns:oneRequest / output message=tns:oneResponse/ /operation /portType binding name=OnePortBinding type=tns:OnePort soap:binding transport=http://www.openuri.org/2002/04/soap/jms/; style=document/ operation name=saySomething input soap:body parts=body use=literal/ soap:header message=tns:oneHeader part=header use=literal / /input output soap:body parts=body use=literal/ /output /operation /binding And the Port class I got out of that look like this: @WebService(name = OnePort, targetNamespace = ...) @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) public interface OnePort { @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @WebMethod(operationName = saySomething) @WebResult(partName = body, name = OneResponse, targetNamespace = ...) public OneResponse saySomething( @WebParam(partName = body, name = OneRequest, targetNamespace = ...) java.lang.String body ); } A solution right now for me, is to remove unwanted information from the paramArray (given in the performInvocation) - but that is not a solution in the real world. Have I missed something? Or do you need more information? -Oprindelig meddelelse- Fra: Willem Jiang [mailto:[EMAIL PROTECTED] Sendt: 8. august 2007 08:56 Til: Morten Andersen; cxf-user@incubator.apache.org Emne: Re: Multiple JMS services Hi , I just went through the code, and so did some experiments. JMS's EndpointInfo is not just came from the Endpoint.publish(address, implementor);'s address, the jms transportation related info are all come from wsdl extensions. So when you use the EndpointImpl endpoint1 = Endpoint.publish(address, implementor1); EndpointImpl endpoint2 = Endpoint.publish(address, implementor2); just like the https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/j ava/org/apache/cxf/systest/versioning/Server.java will take no effector , and you just get the ChainInitiationObserver from the endpoint2 server's destination. My suggestion is you need to do some hack work here. 1. create MultipleEndpointObserver yourself , you can find the sample code from the SoapBindFactory's addListener(Destination d, Endpoint e). MultipleEndpointObserver newMO; MultipleEndpointObserver newMO = new MultipleEndpointObserver(getBus()) { @Override protected Message createMessage(Message message) { return new SoapMessage(message); } }; newMO.getBindingInterceptors().add(new AttachmentInInterceptor()); newMO.getBindingInterceptors().add(new StaxInInterceptor()); // This will not work if we one of the endpoints disables message // processing. But, if you've disabled message processing, you // probably aren't going to use this feature. newMO.getBindingInterceptors().add(new ReadHeadersInterceptor(getBus())); // Add in a default selection interceptor newMO.getRoutingInterceptors().add(new EndpointSelectionInterceptor()); 2. add the first two jms endpoint to the MultipleEndpointObserver's endpoint set. newMO.getEndpoints().add(endpoint1.getServer().getEndpoint()); newMO.getEndpoints().add(endpoint2.getServer().getEndpoint()); 3. Choice one of the jms endpoint's destination ( which you want request and response queue), replace the destination's observer with your
Re: JRAStrategry work incorrectly?
Hi Kevin, I think you just make sure the service class which you passed to the JaxWsserviceFactoryBean get the right jra annotation. That can address your concern :) Willem. kevin.shen wrote: if i write the jra annotations in interface , and JaxWsserviceFactoryBean use implementor to get annotations' meta data, it can not recognize the method correctly. if i write the the jra annotation in implementor, and JaxWsServerFactorybean use interface to get annotations' meta data, it can not recognize the method correctly too. so i need to write jra annotations in both interface and implementor, but it is so ugly. who can tell me the correct way to write the jra annotations? Thanks very much.
Re: Dynamically starting server
Hi Michelle If you do not pass the wsdl location to CXF when you start up the service, CXF will try to build a service model form the service class. You can find more information about the service model from this URL [1]. I have no idea about your last question's automatic way. Can you elaborate it ? [1]http://cwiki.apache.org/CXF20DOC/cxf-architecture.html#CXFArchitecture-TheServiceModel Willem. Mdavis wrote: Hello. Hopefully this is a simple, easy question. I would like to at startup determine where my server runs using the CXF container. This means that I would like to pass in the SOAP URL location instead of picking it up from WSDL or annotations. If I use the endpoint.publish method with a address, the documentation states that this overrrides the annotations. Is this the preferred way to do such? What happens if you do not pass the WSDL when you start up the service? What does this internally do? Also, is there a way to automatically start a service upon demand? Thank you. Michelle
Re: problems using axis1 webservices
Hi Julian , Current CXF not support the rpc encoded message mode. Willem. Julian Kölle wrote: Sorry, this did not help. Of course I was using an URL. the the-client.wsdl was just a placeholder. If you want to try here are some WSDL's I tried and that result in Exceptions with CXF DynamicClientFactory: http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/eutils_lite.wsdl http://xml.nig.ac.jp/wsdl/DDBJ.wsdl do these WSDLs work for your??? I always get excpetions, maybe because they are rpc encoded? Original-Nachricht Datum: Thu, 9 Aug 2007 14:46:08 +0530 Von: Velidanda Srinivas [EMAIL PROTECTED] An: cxf-user@incubator.apache.org Betreff: RE: problems using axis1 webservices I think it requires wsdl URL, instead of file name. Try with URL and see, if it works. -Original Message- From: Julian Kölle [mailto:[EMAIL PROTECTED] Sent: 09 August 2007 14:45 To: cxf-user@incubator.apache.org Subject: problems using axis1 webservices Hi, I tried to write a client for an axis1 based webservice. I tried to do this with the DynamicClientFactory, however when I try to get a client with: Client client = dcf.createClient(the-service.wsdl); == I get excpetions for all WSDL files I tried. Is it impossible to use rpc encoded webservices with DynamicClientFactory or CXF at all? Ah, and when do I need to specify a classLoader in the createClient()? can't i handle the results as Object class myself and cast it to something? best regards Ali -- Pt! Schon vom neuen GMX MultiMessenger gehört? Der kanns mit allen: http://www.gmx.net/de/go/multimessenger __ __ This e-mail has been scanned for all viruses by MessageLabs. __ __ This e-mail has been scanned for all viruses by MessageLabs. To learn more about Singularity's business process management solutions and services please visit: www.singularity.co.uk www.singularity.us.com Singularity operates globally through its offices in New York, London, Singapore, Ireland and India. Singularity Limited is incorporated in the United Kingdom with Registration Number NI 31519 and its Registered Office at 100 Patrick Street, Derry, BT48 7EL, United Kingdom.
Re: how to configure cxf for jms with spring
Hi , I am afraid you still need to pass the wsdl to the service factory bean. Because current CXF JMS transport just get the JMS address information from the WSDL extension. Willem. mule1 wrote: Hello, I am new to cxf and have creating web service using simple:server configuration exposing my service bean. Now, I want to expose another service bean using jms and spring configuration. Is there a sample I can use to expose my service for jms without using wsdl file? thanks.
Re: using HTTP firewall proxy with CXF Spring config
Hi Mark, The value for the name attribute takes the form /portQName/.http-conduit. So in your case , http-conf:conduit name={http://spring.demo/}HelloWorldImplPort.http-conduit; Willem. mark.boyd wrote: Willem, I still can't get it to use a proxy. I've spent the last two hours attempting to dig into the spring schema extensions that implement the http-config:client tag to understand what it is doing and see if there was some other way to accomplish this. But the org.apache.cxf.transports.http.configuration.HTTPClientPolicy.java file referenced by the org.apache.cxf.transport.http.spring.HttpConduitBeanDefinitionParser isn't found in the source distribution of either the zipped version or the tar/gz version. So that was a dead end. Are those out of date? I suppose I'll have to check out from svn some time to be more up to date. So here are the bean definitions in my clientBeans.xml file followed by what I believe are the key pieces from the WSDL served up from the service from which I obtained what I believe I should be placing in the http-config:client's name attribute based upon the documentation and your suggestions. But when I run the client code the proxy on my local host is not getting hit and the call to the service is working just fine. So it isn't using the proxy. bean id=client class=demo.spring.HelloWorld factory-bean=clientFactory factory-method=create/ bean id=clientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=demo.spring.HelloWorld/ property name=address value=http://localhost:8080/cxfs/ws/HelloWorld/ /bean http-conf:conduit name={http://spring.demo/}HelloWorldImplService.http-conduit; http-conf:client Connection=Keep-Alive ProxyServer=localhost ProxyServerPort= AllowChunking=false / /http-conf:conduit And the core pieces from the WSDL are: ?xml version=1.0 encoding=utf-8? wsdl:definitions xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:ns1=http://spring.demo/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; name=HelloWorldImplService targetNamespace=http://spring.demo/; wsdl:types ... wsdl:service name=HelloWorldImplService wsdl:port binding=ns1:HelloWorldImplServiceSoapBinding name=HelloWorldImplPort soap:address location=http://localhost:8080/cxfs/ws/HelloWorld/ /wsdl:port /wsdl:service So where am I messing up? Thanks. Mark Willem Jiang-2 wrote: Hi Mark, It's my fault that I did not found the user doc was out of time. I will fix it right now. Please change the http-conf:conduit id={http://spring.demo/}HelloWorldImplService.http-conduit; http-conf:client Connection=Keep-Alive ProxyServer=localhost ProxyServerPort= AllowChunking=false / /http-conf:conduit to http-conf:conduit name={http://spring.demo/}HelloWorldImplService.http-conduit; http-conf:client Connection=Keep-Alive ProxyServer=localhost ProxyServerPort= AllowChunking=false / /http-conf:conduit Because spring will take a Qname like string as the 'id' attributer's value when the schema validation is open. Willem. mark.boyd wrote: I tried this and it failed with: Aug 8, 2007 4:03:20 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [demo/spring/client/clientBeans.xml] Exception in thread main org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 38 in XML document from class path resource [demo/spring/client/cli entBeans.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '{http://spring.demo/}HelloWorldImplService.http-conduit' is not a valid value for 'NCName'. The client-beans.xml file now looks as shown below. I'm not certain of the conduit ID. I used the targetnamespace defined in the wsdl served up from the service and the name attribute of the port. But this doesn't appear to be the cause of the error above. beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xmlns:http-conf=http://cxf.apache.org/transports/http/configuration; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd; bean id=client class=demo.spring.HelloWorld factory
Re: using HTTP firewall proxy with CXF Spring config
Hi Mark, It's my fault that I did not found the user doc was out of time. I will fix it right now. Please change the http-conf:conduit id={http://spring.demo/}HelloWorldImplService.http-conduit; http-conf:client Connection=Keep-Alive ProxyServer=localhost ProxyServerPort= AllowChunking=false / /http-conf:conduit to http-conf:conduit name={http://spring.demo/}HelloWorldImplService.http-conduit; http-conf:client Connection=Keep-Alive ProxyServer=localhost ProxyServerPort= AllowChunking=false / /http-conf:conduit Because spring will take a Qname like string as the 'id' attributer's value when the schema validation is open. Willem. mark.boyd wrote: I tried this and it failed with: Aug 8, 2007 4:03:20 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [demo/spring/client/clientBeans.xml] Exception in thread main org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 38 in XML document from class path resource [demo/spring/client/cli entBeans.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '{http://spring.demo/}HelloWorldImplService.http-conduit' is not a valid value for 'NCName'. The client-beans.xml file now looks as shown below. I'm not certain of the conduit ID. I used the targetnamespace defined in the wsdl served up from the service and the name attribute of the port. But this doesn't appear to be the cause of the error above. beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xmlns:http-conf=http://cxf.apache.org/transports/http/configuration; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd; bean id=client class=demo.spring.HelloWorld factory-bean=clientFactory factory-method=create/ bean id=clientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=demo.spring.HelloWorld/ property name=address value=http://localhost:8080/cxfs/ws/HelloWorld/ /bean http-conf:conduit id={http://spring.demo/}HelloWorldImplService.http-conduit; http-conf:client Connection=Keep-Alive ProxyServer=localhost ProxyServerPort= AllowChunking=false / /http-conf:conduit /beans Thanks. Mark Willem Jiang-2 wrote: Hi Mark, You need to do some conduit setting work[1]. The proxy server setting could be beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:http-conf=http://cxf.apache.org/transports/http/configuration; xsi:schemaLocation=http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd; http-conf:conduit name={http://apache.org/hello_world_soap_http}SoapPort.http-conduit; http-conf:client Connection=Keep-Alive ProxyServer=proxy host ProxyServerPort=1234 AllowChunking=false / /http-conf:conduit /beans [1] http://cwiki.apache.org/CXF20DOC/client-http-transport.html Willem. mark.boyd wrote: Does anyone know how to configure a spring configured CXF client to use a proxy to get through our firewall to an outside service? I've used jvmargs of -DhttpProxy.port and -DhttpProxy.host but CXF doesn't appear to use the java.net.URL classes which take these settings into account. When the service is set up locally on my box and successfully accessed my client spring configuration file, clientBeans.xml, looks like this: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; bean id=client class=demo.spring.HelloWorld factory-bean=clientFactory factory-method=create/ bean id=clientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean
Re: Multiple JMS services
Hi Andersen, As you know the Endpoint.publish(address1, implementor1) 's address1 can be any string, and it will take no effect if you just use the jms transport. Because the JMS endpoint address information is got from the wsdl. So back to your question. I just checked the codes, and found the server-routing.html is out of date :( You can find the latest codes here. (in Server.java , you can set the information to the endpoints for the MediatorInInterceptor to look up) https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/versioning/Server.java https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/versioning/MediatorInInterceptor.java If you like you can try the trunk version or latest snapshot with these code. Willem. mr.andersen wrote: Hi I'm trying to setup a simple server running in a main method. My goal is to have atleast 2 services, having their own wsdl definition, but both using the same request and reply JMS queue. I have tested that both services can be executed and response with correct information seperatly, but I have some problems when I publishing 2 services. First I tried to follow the example in the Users Guide - http://cwiki.apache.org/CXF20DOC/service-routing.html Service Routing , but each time the MediatorInInterceptor have found the correct targetServer, no MessageObserver was available to handle the message (MessageObserver mo = targetServer.getMessageObserver(); returned a null mo). My second implementation is like the below, but the server is picking out a random service to handle the incoming message. Is there something I have missed? Or does CXF not support multi services over JMS yet? Object implementor1 = new OneImpl(); String address1 = {http://cxf.apache.org/jms_endpt}OnePort.jms-destination;; Endpoint.publish(address1, implementor1); Object implementor2 = new AnotherImpl(); String address2 = {http://cxf.apache.org/jms_endpt}AnotherPort.jms-destination;; Endpoint.publish(address2, implementor2);
Re: using HTTP firewall proxy with CXF Spring config
Hi Mark, You need to do some conduit setting work[1]. The proxy server setting could be beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:http-conf=http://cxf.apache.org/transports/http/configuration; xsi:schemaLocation=http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd; http-conf:conduit name={http://apache.org/hello_world_soap_http}SoapPort.http-conduit; http-conf:client Connection=Keep-Alive ProxyServer=proxy host ProxyServerPort=1234 AllowChunking=false / /http-conf:conduit /beans [1] http://cwiki.apache.org/CXF20DOC/client-http-transport.html Willem. mark.boyd wrote: Does anyone know how to configure a spring configured CXF client to use a proxy to get through our firewall to an outside service? I've used jvmargs of -DhttpProxy.port and -DhttpProxy.host but CXF doesn't appear to use the java.net.URL classes which take these settings into account. When the service is set up locally on my box and successfully accessed my client spring configuration file, clientBeans.xml, looks like this: beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; bean id=client class=demo.spring.HelloWorld factory-bean=clientFactory factory-method=create/ bean id=clientFactory class=org.apache.cxf.jaxws.JaxWsProxyFactoryBean property name=serviceClass value=demo.spring.HelloWorld/ property name=address value=http://localhost:8080/cxfs/ws/HelloWorld/ /bean /beans And my client code looks like this: ClassPathResource cres = new ClassPathResource(demo/spring/client/clientBeans.xml); BeanFactory fac = new XmlBeanFactory(cres); HelloWorld service = (HelloWorld) fac.getBean(client); System.out.println(calling: + service.sayHi(Mark)); This all works just fine until I move that service outside the firewall and need to use a proxy. When the client runs outside the firewall things are again fine. So I know that the service is working. I've even dug into the source for JaxWsProxyFactoryBean a little bit but got lost fairly quickly. Any suggestions? Thanks. Mark
Re: spring demo client
Hi , Which version of CXF are you using? Can I have a look at your client side test code? It looks like the connection between the client and server is broken from your stack trace. It may be the client exited before the server sent response back. Did you use the tcpmon[1] to catch the soap messages? [1] https://tcpmon.dev.java.net/ Willem. lllgg wrote: I have changed to the ClassPathXmlApplicationContext, but it sounds like it's not that problem.it can't work either. and i got the errors as below: at the server when run the testclient.sayHI(something),it logs like: 2007-8-7 9:09:27 org.apache.cxf.phase.PhaseInterceptorChain doIntercept 信息: Interceptor has thrown exception, unwinding now org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader. at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:186) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:1) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) 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) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:139) at org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:271) at org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.java:249) 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.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 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:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508) at java.lang.Thread.run(Unknown Source) Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at [row,col {unknown-source}]: [1,0] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661) at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069) at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:87) ... 22 more and the spring client it like: xception in thread main javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader. at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:169) at $Proxy34.synchronousRole(Unknown Source) at cn.arpoa.synchronous.test.main(test.java:51) Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader. at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:69) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:1) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:90) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:178) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:1) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:395) at
Re: CXFServlet and the EndPoint API?
Hi , I am sorry to reply your letter so late. If you still not find a solution yet, please take a look at my suggestion. Yes, CXFServlet will try to load a bus without spring support. But before you use the JAXWS Endpoint.publish() API , you need to setup the default bus with the CXFServlet bus. The code could be CXFServlet servlet = getCXFServlet(); .. Bus bus = servlet.getBus(); BusFactory.setDefaultBus(bus); .. Endpoint endpoint = Endpoint.create(new GreeterImpl()); endpoint.publish(address); .. Willem. Yeroc wrote: All... I've been trying to create a web service deployed as a .war file to a Tomcat v5.5 container whilst avoiding the usage of the Spring xml config. The documentation at http://cwiki.apache.org/CXF20DOC/servlet-transport.html suggests it is possible to use the CXFServlet in this configuration using the API to publish the Endpoint (see the Publishing an endpoint with the API sub-section). I haven't been able to get this to work successfully. My first attempt used a ServletContextListener (similar to what Spring does) and called Endpoint.publish() from there but doing that resulted in CXF attempting to fire up Jetty from within Tomcat (I assume this is because my code was running before the servlet was initialized.) My second attempt is calling the Endpoint.publish() from within a servlet filter but the CXFServlet seems to be looking for a JNDI server on port 1099 that doesn't exist. Is what I'm attempting to do possible? How do I initialize things appropriately via the API when using the servlet in a container? Incidentally, the documentation suggests Spring isn't a required dependency but the CXFServlet can't be instantiated without Spring being on the classpath due to it relying on a number of Spring classes. Is this an oversight that will be corrected in the future? Thanks for your help, Corey
Re: Deploying a web service with attachments
Hi Bruno, Please use the below url to access your service. You may also study the hello_world samples' readme for more detail information. http://localhost:8000/{your war's name}/services/book You just need to replace the {your war's name} with the your war's name. Willem. Verachten Bruno wrote: Hi, I'm currently developping a service that will receive attached files, treat them, and send another file as a result. I have some problems getting CXF to work. I tried the quote reporter example, but I get the No service was found. message. So I went back to the book example found on the Xfire website, but I get the same message. I found some ideas in the mail archive, but it just doesn't work for me. I still have that message in the logs : ATTENTION: Can't find the the request for http://localhost:8000/services/book's Observer . Beans.xml : beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:jaxws=http://cxf.apache.org/jaxws; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd; import resource=classpath:META-INF/cxf/cxf.xml / import resource=classpath:META-INF/cxf/cxf-extension-soap.xml / import resource=classpath:META-INF/cxf/cxf-servlet.xml / jaxws:endpoint id=book implementor=test.webservice.BookServiceImpl address=/book / /beans Web.xml : [...] servlet servlet-nameCXFServlet/servlet-name servlet-classorg.apache.cxf.transport.servlet.CXFServlet/servlet-clas s load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameCXFServlet/servlet-name url-pattern/services/*/url-pattern /servlet-mapping BookService: @WebService(serviceName=book) public interface BookService... BookServiceImpl: @WebService(endpointInterface=test.webservice.BookService) public class BookServiceImpl implements BookService... I'm sure I must have forgotten something, but what? Thanks in advance, Bruno Verachten