RE: choice versus map
We've decided to just maintain a 'union' class that has get methods for all the possible items that can get into the map. > -Original Message- > From: Daniel Kulp [mailto:[EMAIL PROTECTED] > Sent: Friday, August 24, 2007 1:11 PM > To: cxf-user@incubator.apache.org > Cc: Benson Margulies > Subject: Re: choice versus map > > > With JAX-WS 2.0, I don't think theres a "clean" way to do this. You > could do something like: > > Object getAnnotation(String classOfAnnotation); > > and on the client side, provide a utility like: > > public T getAnnotation(Class classOfAnnotation) { > return classOfAnnotation.cast( > service.getAnnotation(classOfAnnotation.getName()); > ); > } > > That kind of sucks though.With JAX-WS 2.1, you MIGHT be able to use > the @XmlJavaTypeAdapter annotation on the Class parameter to map it to a > String in the wsdl to do much of that automatically. To do that with > 2.0 would require you to use wrapped doc/lit and to write > a "GetAnnotationRequest" class that hadd the @XmlJavaTypeAdapter on > the "classOfAnnotation" property. > > > The other issue you will run into is getting all the possible types of > into the JAXB contexts so that they can be marshalled. The > jaxb.index files can come in there as well as the spring configurations > for the JAXB databindings and such. > > > Dan > > > On Tuesday 21 August 2007, Benson Margulies wrote: > > We've got an API that associates from a class to an object of the > > class. It's not unlike some of the insides of CXF in this regard. It > > depends on generics. > > > > > > > > T getAnnotation(Class classOfAnnotation) > > > > > > > > We're trying to export this as a web service via CXF. > > > > > > > > Mediocre alternative #1: > > > > > > > > Use the @XmlElement annotation that specifies a choice for the > > XSD, and simply return a Set marked up as a set of the limited > > set of possible classes noted in the @XmlElement. > > > > > > > > This is not so hot, as the caller now has to crawl around in the Set > > or List or whatever to find the item of the desired class. > > > > > > > > We were hoping to cook up a way to express > > > > > > > >Map, and provide the class names as the keys. We > > can't figure out the @XmlElement magic that would support this, if > > any. Any JAX-WS experts out there with a clue, or the word that there > > is no hope? > > > > -- > J. Daniel Kulp > Principal Engineer > IONA > P: 781-902-8727C: 508-380-7194 > [EMAIL PROTECTED] > http://www.dankulp.com/blog
Re: schema first development
I'm using Maven2 to build my application, so I thought I probably have a dependency missing. I tried to use the cxf-bundle as it seems as though that is an all encompassing dependency, rather than identifying them in individually. I receive the same error with this as I do the other. If that's the case, how do I display my schema in a dynamically generated WSDL? Thanks, Eric On Fri, 2007-08-24 at 09:51 -0400, Eric Miles wrote: > Hi all. I'm attempting to upgrade my current XFire 1.2.6 service to CXF > 2.0.1 and having a few speed bumps. First off, we're doing schema first > development with JAXB and using Spring for our container. > > For CXF, I hope to use Spring's namespace support and this is where one > of my problems lie. I have taken a service, and done the following: > >implementor="#tawsMobileServiceImpl" name="MobileService" > address="/MobileService"> > > > > > > > classpath:com/kronos/taws/services/mobile/MobileService.xsd > > > > However, when I start the server, I get the following error: > > org.springframework.beans.factory.parsing.BeanDefinitionParsingException: > Configuration problem: Failed to import bean definitions from URL location > [classpath:com/kronos/taws/services/servicesContext.xml] > Offending resource: ServletContext resource > [/WEB-INF/taws-services-servlet.xml]; nested exception is > org.springframework.beans.factory.parsing.BeanDefinitionParsingException: > Configuration problem: Cannot locate BeanDefinitionParser for element > [schemaLocation] > Offending resource: class path resource > [com/kronos/taws/services/servicesContext.xml] > Caused by: > org.springframework.beans.factory.parsing.BeanDefinitionParsingException: > Configuration problem: Cannot locate BeanDefinitionParser for element > [schemaLocation] > Offending resource: class path resource > [com/kronos/taws/services/servicesContext.xml] > at > org.springframework.beans.factory.parsing.FailFastProblemReporter.fatal(FailFastProblemReporter.java:59) > at > org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:68) > at > org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:55) > at > org.springframework.beans.factory.xml.NamespaceHandlerSupport.findParserForElement(NamespaceHandlerSupport.java:79) > at > org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) > at > org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114) > at > org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.getAndRegisterFirstChild(AbstractBeanDefinitionParser.java:175) > at > org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.setFirstChildAsProperty(AbstractBeanDefinitionParser.java:139) > at > org.apache.cxf.jaxws.spring.EndpointDefinitionParser.doParse(EndpointDefinitionParser.java:112) > > I have a few other questions, however I feel if I can fix this my others > might go away :) > > Thanks in advance for any help. > > Eric
Re: Correct Handling (on Client) if Remote Service becomes unavailable ?
There already is a FailoverStrategy capability built into CXF where CXF will automatically redirect a request to a different server. See org.apache.cxf.clustering.FailoverStrategy That may provide the stuff you need. Dan On Tuesday 21 August 2007, kayteeem wrote: > Hi all, > > What is the correct way of handling faults if the Remote Service > becomes unavailable at some time when the Client tries to call the > service. > > For example, lets say the client and server are communicating and all > is well, then at some time later the Remote Service is "turned off" > (or address was changed). > > After reading the CXF > guide(http://cwiki.apache.org/CXF20DOC/interceptors.html) an > Interceptor seems the correct way to handle if a fault is thrown, > which is what happens when I turn off the remote service, and then try > to make a call from the client. > > Fault thrown is: > INFO: Interceptor has thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: Could not send Message. > at > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndi > ngInterceptor.handleMessage(MessageSenderInterceptor.java:64) > > Exception from client Proxy is: > Throwable: java.lang.NoSuchMethodError: createFault > Stack Trace: > java.lang.NoSuchMethodError: createFault > at > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:15 > 1) > > So I inserted my own Interceptor and managed to register it to call my > overridden handleFault(SoapMessage soapMessage) method: > > My Interceptor: > > public class CannotInvokeMethodInterceptor extends > AbstractSoapInterceptor { > > public CannotInvokeMethodInterceptor(){ > super (Phase.SETUP); > getBefore().add(MessageSenderInterceptor.class.getName()); > System.out.println("Inside the method of Interceptor"); > } > > @Override > public void handleFault(SoapMessage soapMessage) { > System.out.println("\n\n\n"); > System.out.println("ZZZ"); > System.out.println("Inside the handleFault method of > Interceptor"); > System.out.println("SOAP Message: " + soapMessage); > } > > public void handleMessage(SoapMessage arg0) throws Fault { > System.out.println("Inside the handleMessage method of > Interceptor"); } > > } > > Registering my Interceptor on the Client: > > HelloWorld hwClient = (HelloWorld)ctx.getBean("client"); > > CannotInvokeMethodInterceptor interceptor = new > CannotInvokeMethodInterceptor (); > Client cxfClient = ClientProxy.getClient(hwClient); > cxfClient.getOutInterceptors().add(interceptor); > cxfClient.getOutFaultInterceptors().add(interceptor); > > QUESTION: > What should I do inside the handleFault() method, which is being > called? > > NOTE: I am using CXF 2.0.1, in conjunction with Spring. > > Thanks > Michael > > Full Stacktrace: > > Inside the method of Interceptor > Inside the handleMessage method of Interceptor > 21/08/2007 14:08:19 org.apache.cxf.phase.PhaseInterceptorChain > doIntercept INFO: Interceptor has thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: Could not send Message. > at > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndi > ngInterceptor.handleMessage(MessageSenderInterceptor.java:64) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept > orChain.java:207) > at > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:255) at > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:206) at > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) > at > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:13 > 5) > at > $Proxy53.sayHi(Ljava.lang.String;)Ljava.lang.String;(Unknown Source) > at > com.axa.wsclient.helloWorld.HelloWorldController.helloWorldAction(Hel > loWorldController.java:55) > at > jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[ > Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) > at > java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object; > I)Ljava.lang.Object;(Unknown Source) > at > org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(F > lowController.java:869) > at > org.apache.beehive.netui.pageflow.FlowController.getActionMethodForwa > rd(FlowController.java:808) > at > org.apache.beehive.netui.pageflow.FlowController.internalExecute(Flow > Controller.java:477) > at > org.apache.beehive.netui.pageflow.PageFlowController.internalExecute( > PageFlowController.java:305) > at > org.apache.beehive.netui.pageflow.FlowController.execute(FlowControll > er.java:335) > at > org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execu > te(FlowControllerAction.java:51) > at > org.apache.struts.action.RequestProcessor.processActionPerform(Req
Re: Web application with cxf has lost commons-logging/log4j output
Richard, Honestly, I have no idea. CXF doesn't use log4j for anything and we pretty much go out of our way in our dependencies and such to make sure we don't accidentally grab log4j.I guess all I can suggest is to make sure the log4j jar is available. Maybe check the system properties or something to make sure nothing is grabbing a different log4j.properties file. Dan On Tuesday 21 August 2007, Richard Mixon wrote: > I have finally successfully integrated cxf into one of my web > applications. I have a service with several useful operations working > and returning complex objects. It works well! > > But I have also lost the ability to log output using commons-logging > and log4j. We have been using a log4j.properties file in the > WEB-INF/classes directory. > > But it looks like cxf is interfering with this output. I do have > WEB-INF/cxf-servlet.xml with the following contents: > > > > xmlns="http://www.springframework.org/schema/beans"; > xmlns:xsi="http://www.w3 > .org/2001/XMLSchema-instance" > xmlns:jaxws="http://cxf.apache.org/jaxws"; > xmln > s:soap="http://cxf.apache.org/bindings/soap"; > xsi:schemaLocation=" > http://www > .springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd > http://cxf. > apache.org/bindings/soap > http://cxf.apache.org/schemas/configuration/soap.xsd > http://cxf.apache.org/j > axws http://cxf.apache.org/schemas/jaxws.xsd";> > > id="MemberService_xml_bare" > > implementor="com.firedrum.webservice.service.MemberServiceImpl" > > wsdlLocation="WEB-INF/wsdl/MemberService.wsdl" > address="/MemberService" > > > > > > > > > > Any ideas on how to get my log4j logging back. > > Thanks! - Richard -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: choice versus map
With JAX-WS 2.0, I don't think theres a "clean" way to do this. You could do something like: Object getAnnotation(String classOfAnnotation); and on the client side, provide a utility like: public T getAnnotation(Class classOfAnnotation) { return classOfAnnotation.cast( service.getAnnotation(classOfAnnotation.getName()); ); } That kind of sucks though.With JAX-WS 2.1, you MIGHT be able to use the @XmlJavaTypeAdapter annotation on the Class parameter to map it to a String in the wsdl to do much of that automatically. To do that with 2.0 would require you to use wrapped doc/lit and to write a "GetAnnotationRequest" class that hadd the @XmlJavaTypeAdapter on the "classOfAnnotation" property. The other issue you will run into is getting all the possible types of into the JAXB contexts so that they can be marshalled. The jaxb.index files can come in there as well as the spring configurations for the JAXB databindings and such. Dan On Tuesday 21 August 2007, Benson Margulies wrote: > We've got an API that associates from a class to an object of the > class. It's not unlike some of the insides of CXF in this regard. It > depends on generics. > > > > T getAnnotation(Class classOfAnnotation) > > > > We're trying to export this as a web service via CXF. > > > > Mediocre alternative #1: > > > > Use the @XmlElement annotation that specifies a choice for the > XSD, and simply return a Set marked up as a set of the limited > set of possible classes noted in the @XmlElement. > > > > This is not so hot, as the caller now has to crawl around in the Set > or List or whatever to find the item of the desired class. > > > > We were hoping to cook up a way to express > > > >Map, and provide the class names as the keys. We > can't figure out the @XmlElement magic that would support this, if > any. Any JAX-WS experts out there with a clue, or the word that there > is no hope? -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: NullPointerException with REST client call using JAX-WS Dispatch
Mark, I think I need some more details: 1) Are you using a WSDL URL or not for the call at: if (wsdlURL == null) { service = Service.create(serviceName); } else { service = Service.create(wsdlURL, serviceName); } That's important. If you ARE using a WSDL URL, the serviceName and portnames will have to match whats in the WSDL. If you are using the WSDL URL, could you send me that?The url on amazons site is: http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl? but that has a namespace of: http://webservices.amazon.com/AWSECommerceService/2007-07-16 so I assume it's new than what you were trying to use. 2) Can you also send me the values you are using for: URL endpointAddress = binding.getEndpointAddress(); String queryStringPostFix = callParams.getUrlPostFix(); callParams.getVerb().getVerbName() callParams.getPayload() Thanks! Dan On Wednesday 22 August 2007, Mark Edwards wrote: > Hi > > > > I'm getting the following exception when trying to call one of > Amazon's REST webservices using the JAX-WS Dispatch approach. > > > > > > 22-Aug-2007 15:52:18 > org.apache.cxf.service.factory.ReflectionServiceFactoryBean > buildServiceFromClass > > INFO: Creating Service > {http://webservices.amazon.com/AWSECommerceService/2005-10-05}amazon_s >ervice from class org.apache.cxf.jaxws.support.DummyImpl > > Exception in thread "main" java.lang.NullPointerException > > at > org.apache.cxf.jaxws.ServiceImpl.createEndpointInfo(ServiceImpl.java:3 >58) > > at > org.apache.cxf.jaxws.ServiceImpl.getJaxwsEndpoint(ServiceImpl.java:137 >) > > at > org.apache.cxf.jaxws.ServiceImpl.createDispatch(ServiceImpl.java:188) > > at javax.xml.ws.Service.createDispatch(Service.java:166) > > at > uk.co.orchardsystems.webservices.client.call.DispatchServiceCall.resfF >ulCall( DispatchServiceCall.java:98) > > at > uk.co.orchardsystems.webservices.client.test.AmazonRestFulClient.main( >AmazonR estFulClient.java:51) > > > > > > My code works fine if I remove CXF from the classpath and run it using > the JAX-WS implementation that comes with Java 6. > > > > > > The main calling method in my code is - > > > > public Document resfFulCall(RestFulCallParams callParams) > > throws WebserviceClientCallException { > > BindingDefinition binding = > getServiceCallRequest().getBinding(); > > QName portName = binding.getPortName(); > > URL endpointAddress = binding.getEndpointAddress(); > > String fullURL = null; > > String queryStringPostFix = callParams.getUrlPostFix(); > > if (queryStringPostFix != null) { > > fullURL = endpointAddress.toString() + queryStringPostFix; > > } else { > > fullURL = endpointAddress.toString(); > > } > > > > Service service = getService(); > > service.addPort(portName, HTTPBinding.HTTP_BINDING, fullURL); > > Dispatch dispatch = service.createDispatch(portName, > Source.class, Service.Mode.PAYLOAD); > > Map requestContext = > dispatch.getRequestContext(); > > requestContext.put(MessageContext.HTTP_REQUEST_METHOD, > callParams.getVerb().getVerbName()); > > return payLoadInvoke(dispatch, callParams.getPayload()); > > } > > > > Supporting methods - > > > > protected Service getService() { > > ServiceDefinition serviceDefinition = > serviceCallRequest.getBinding().getService(); > > QName serviceName = serviceDefinition.getServiceName(); > > URL wsdlURL = serviceDefinition.getWsdlURL(); > > Service service; > > if (wsdlURL == null) { > > service = Service.create(serviceName); > > } else { > > service = Service.create(wsdlURL, serviceName); > > } > > > > service.setHandlerResolver(new > ClientHandlerResolver(serviceCallRequest)); > > > > return service; > > } > > > > private Document payLoadInvoke(Dispatch dispatch, Document > payload) > > throws WebserviceClientCallException { > > DOMSource request = new DOMSource(payload); > > > > Source response = null; > > try { > > response = dispatch.invoke(request); > > } catch (Throwable t) { > > processException(t); > > } > > > > try { > > return XMLUtils.domSourceToDocument(response); > > } catch (TransformerConfigurationException e) { > > throw new WebserviceClientCallException(e); > > } catch (TransformerFactoryConfigurationError e) { > > throw new WebserviceClientCallException(e); > > } catch (TransformerException e) { > > throw new WebserviceClientCallException(e); > > } > > } > > > > Relevant values - > > > > Service name = new > QName("http://webservices.amazon.com/AWSECommerceService/2005-10-05";, > "amazon_service") >
Re: AbstractCXFTest - NoClassDefFoundError javax.xml.stream.XMLStreamWriter
Sounds like your missing the stax-api-1.0.1.jar from the classpath. That's the jar that would have that class in it. Dan On Friday 24 August 2007, Henning Jensen wrote: > Hi! > > I'm trying to use CXF for testing my web services. I have created a > simple class that uses org.apache.cxf.test.AbstractCXFTest and invokes > one of my web services with a predefined xml file. However when > running the test i get a NoClassDefFoundError thrown in my face. > Anyone had the same issue? > > java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamWriter > at > org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLMa >nagerImpl.java:223) at > org.apache.cxf.wsdl11.WSDLManagerImpl.(WSDLManagerImpl.java:97) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) at > sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown > Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) > at java.lang.Class.newInstance0(Unknown Source) > at java.lang.Class.newInstance(Unknown Source) > at org.apache.cxf.bus.extension.Extension.load(Extension.java:86) > at > org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(Exte >nsionManagerImpl.java:136) at > org.apache.cxf.bus.extension.ExtensionManagerImpl.processExtension(Ext >ensionManagerImpl.java:111) at > org.apache.cxf.bus.extension.ExtensionManagerImpl.loadFragment(Extensi >onManagerImpl.java:104) at > org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManage >rImpl.java:96) at > org.apache.cxf.bus.extension.ExtensionManagerImpl.(ExtensionMana >gerImpl.java:72) at > org.apache.cxf.bus.extension.ExtensionManagerBus.(ExtensionManag >erBus.java:88) at > org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:40) at > org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:36) at > org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:32) at > org.apache.cxf.test.AbstractCXFTest.createBus(AbstractCXFTest.java:107 >) at > org.apache.cxf.test.AbstractCXFTest.setUpBus(AbstractCXFTest.java:80) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at > sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at > sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at > java.lang.reflect.Method.invoke(Unknown Source) > at > org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:1 >22) at > org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(M >ethodRoadie.java:86) at > org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) > at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) > at > org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4Cl >assRunner.java:88) at > org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRun >ner.java:51) at > org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.j >ava:44) at > org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java >:27) at > org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:3 >7) at > org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.jav >a:42) at > org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4T >estReference.java:38) at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution. >java:38) at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote >TestRunner.java:460) at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(Remote >TestRunner.java:673) at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestR >unner.java:386) at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest >Runner.java:196) > > > My test class: > > package mypackage; > > import org.apache.cxf.binding.http.HttpBindingFactory; > import org.apache.cxf.test.AbstractCXFTest; > import org.junit.Test; > > public class WSTest extends AbstractCXFTest { > > @Test > public void testMyService() throws Exception { > String transport = "http://schemas.xmlsoap.org/soap/http";; > String address = > "http://localhost:8080/axis/services/MyService";; > invoke(address, HttpBindingFactory.HTTP_BINDING_ID, > "myrequest.xml"); } > } -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: Logging the received generated SOAP Messages
You can configure it on the bus as well. Via Spring: or you can get the Bus object and do the bus.getInInterceptors().add(...) calls to add the interceptors manually. Those interceptors would apply to all the clients and services that the bus hosts. Dan On Friday 24 August 2007, Jacob Marcus wrote: > Hi, > > I have a related question. > > Suppose, you have a lot of end points and you want to perform a common > logging/auditing across all of them. Is there a way you can intercept > at a higher level than for each service? Something like at the > ServletDestination level? > > This would be useful and a bit more easier than having to set up > interceptors for each end point? > > Thanks, > Jacob > > On 8/24/07, Freeman Fang <[EMAIL PROTECTED]> wrote: > > Hi Holger, > > > > Actually we have LoggingInInterceptor and LoggingOutInterceptor for > > that purpose. > > You can add it two your endpoint on server side > > EndpointImpl e = (EndpointImpl)Endpoint.publish(address, > > implementor); > > e.getServer().getEndpoint().getInInterceptors().add(new > > LoggingInInterceptor()); > > e.getServer().getEndpoint().getOutInterceptors().add(new > > LoggingOutInterceptor()); > > > > For client side, you can do it like > > HelloPortType port = helloService.getHelloPort(); > > Client client = ClientProxy.getClient(port); > > client.getInInterceptors().add(new LoggingInInterceptor()); > >client.getInOutterceptors().add(new LoggingOutInterceptor()); > > > > Also you can configure log features in spring file, you can refer to > > > > https://svn.apache.org/repos/asf/incubator/cxf/trunk/distribution/sr > >c/main/release/samples/wsdl_first/wsdl/cxf-servlet.xml > > > > Best Regards > > > > Freeman > > > > Holger Stolzenberg wrote: > > > What is the easiest way to log the received and generated SOAP > > > messages. > > > > Currently I have an incoming/outgoing interceptor with phases > > receive/send that simply log some properties of the SoapMessage > > interceptor method param. What I want to log is the raw message data > > ( ... ). > > > > > Mit lieben Grüßen aus dem eWerk > > > > > > | Holger Stolzenberg > > > | Softwareentwickler > > > | > > > | Geschäftsführer: > > > | Frank Richter, Erik Wende, Hendrik Schubert > > > | > > > | eWerk IT GmbH > > > | Markt 16 > > > | Leipzig 04109 > > > | http://www.ewerk.com > > > | HRB 9065, AG Leipzig > > > | Hauptniederlassung Leipzig > > > | > > > | fon +49.341.4 26 49-0 > > > | fax +49.341.4 26 49-88 > > > | mailto:[EMAIL PROTECTED] > > > | > > > | Support: > > > | fon 0700 CALLME24 (0700 22556324) > > > | fax 0700 CALLME24 (0700 22556324) > > > | > > > | Auskünfte und Angebote per Mail > > > | sind freibleibend und unverbindlich. -- J. Daniel Kulp Principal Engineer IONA P: 781-902-8727C: 508-380-7194 [EMAIL PROTECTED] http://www.dankulp.com/blog
Re: Logging the received generated SOAP Messages
Hi, I have a related question. Suppose, you have a lot of end points and you want to perform a common logging/auditing across all of them. Is there a way you can intercept at a higher level than for each service? Something like at the ServletDestination level? This would be useful and a bit more easier than having to set up interceptors for each end point? Thanks, Jacob On 8/24/07, Freeman Fang <[EMAIL PROTECTED]> wrote: > > Hi Holger, > > Actually we have LoggingInInterceptor and LoggingOutInterceptor for that > purpose. > You can add it two your endpoint on server side > EndpointImpl e = (EndpointImpl)Endpoint.publish(address, implementor); > e.getServer().getEndpoint().getInInterceptors().add(new > LoggingInInterceptor()); > e.getServer().getEndpoint().getOutInterceptors().add(new > LoggingOutInterceptor()); > > For client side, you can do it like > HelloPortType port = helloService.getHelloPort(); > Client client = ClientProxy.getClient(port); > client.getInInterceptors().add(new LoggingInInterceptor()); >client.getInOutterceptors().add(new LoggingOutInterceptor()); > > Also you can configure log features in spring file, you can refer to > > https://svn.apache.org/repos/asf/incubator/cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/cxf-servlet.xml > > Best Regards > > Freeman > > Holger Stolzenberg wrote: > > What is the easiest way to log the received and generated SOAP messages. > Currently I have an incoming/outgoing interceptor with phases receive/send > that simply log some properties of the SoapMessage interceptor method param. > What I want to log is the raw message data ( ... > ). > > > > Mit lieben Grüßen aus dem eWerk > > > > | Holger Stolzenberg > > | Softwareentwickler > > | > > | Geschäftsführer: > > | Frank Richter, Erik Wende, Hendrik Schubert > > | > > | eWerk IT GmbH > > | Markt 16 > > | Leipzig 04109 > > | http://www.ewerk.com > > | HRB 9065, AG Leipzig > > | Hauptniederlassung Leipzig > > | > > | fon +49.341.4 26 49-0 > > | fax +49.341.4 26 49-88 > > | mailto:[EMAIL PROTECTED] > > | > > | Support: > > | fon 0700 CALLME24 (0700 22556324) > > | fax 0700 CALLME24 (0700 22556324) > > | > > | Auskünfte und Angebote per Mail > > | sind freibleibend und unverbindlich. > > > > >
Re: AW: Passing method parameters using PHP SoapClient failing
Holger, Thank you for the reply - as it turns out I was not passing an associative array in my method call. After reviewing the WSDL a bit more closely I discovered that my arguments had names such as "arg0", "arg1", etc. I found that the following works for me: $result = $client->testString(array("arg0"=>"test")); The following does NOT work for me (although it would be nice if it did): $result = $client->testString("test"); Again, thanks for the reply and I'll look into those other configuration options. Regards, Kaleb |> | From: | |> >--| |"Holger Stolzenberg" <[EMAIL PROTECTED]> | >--| |> | To:| |> >--| | | >--| |> | Date: | |> >--| |08/24/2007 04:48 AM | >--| |> | Subject: | |> >--| |AW: Passing method parameters using PHP SoapClient failing | >--| The PHP call to your WS method seems to be false. You have to provide a associative array for the WS method params. Following code shows how we do it: // the wsdl URL of your service to test $serviceWsdl = 'http://127.0.0.1:8080/EEX_Shop_Backend/ws-api/CustomerService?wsdl'; // the parmeters to initialize the client with $serviceParams = array( 'trace' => 1, 'soap_version' => SOAP_1_1, 'style' => SOAP_DOCUMENT, 'use' => SOAP_LITERAL ); // create the SOAP client $client = new SoapClient( $serviceWsdl, $serviceParams ); // method call $res = $client->getCustomerById( array( 'auth' => "passwd", 'customerId' => 2 ) ); var_dump( $res ); -Ursprüngliche Nachricht- Von: Kaleb Walton [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 23. August 2007 14:55 An: cxf-user@incubator.apache.org Betreff: Passing method parameters using PHP SoapClient failing As a requirement for our customers I'm trying to get SOAP communication going using PHPs SoapClient object. Calling methods with no parameters works fine (I get results) but when I pass in parameters I get a "Fault occurred while processing" error message returned which I assume is coming somewhere within the CXF framework. The PHP code is pretty simple: $client = new SoapClient('http://localhost:8080/services/Person?wsdl'); $client->testString('abc'); <-- This line returns an error message of 'Fault occurred while processing' Service object: @WebService(endpointInterface = "a.b.c.webservices.PersonService") public class PersonServiceImpl implements PersonService { public String testString(String id) { System.out.println("PersonServiceImpl: testString: "+id); return id; } } Config: http://localhost:8080/services/Person"/> Also, it looks like CXF uses Java's Logging implementation, however, I cannot seem to get it to log anywhere. Does anyone have any quick pointers on how to get that going? Regards, Kaleb Walton
Re: AW: cxf-2.0.1-incubator - dependency incompatibility with hibernate
Yea, it's definitely a bug in 2.0.1. Logged at: https://issues.apache.org/jira/browse/CXF-915 It is fixed on trunk and in the latest 2.1 SNAPSHOT.Basically, 2.0.1 will work with 3.0 and will work if no ASM is available at all (degrades to reflection). However, it doesn't work if 2.x or 1.x is available. On trunk, it will use ASM 3.0 or 2.x just fine. If 1.x is found, it degrades to reflection. Dan On Friday 24 August 2007, Holger Stolzenberg wrote: > The problem refers to version 2.0.1-INCUBATOR. Regarding the POM at > http://people.apache.org/repo/m2-incubating-repository/org/apache/cxf/ >cxf-rt-frontend-jaxws/2.0.1-incubator/cxf-rt-frontend-jaxws-2.0.1-incub >ator.pom you can see that there is no version defined for 'asm' > artifact so the highest available version will be used (unless > otherwise defined), which causes the incompatibility to hibernate. > > > -Ursprüngliche Nachricht- > Von: Willem Jiang [mailto:[EMAIL PROTECTED] > Gesendet: Freitag, 24. August 2007 03:05 > An: cxf-user@incubator.apache.org > Betreff: Re: cxf-2.0.1-incubator - dependency incompatibility with > hibernate > > AFAIK, current CXF trunk has upgrade the asm to 2.2.3 for better > hibernate integration. You can try out the latest version or just use > asm 2.xx to go around it. > > Willem. > > gdprao wrote: > > Hi, > > > > I have tried the following workaround and could able to resolve this > > error. > > > > 1. Removed Hibernate's asm.jar,cglib-2.1.3.jar and asm-attrs.jar > > from classpath. > > 2. Placed cglib-nodep-2.1_3.jar in classpath (downloaded from > > http://repo1.maven.org/maven2/cglib/cglib-nodep/2.1_3/). > > 3. Included asm3.0.jar from CXF2.0.1 from distribution into the > > classpath. > > > > Both Hibernate and CXF errors are disappeared. > > > > Thanks, > > Durga > > > > gdprao wrote: > >> Hi Sotlzenberg, > >> > >> I am also facing the same exception after upgrading to CXF-2.0.1 > >> with CXF asm jars which seems to be incompatible with hibernate > >> jars. I don't have this issue when I am working with CXF-2.0 > >> version. If I place asm jars that comes with hibernate, the > >> Hibernate error disappears, but CXF service is breaking with the > >> following exception at run time. Appreciate if someone could help > >> me out on this? > >> > >> Thanks, > >> Durga > >> > >> 14:19:31,667 ERROR [CXFServlet]:invoke(253) | Servlet.service() for > >> servlet CXFServlet threw exception > >> java.lang.NoSuchMethodError: > >> org.objectweb.asm.ClassWriter.(I)V at > >> org.apache.cxf.jaxws.interceptors.WrapperHelperCompiler.(Wrap > >>perHelperCompiler.java:79) at > >> org.apache.cxf.jaxws.interceptors.WrapperHelperCompiler.compileWrap > >>perHelper(WrapperHelperCompiler.java:89) at > >> org.apache.cxf.jaxws.interceptors.WrapperHelper.compileWrapperHelpe > >>r(WrapperHelper.java:234) at > >> org.apache.cxf.jaxws.interceptors.WrapperHelper.createWrapperHelper > >>(WrapperHelper.java:210) at > >> org.apache.cxf.jaxws.interceptors.WrapperHelper.createWrapperHelper > >>(WrapperHelper.java:172) at > >> org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handle > >>Message(WrapperClassOutInterceptor.java:96) at > >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterce > >>ptorChain.java:207) at > >> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(O > >>utgoingChainInterceptor.java:73) at > >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterce > >>ptorChain.java:207) at > >> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIni > >>tiationObserver.java:73) at > >> org.apache.cxf.transport.servlet.ServletDestination.doMessage(Servl > >>etDestination.java:78) at > >> org.apache.cxf.transport.servlet.ServletController.invokeDestinatio > >>n(ServletController.java:231) at > >> org.apache.cxf.transport.servlet.ServletController.invoke(ServletCo > >>ntroller.java:105) at > >> org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java: > >>271) at > >> org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:2 > >>53) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > >> > >> h.stolzenberg wrote: > >>> I recently upgraded to cxf-2.0.1-incubator. After that the > >>> following exception occured starting up my webapp: > >>> > >>> Error creating bean with name 'SpringSessionFactory' defined in > >>> ServletContext resource > >>> [/WEB-INF/classes/beans/persistence.context.xml]: Invocation of > >>> init method failed; nested exception is > >>> java.lang.NoSuchMethodError: > >>> org.objectweb.asm.ClassWriter.(Z)V > >>> Caused by: > >>> java.lang.NoSuchMethodError: > >>> org.objectweb.asm.ClassWriter.(Z)V at > >>> net.sf.cglib.core.DebuggingClassWriter.(DebuggingClassWriter > >>>.java:47) at > >>> net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultG > >>>eneratorStrategy.java:30) at > >>> net.sf.cglib.core.DefaultGeneratorStrategy
schema first development
Hi all. I'm attempting to upgrade my current XFire 1.2.6 service to CXF 2.0.1 and having a few speed bumps. First off, we're doing schema first development with JAXB and using Spring for our container. For CXF, I hope to use Spring's namespace support and this is where one of my problems lie. I have taken a service, and done the following: classpath:com/kronos/taws/services/mobile/MobileService.xsd However, when I start the server, I get the following error: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:com/kronos/taws/services/servicesContext.xml] Offending resource: ServletContext resource [/WEB-INF/taws-services-servlet.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [schemaLocation] Offending resource: class path resource [com/kronos/taws/services/servicesContext.xml] Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [schemaLocation] Offending resource: class path resource [com/kronos/taws/services/servicesContext.xml] at org.springframework.beans.factory.parsing.FailFastProblemReporter.fatal(FailFastProblemReporter.java:59) at org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:68) at org.springframework.beans.factory.parsing.ReaderContext.fatal(ReaderContext.java:55) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.findParserForElement(NamespaceHandlerSupport.java:79) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114) at org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.getAndRegisterFirstChild(AbstractBeanDefinitionParser.java:175) at org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser.setFirstChildAsProperty(AbstractBeanDefinitionParser.java:139) at org.apache.cxf.jaxws.spring.EndpointDefinitionParser.doParse(EndpointDefinitionParser.java:112) I have a few other questions, however I feel if I can fix this my others might go away :) Thanks in advance for any help. Eric
AbstractCXFTest - NoClassDefFoundError javax.xml.stream.XMLStreamWriter
Hi! I'm trying to use CXF for testing my web services. I have created a simple class that uses org.apache.cxf.test.AbstractCXFTest and invokes one of my web services with a predefined xml file. However when running the test i get a NoClassDefFoundError thrown in my face. Anyone had the same issue? java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamWriter at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:223) at org.apache.cxf.wsdl11.WSDLManagerImpl.(WSDLManagerImpl.java:97) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.apache.cxf.bus.extension.Extension.load(Extension.java:86) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:136) at org.apache.cxf.bus.extension.ExtensionManagerImpl.processExtension(ExtensionManagerImpl.java:111) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadFragment(ExtensionManagerImpl.java:104) at org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerImpl.java:96) at org.apache.cxf.bus.extension.ExtensionManagerImpl.(ExtensionManagerImpl.java:72) at org.apache.cxf.bus.extension.ExtensionManagerBus.(ExtensionManagerBus.java:88) at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:40) at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:36) at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:32) at org.apache.cxf.test.AbstractCXFTest.createBus(AbstractCXFTest.java:107) at org.apache.cxf.test.AbstractCXFTest.setUpBus(AbstractCXFTest.java:80) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.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) My test class: package mypackage; import org.apache.cxf.binding.http.HttpBindingFactory; import org.apache.cxf.test.AbstractCXFTest; import org.junit.Test; public class WSTest extends AbstractCXFTest { @Test public void testMyService() throws Exception { String transport = "http://schemas.xmlsoap.org/soap/http";; String address = "http://localhost:8080/axis/services/MyService";; invoke(address, HttpBindingFactory.HTTP_BINDING_ID, "myrequest.xml"); } } -- Regards Henning Jensen
Re: Is there any way to customise schema namespaces with java2wsdl?
Hi Jim, Just to follow up on this - I had a go at providing a skeleton Java package with the package-info.java(.class) in place: CXF correctly picked up the class and placed all JAX-B related artifacts from that package into the namespace specified in package-info: --- package-info.java (in directory my/package) @javax.xml.bind.annotation.XmlSchema(namespace ="http://i.wandered.lonely.as.a.cloud";); package my.package; --- So, this clever little hack works just fine. Cheers, Ade. Adrian Trenaman wrote: > > Hi Jim, > > Thanks for the idea - if only I could modify the class!! It's been made > available to me only as a JAR, not in source format, so I don't have the > possiblity of adding the familiar JAX-B annotations that would do this. > > One suggestion I've had from a colleague in Dublin is to create a skeleton > directory structure that matches the package structure, and create a > package-info.java file in each directory with a > @javax.xml.bind.annotation.XmlSchema(namespace="...") annotation; if I > compile and then put this ahead of my JAR in the classpath then java2wsdl > might pick up these annotations and help out. > > What do you think? Pragmatic workaround or artful hackery? > > Cheers, > Ade. > > > Jim Ma-3 wrote: >> >> Hi Adrian, >> >> If this class can be modified , I think we can add some annotations for >> this method to avoid generating wrapper element and resolve clash : >> >> pacakge com.foo; >> public class Bar { >>@ResponseWrapper(targetNamespace = "http://apache.org/namespace";, >> className = "com.foo.CreateCaseResponse", localName = >> "createCaseResponse") >>@RequestWrapper(targetNamespace = "http://apache.org/namespace";, >> className = "com.foo.CreateCaseRequest2", localName = "createCaseRequst") >>public CreateCaseResponse createCase(String arg0, CreateCaseRequest >> arg1); >> } >> >> When java2wsdl can not read these annotations for this method , it will >> try to load the RequestWrapper class and ReponseWrapper class from >> package com.foo.jaxws (as per jaxws spec). >> If it is failed to load , it will generate wrapper elements for this >> method . >> >> Regards >> >> Jim >> >> >> Adrian Trenaman wrote: >>> Hi Jim, >>> >>> Thanks for the info! The collision I'm running into is due to the Java >>> API >>> (based on an EJB) already providing wrappers classes for parameter >>> lists. >>> For example: >>> >>> public CreateCaseResponse createCase(String arg0, CreateCaseRequest >>> arg1) >>> >>> ... as you can see, our java2wsdl will try and create a wrapper element >>> for >>> CreateCaseResponse (as per the JAXWS spec) which then clashes with the >>> already existing type CreateCaseResponse. Ugly, huh?! >>> >>> The original CreateCaseResponse is in a different Java package from the >>> interface, so if we could map individual packages to schema namespaces >>> then >>> I would be able to resolve the clash. However, as you say in your email, >>> CXF >>> doesn't provide support for this. >>> >>> Best, >>> Ade. >>> >>> >>> Jim Ma-3 wrote: >>> Hi Adrian, What type of collision did you run into ? Is this schema element name collision? Java2wsdl uses converted packagename or annotated namepace as it's namespace , and there is no way to customize the namespace on per-package basis like wsdl2java does. Cheers -Jim Trenaman, Adrian wrote: > Hi all, > > I'm creating some WSDL from classes in an existing Jar file; CXF's > java2wsdl is putting everything into the same schema namespace which > is > causing collisions. Is there any way to customise the namespace on a > per-package basis so that I can avoid the collisions? > > Thanks, > Ade. > > > Adrian Trenaman > > Principal Consultant, IONA Technologies. > > E: [EMAIL PROTECTED] > > P: +353-1-6372659 > > M: +353-86-6051026 > > > > > > > IONA Technologies PLC (registered in Ireland) > Registered Number: 171387 > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, > Ireland > > > >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Is-there-any-way-to-customise-schema-namespaces-with-java2wsdl--tf4305933.html#a12309764 Sent from the cxf-user mailing list archive at Nabble.com.
Re: Logging the received generated SOAP Messages
Hi Holger, Actually we have LoggingInInterceptor and LoggingOutInterceptor for that purpose. You can add it two your endpoint on server side EndpointImpl e = (EndpointImpl)Endpoint.publish(address, implementor); e.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor()); e.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor()); For client side, you can do it like HelloPortType port = helloService.getHelloPort(); Client client = ClientProxy.getClient(port); client.getInInterceptors().add(new LoggingInInterceptor()); client.getInOutterceptors().add(new LoggingOutInterceptor()); Also you can configure log features in spring file, you can refer to https://svn.apache.org/repos/asf/incubator/cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/cxf-servlet.xml Best Regards Freeman Holger Stolzenberg wrote: What is the easiest way to log the received and generated SOAP messages. Currently I have an incoming/outgoing interceptor with phases receive/send that simply log some properties of the SoapMessage interceptor method param. What I want to log is the raw message data ( ... ). Mit lieben Grüßen aus dem eWerk | Holger Stolzenberg | Softwareentwickler | | Geschäftsführer: | Frank Richter, Erik Wende, Hendrik Schubert | | eWerk IT GmbH | Markt 16 | Leipzig 04109 | http://www.ewerk.com | HRB 9065, AG Leipzig | Hauptniederlassung Leipzig | | fon +49.341.4 26 49-0 | fax +49.341.4 26 49-88 | mailto:[EMAIL PROTECTED] | | Support: | fon 0700 CALLME24 (0700 22556324) | fax 0700 CALLME24 (0700 22556324) | | Auskünfte und Angebote per Mail | sind freibleibend und unverbindlich.
Re: AW: cxf-2.0.1-incubator - dependency incompatibility with hibernate
You can use the element when referencing the CXF jars to remove the incompatible ASM import. Holger Stolzenberg wrote: The problem refers to version 2.0.1-INCUBATOR. Regarding the POM at http://people.apache.org/repo/m2-incubating-repository/org/apache/cxf/cxf-rt-frontend-jaxws/2.0.1-incubator/cxf-rt-frontend-jaxws-2.0.1-incubator.pom you can see that there is no version defined for 'asm' artifact so the highest available version will be used (unless otherwise defined), which causes the incompatibility to hibernate. -Ursprüngliche Nachricht- Von: Willem Jiang [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 24. August 2007 03:05 An: cxf-user@incubator.apache.org Betreff: Re: cxf-2.0.1-incubator - dependency incompatibility with hibernate AFAIK, current CXF trunk has upgrade the asm to 2.2.3 for better hibernate integration. You can try out the latest version or just use asm 2.xx to go around it. Willem. gdprao wrote: Hi, I have tried the following workaround and could able to resolve this error. 1. Removed Hibernate's asm.jar,cglib-2.1.3.jar and asm-attrs.jar from classpath. 2. Placed cglib-nodep-2.1_3.jar in classpath (downloaded from http://repo1.maven.org/maven2/cglib/cglib-nodep/2.1_3/). 3. Included asm3.0.jar from CXF2.0.1 from distribution into the classpath. Both Hibernate and CXF errors are disappeared. Thanks, Durga gdprao wrote: Hi Sotlzenberg, I am also facing the same exception after upgrading to CXF-2.0.1 with CXF asm jars which seems to be incompatible with hibernate jars. I don't have this issue when I am working with CXF-2.0 version. If I place asm jars that comes with hibernate, the Hibernate error disappears, but CXF service is breaking with the following exception at run time. Appreciate if someone could help me out on this? Thanks, Durga 14:19:31,667 ERROR [CXFServlet]:invoke(253) | Servlet.service() for servlet CXFServlet threw exception java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(I)V at org.apache.cxf.jaxws.interceptors.WrapperHelperCompiler.(WrapperHelperCompiler.java:79) at org.apache.cxf.jaxws.interceptors.WrapperHelperCompiler.compileWrapperHelper(WrapperHelperCompiler.java:89) at org.apache.cxf.jaxws.interceptors.WrapperHelper.compileWrapperHelper(WrapperHelper.java:234) at org.apache.cxf.jaxws.interceptors.WrapperHelper.createWrapperHelper(WrapperHelper.java:210) at org.apache.cxf.jaxws.interceptors.WrapperHelper.createWrapperHelper(WrapperHelper.java:172) at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:96) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:73) 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:105) at org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:271) at org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:253) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) h.stolzenberg wrote: I recently upgraded to cxf-2.0.1-incubator. After that the following exception occured starting up my webapp: Error creating bean with name 'SpringSessionFactory' defined in ServletContext resource [/WEB-INF/classes/beans/persistence.context.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V at net.sf.cglib.core.DebuggingClassWriter.(DebuggingClassWriter.java:47) at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216) at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) at net.sf.cglib.proxy.Enhancer.(Enhancer.java:69) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:1
Logging the received generated SOAP Messages
What is the easiest way to log the received and generated SOAP messages. Currently I have an incoming/outgoing interceptor with phases receive/send that simply log some properties of the SoapMessage interceptor method param. What I want to log is the raw message data ( ... ). Mit lieben Grüßen aus dem eWerk | Holger Stolzenberg | Softwareentwickler | | Geschäftsführer: | Frank Richter, Erik Wende, Hendrik Schubert | | eWerk IT GmbH | Markt 16 | Leipzig 04109 | http://www.ewerk.com | HRB 9065, AG Leipzig | Hauptniederlassung Leipzig | | fon +49.341.4 26 49-0 | fax +49.341.4 26 49-88 | mailto:[EMAIL PROTECTED] | | Support: | fon 0700 CALLME24 (0700 22556324) | fax 0700 CALLME24 (0700 22556324) | | Auskünfte und Angebote per Mail | sind freibleibend und unverbindlich.
AW: Passing method parameters using PHP SoapClient failing
The PHP call to your WS method seems to be false. You have to provide a associative array for the WS method params. Following code shows how we do it: // the wsdl URL of your service to test $serviceWsdl = 'http://127.0.0.1:8080/EEX_Shop_Backend/ws-api/CustomerService?wsdl'; // the parmeters to initialize the client with $serviceParams = array( 'trace' => 1, 'soap_version' => SOAP_1_1, 'style' => SOAP_DOCUMENT, 'use' => SOAP_LITERAL ); // create the SOAP client $client = new SoapClient( $serviceWsdl, $serviceParams ); // method call $res = $client->getCustomerById( array( 'auth' => "passwd", 'customerId' => 2 ) ); var_dump( $res ); -Ursprüngliche Nachricht- Von: Kaleb Walton [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 23. August 2007 14:55 An: cxf-user@incubator.apache.org Betreff: Passing method parameters using PHP SoapClient failing As a requirement for our customers I'm trying to get SOAP communication going using PHPs SoapClient object. Calling methods with no parameters works fine (I get results) but when I pass in parameters I get a "Fault occurred while processing" error message returned which I assume is coming somewhere within the CXF framework. The PHP code is pretty simple: $client = new SoapClient('http://localhost:8080/services/Person?wsdl'); $client->testString('abc'); <-- This line returns an error message of 'Fault occurred while processing' Service object: @WebService(endpointInterface = "a.b.c.webservices.PersonService") public class PersonServiceImpl implements PersonService { public String testString(String id) { System.out.println("PersonServiceImpl: testString: "+id); return id; } } Config: http://localhost:8080/services/Person"/> Also, it looks like CXF uses Java's Logging implementation, however, I cannot seem to get it to log anywhere. Does anyone have any quick pointers on how to get that going? Regards, Kaleb Walton
HashMap as parameter for WS method
We have implemented a service that returns a HashMap: public HashMap doSomething(); Unfortunately the generated WSDL schema for the HashMap is not very straightforward (or maybe even false) and so our PHP client cannot interprete the service response (class mapping fails). Is there something special in order to produce a usable WSDL definition for the HashMap result (using JAXB databinding)? The same problem exists if we want to use a HashMap as parameter for a WS method. Mit lieben Grüßen aus dem eWerk | Holger Stolzenberg | Softwareentwickler | | Geschäftsführer: | Frank Richter, Erik Wende, Hendrik Schubert | | eWerk IT GmbH | Markt 16 | Leipzig 04109 | http://www.ewerk.com | HRB 9065, AG Leipzig | Hauptniederlassung Leipzig | | fon +49.341.4 26 49-0 | fax +49.341.4 26 49-88 | mailto:[EMAIL PROTECTED] | | Support: | fon 0700 CALLME24 (0700 22556324) | fax 0700 CALLME24 (0700 22556324) | | Auskünfte und Angebote per Mail | sind freibleibend und unverbindlich.
AW: cxf-2.0.1-incubator - dependency incompatibility with hibernate
The problem refers to version 2.0.1-INCUBATOR. Regarding the POM at http://people.apache.org/repo/m2-incubating-repository/org/apache/cxf/cxf-rt-frontend-jaxws/2.0.1-incubator/cxf-rt-frontend-jaxws-2.0.1-incubator.pom you can see that there is no version defined for 'asm' artifact so the highest available version will be used (unless otherwise defined), which causes the incompatibility to hibernate. -Ursprüngliche Nachricht- Von: Willem Jiang [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 24. August 2007 03:05 An: cxf-user@incubator.apache.org Betreff: Re: cxf-2.0.1-incubator - dependency incompatibility with hibernate AFAIK, current CXF trunk has upgrade the asm to 2.2.3 for better hibernate integration. You can try out the latest version or just use asm 2.xx to go around it. Willem. gdprao wrote: > Hi, > > I have tried the following workaround and could able to resolve this error. > > 1. Removed Hibernate's asm.jar,cglib-2.1.3.jar and asm-attrs.jar from > classpath. > 2. Placed cglib-nodep-2.1_3.jar in classpath (downloaded from > http://repo1.maven.org/maven2/cglib/cglib-nodep/2.1_3/). > 3. Included asm3.0.jar from CXF2.0.1 from distribution into the classpath. > > Both Hibernate and CXF errors are disappeared. > > Thanks, > Durga > > > gdprao wrote: > >> Hi Sotlzenberg, >> >> I am also facing the same exception after upgrading to CXF-2.0.1 with >> CXF asm jars which seems to be incompatible with hibernate jars. I >> don't have this issue when I am working with CXF-2.0 version. If I >> place asm jars that comes with hibernate, the Hibernate error >> disappears, but CXF service is breaking with the following exception >> at run time. Appreciate if someone could help me out on this? >> >> Thanks, >> Durga >> >> 14:19:31,667 ERROR [CXFServlet]:invoke(253) | Servlet.service() for >> servlet CXFServlet threw exception >> java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(I)V >> at >> org.apache.cxf.jaxws.interceptors.WrapperHelperCompiler.(WrapperHelperCompiler.java:79) >> at >> org.apache.cxf.jaxws.interceptors.WrapperHelperCompiler.compileWrapperHelper(WrapperHelperCompiler.java:89) >> at >> org.apache.cxf.jaxws.interceptors.WrapperHelper.compileWrapperHelper(WrapperHelper.java:234) >> at >> org.apache.cxf.jaxws.interceptors.WrapperHelper.createWrapperHelper(WrapperHelper.java:210) >> at >> org.apache.cxf.jaxws.interceptors.WrapperHelper.createWrapperHelper(WrapperHelper.java:172) >> at >> org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:96) >> at >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207) >> at >> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:73) >> 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:105) >> at >> org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.java:271) >> at >> org.apache.cxf.transport.servlet.CXFServlet.doGet(CXFServlet.java:253) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> >> >> >> >> >> >> h.stolzenberg wrote: >> >>> I recently upgraded to cxf-2.0.1-incubator. After that the following >>> exception occured starting up my webapp: >>> >>> Error creating bean with name 'SpringSessionFactory' defined in >>> ServletContext resource [/WEB-INF/classes/beans/persistence.context.xml]: >>> Invocation of init method failed; nested exception is >>> java.lang.NoSuchMethodError: >>> org.objectweb.asm.ClassWriter.(Z)V >>> Caused by: >>> java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V >>> at >>> net.sf.cglib.core.DebuggingClassWriter.(DebuggingClassWriter.java:47) >>> at >>> net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30) >>> at >>> net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24) >>> at >>> net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216) >>> at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145) >>> at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117) >>> at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) >>> at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) >>> at net.sf.cglib.proxy.Enhancer.(Enhancer.java:69) >>> at >>> org.hibernate.proxy.pojo.cglib.CGLIBLazyInitialize