Re: Test Fail when Exception implements Serializable
I have change "L" by "l" and I get the same error. It´s not the cause. Un saludo Jose Manuel Prieto 2016-01-28 13:31 GMT+01:00 John D. Ament : > Just wondering. Your definition uses long serialVersionUID = > 9179138257757325575L; This is an implicit type cast from Long to long. > Have you tried using a primitive long in the value, e.g. long > serialVersionUID = 9179138257757325575l; > > On Thu, Jan 28, 2016 at 7:20 AM José Manuel Prieto < > joseman...@prietopalacios.net> wrote: > > > HI, > > > > I Test with Jetty my CXF service implementation. > > At the end I comment the method "convertFaultBean", of class > > org.apache.cxf.interceptor.ClientFaultConverter. > > > > My test method is: > > ... > > @Test > > public void testMyWebService() { > > try { > > String address = "http://localhost:9000/ServiciosDocumento";; > > JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean(); > > svrFactory.setServiceClass(ServiciosDocumento.class); > > svrFactory.setAddress(address); > > svrFactory.setServiceBean(serviciosDocumentoClass); > > svrFactory.create(); > > > > JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); > > factory.setServiceClass(ServiciosDocumento.class); > > factory.setAddress(address); > > ServiciosDocumento client = (ServiciosDocumento) factory.create(); > > > > Documento doc = client.obtenerDocumento("1", 1); > > Assert.assertNotNull(doc); > > } catch (ServiceException e) { > > Assert.assertTrue(ExceptionUtils.getRootCauseMessage(e), false); > > } > > } > > ... > > > > Error in console: > > > > 13:06:56.872 [main] INFO o.a.c.i.ClientFaultConverter - Exception > occurred > > while creating exception: Can not set static final long field > > es.trafico.scgd.comun.exception.ServiceException.serialVersionUID to > > java.lang.Long > > java.lang.IllegalAccessException: Can not set static final long field > > es.trafico.scgd.comun.exception.ServiceException.serialVersionUID to > > java.lang.Long > > at > > > > > sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:76) > > ~[na:1.8.0_65] > > at > > > > > sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:80) > > ~[na:1.8.0_65] > > at > > > > > sun.reflect.UnsafeQualifiedStaticLongFieldAccessorImpl.set(UnsafeQualifiedStaticLongFieldAccessorImpl.java:77) > > ~[na:1.8.0_65] > > at java.lang.reflect.Field.set(Field.java:764) ~[na:1.8.0_65] > > at > > > > > org.apache.cxf.interceptor.ClientFaultConverter.convertFaultBean(ClientFaultConverter.java:348) > > [cxf-core-3.1.4.jar:3.1.4] > > ... > > > > My exception class, implements Serializable: > > > > @WebFault(faultBean = > "es.trafico.scgd.comun.dto.ServiceExceptionDetails", > > name = "ServiceExceptionDetails", targetNamespace = " > > http://scgd.trafico.es/servicios";) > > public class ServiceException extends Exception implements Serializable { > > > > /** > > * UID > > */ > > private static final long serialVersionUID = 9179138257757325575L; > > private ServiceExceptionDetails faultInfo; > > > > public ServiceException(String message) { > > super(message); > > } > > ... > > > > The class org.apache.cxf.interceptor.ClientFaultConverter: > > in the method: > > > > private Exception convertFaultBean(Class exClass, Object > faultBean, > > Fault fault) throws Exception { > > Constructor constructor = exClass.getConstructor(new > > Class[]{String.class}); > > // my coment: all Exception must be a constructor with String. I dont > know > > why. > > Exception e = (Exception)constructor.newInstance(new > > Object[]{fault.getMessage()}); > > > > //Copy fault bean fields to exception > > for (Class obj = exClass; !obj.equals(Object.class); obj = > > obj.getSuperclass()) { > > Field[] fields = obj.getDeclaredFields(); > > for (Field f : fields) { > > try { > > Field beanField = > > faultBean.getClass().getDeclaredField(f.getName()); > > // my comment: should be an IF, question about parameter: if has get/set > or > > if it is "static final" > > ReflectionUtil.setAccessible(beanField); > > ReflectionUtil.setAccessible(f); > > f.set(e, beanField.get(faultBean)); > > // my comment: ¿why try to set a private field serialVersionUID? > > } catch (NoSuchFieldException e1) { > > //do nothing > > } > > } > > } > > > > Thanks in advance. > > Jose Manuel Prieto > > >
Test Fail when Exception implements Serializable
HI, I Test with Jetty my CXF service implementation. At the end I comment the method "convertFaultBean", of class org.apache.cxf.interceptor.ClientFaultConverter. My test method is: ... @Test public void testMyWebService() { try { String address = "http://localhost:9000/ServiciosDocumento";; JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean(); svrFactory.setServiceClass(ServiciosDocumento.class); svrFactory.setAddress(address); svrFactory.setServiceBean(serviciosDocumentoClass); svrFactory.create(); JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setServiceClass(ServiciosDocumento.class); factory.setAddress(address); ServiciosDocumento client = (ServiciosDocumento) factory.create(); Documento doc = client.obtenerDocumento("1", 1); Assert.assertNotNull(doc); } catch (ServiceException e) { Assert.assertTrue(ExceptionUtils.getRootCauseMessage(e), false); } } ... Error in console: 13:06:56.872 [main] INFO o.a.c.i.ClientFaultConverter - Exception occurred while creating exception: Can not set static final long field es.trafico.scgd.comun.exception.ServiceException.serialVersionUID to java.lang.Long java.lang.IllegalAccessException: Can not set static final long field es.trafico.scgd.comun.exception.ServiceException.serialVersionUID to java.lang.Long at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:76) ~[na:1.8.0_65] at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(UnsafeFieldAccessorImpl.java:80) ~[na:1.8.0_65] at sun.reflect.UnsafeQualifiedStaticLongFieldAccessorImpl.set(UnsafeQualifiedStaticLongFieldAccessorImpl.java:77) ~[na:1.8.0_65] at java.lang.reflect.Field.set(Field.java:764) ~[na:1.8.0_65] at org.apache.cxf.interceptor.ClientFaultConverter.convertFaultBean(ClientFaultConverter.java:348) [cxf-core-3.1.4.jar:3.1.4] ... My exception class, implements Serializable: @WebFault(faultBean = "es.trafico.scgd.comun.dto.ServiceExceptionDetails", name = "ServiceExceptionDetails", targetNamespace = " http://scgd.trafico.es/servicios";) public class ServiceException extends Exception implements Serializable { /** * UID */ private static final long serialVersionUID = 9179138257757325575L; private ServiceExceptionDetails faultInfo; public ServiceException(String message) { super(message); } ... The class org.apache.cxf.interceptor.ClientFaultConverter: in the method: private Exception convertFaultBean(Class exClass, Object faultBean, Fault fault) throws Exception { Constructor constructor = exClass.getConstructor(new Class[]{String.class}); // my coment: all Exception must be a constructor with String. I dont know why. Exception e = (Exception)constructor.newInstance(new Object[]{fault.getMessage()}); //Copy fault bean fields to exception for (Class obj = exClass; !obj.equals(Object.class); obj = obj.getSuperclass()) { Field[] fields = obj.getDeclaredFields(); for (Field f : fields) { try { Field beanField = faultBean.getClass().getDeclaredField(f.getName()); // my comment: should be an IF, question about parameter: if has get/set or if it is "static final" ReflectionUtil.setAccessible(beanField); ReflectionUtil.setAccessible(f); f.set(e, beanField.get(faultBean)); // my comment: ¿why try to set a private field serialVersionUID? } catch (NoSuchFieldException e1) { //do nothing } } } Thanks in advance. Jose Manuel Prieto
Re: DefaultCryptoCoverageChecker property checkFaults
Hi Colm, I have downloaded and compiled the 2.7.x-fixes branch.(2.7.9-SNAPSHOT) I have run client test and test passed!! I confirm that is has been fixed. Thanks JMPrieto 2014-01-28 Colm O hEigeartaigh > Hi José, > > You have found a bug in CXF, that Dan has fixed: > > https://issues.apache.org/jira/browse/CXF-5527 > > If you want to confirm that is has been fixed, then you can try your > test-case with the latest CXF 2.7.9-SNAPSHOT code: > > http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/ > > Colm. > > > On Thu, Jan 23, 2014 at 12:29 PM, José Manuel Prieto < > joseman...@prietopalacios.net> wrote: > >> Hi Colm, >> >> I make a new very simple example. >> >> https://drive.google.com/file/d/0B9NfBsCykkXqX0wwbExSZEpEeEU/edit?usp=sharing >> >> Steps: >> 1.- in server folder: mvn install. Generate a war file >> 2.- Clean tomcat webapps/ old example, work/Catalina/*, temp/*. It solve >> a problem with "server.jks" and signed headers. >> 3.- Start tomcat. >> 4.- deploy war in tomcat. >> 5.- in >> CXF_checkFault/client/src/test/java/es/test/cxf/checkfault/client/ClientTest.java >> read comments and run tests. >> >> RESUME: >> When: >> Exception because the response header is not signed. Thats OK. >> >> When: >> Only SoapException reponses are OK >> Server Response OK, is returned in the test as null or 0. >> >> Thanks for your time >> JMPrieto >> >> >> 2014/1/21 Colm O hEigeartaigh >> >>> It seems the testcase is missing a dependency: >>> >>> [ERROR] Failed to execute goal on project identidad-paxaseMock: Could not >>> resolve dependencies for project >>> >>> es.depontevedra.soap.interoperabilidad.identidad:identidad-paxaseMock:war:0.0.1: >>> Could not find artifact >>> >>> es.depontevedra.soap.interoperabilidad.identidad:identidad-cliente_xunta_identidad:jar:0.0.1 >>> in central (http://repo.maven.apache.org/maven2) -> [Help 1] >>> >>> >>> In addition, I noticed that you are mixing CXF versions. The root CXF >>> version is 2.7.8, but in the pom for identidad-paxaseMock you have: >>> >>> >>> org.apache.cxf >>> cxf-rt-bindings-http >>> 2.5.11 >>> >>> >>> >>> org.apache.cxf >>> cxf-common-schemas >>> 2.3.11 >>> >>> >>> Colm. >>> >>> >>> On Thu, Jan 16, 2014 at 6:52 AM, José Manuel Prieto < >>> joseman...@prietopalacios.net> wrote: >>> >>> > Sorry, I explain: >>> > 1.- Start Tomcat. >>> > 2.- In folder "identidad-paxaseMock" run: mvn install. It generate a >>> war >>> > file. >>> > 3.- Deploy war file in Tomcat. >>> > 4.- In folder "identidad-cliente_xunta": >>> > - src/main/resources/spring/spring-client_paxase: it has the >>> > property "checkFaults". >>> > - Test to run (TestNG): >>> > - >>> > >>> > >>> es.depontevedra.soap.interoperabilidad.identidad.paxase.ClientPaxase.consultarIdentidad_prueba >>> > (OK) >>> > - >>> > >>> > >>> es.depontevedra.soap.interoperabilidad.identidad.paxase.ClientPaxase.consultarIdentidad_excepcion. >>> > (SoapFault, but test must OK) >>> > 5.- Change property "checkFault" and run again the tests. >>> > >>> > thanks >>> > JMPrieto >>> > >>> > >>> > 2014/1/15 José Manuel Prieto >>> > >>> > > Hi coheigea, >>> > > I left a project in Google Drive: >>> > > >>> > > >>> > > >>> > >>> https://drive.google.com/file/d/0B9NfBsCykkXqNWhielRla0ZiY00/edit?usp=sharing >>> > > >>> > > thanks >>> > > JMPrieto >>> > > >>> > > >>> > > 2014/1/15 Colm O hEigeartaigh >>> > > >>> > >> Could you create a test-case that shows the problem? >>> > >> >>> > >> Colm. >>> > >> >>> > >> >>> > >> On Wed, Jan 15, 2014 at 9:23 AM, José Manuel Prieto <
Re: DefaultCryptoCoverageChecker property checkFaults
Hi Colm, I make a new very simple example. https://drive.google.com/file/d/0B9NfBsCykkXqX0wwbExSZEpEeEU/edit?usp=sharing Steps: 1.- in server folder: mvn install. Generate a war file 2.- Clean tomcat webapps/ old example, work/Catalina/*, temp/*. It solve a problem with "server.jks" and signed headers. 3.- Start tomcat. 4.- deploy war in tomcat. 5.- in CXF_checkFault/client/src/test/java/es/test/cxf/checkfault/client/ClientTest.java read comments and run tests. RESUME: When: Exception because the response header is not signed. Thats OK. When: Only SoapException reponses are OK Server Response OK, is returned in the test as null or 0. Thanks for your time JMPrieto 2014/1/21 Colm O hEigeartaigh > It seems the testcase is missing a dependency: > > [ERROR] Failed to execute goal on project identidad-paxaseMock: Could not > resolve dependencies for project > > es.depontevedra.soap.interoperabilidad.identidad:identidad-paxaseMock:war:0.0.1: > Could not find artifact > > es.depontevedra.soap.interoperabilidad.identidad:identidad-cliente_xunta_identidad:jar:0.0.1 > in central (http://repo.maven.apache.org/maven2) -> [Help 1] > > > In addition, I noticed that you are mixing CXF versions. The root CXF > version is 2.7.8, but in the pom for identidad-paxaseMock you have: > > > org.apache.cxf > cxf-rt-bindings-http > 2.5.11 > > > > org.apache.cxf > cxf-common-schemas > 2.3.11 > > > Colm. > > > On Thu, Jan 16, 2014 at 6:52 AM, José Manuel Prieto < > joseman...@prietopalacios.net> wrote: > > > Sorry, I explain: > > 1.- Start Tomcat. > > 2.- In folder "identidad-paxaseMock" run: mvn install. It generate a war > > file. > > 3.- Deploy war file in Tomcat. > > 4.- In folder "identidad-cliente_xunta": > > - src/main/resources/spring/spring-client_paxase: it has the > > property "checkFaults". > > - Test to run (TestNG): > > - > > > > > es.depontevedra.soap.interoperabilidad.identidad.paxase.ClientPaxase.consultarIdentidad_prueba > > (OK) > > - > > > > > es.depontevedra.soap.interoperabilidad.identidad.paxase.ClientPaxase.consultarIdentidad_excepcion. > > (SoapFault, but test must OK) > > 5.- Change property "checkFault" and run again the tests. > > > > thanks > > JMPrieto > > > > > > 2014/1/15 José Manuel Prieto > > > > > Hi coheigea, > > > I left a project in Google Drive: > > > > > > > > > > > > https://drive.google.com/file/d/0B9NfBsCykkXqNWhielRla0ZiY00/edit?usp=sharing > > > > > > thanks > > > JMPrieto > > > > > > > > > 2014/1/15 Colm O hEigeartaigh > > > > > >> Could you create a test-case that shows the problem? > > >> > > >> Colm. > > >> > > >> > > >> On Wed, Jan 15, 2014 at 9:23 AM, José Manuel Prieto < > > >> joseman...@prietopalacios.net> wrote: > > >> > > >> > Unsolved > > >> > > > >> > I followed this steps: > > >> > 0.- Create diferent calls in spring file to > > >> DefaultCryptoCoverageChecker, > > >> > ref, bean, property --> no changes > > >> > 1.- I create a custom Interceptor --> no changes > > >> > public class CustomDefaultCryptoCoverageChecker extends > > >> > DefaultCryptoCoverageChecker { > > >> > > > >> > public CustomDefaultCryptoCoverageChecker(){ > > >> > setCheckFaults(false); > > >> > } > > >> > } > > >> > > > >> > 2.- Change jaxb library version: form jaxb-impl:2.2.5-2 to > > >> > jaxb-impl:2.1.13. --> no changes > > >> > 3.- Change spring library version form spring:3.0.5.RELEASE to > > >> > spring:3.2.6.RELEASE --> no changes > > >> > 4.- Continuing the trace, I get to: > > >> > DocLiteralInInterceptor.handleMessage(Message message){ > > >> >... > > >> >o = dr.read(p, xmlReader); call to --> > > >> > DataReaderImpl.read(MessagePartInfo part, T reader) > > >> >... > > >> > } > > >> > > > >> > DataReaderImpl.read(MessagePartInfo part, T reader){ > > >> >
Re: Log the Request and Response object from eclipse generated client
Hi Jeffrey, maybe this can help you: http://cxf.apache.org/javadoc/latest/org/apache/cxf/management/persistence/class-use/ExchangeDataDAO.html CXf implements some classes and interfaces to save information into DDBB. I write in my blog (spanish) about this: http://pupri.mycloudnas.com/2013/03/21/graba-en-bbdd-la-entrada-y-salida-en-el-log-del-web-service-con-apache-cxf/ Google translator is good. For interceptor to custom log, look for implementation of this class: org.apache.cxf.interceptor.LoggingInInterceptor org.apache.cxf.interceptor.LoggingOutInterceptor Get request or response SOAP and write into log. 2014/1/17 Jeffrey Born > Well after a few days struggling with this I'm back to trying to capture > the request object via the interceptor. I've managed to add the > interceptor to my code base and print the output stream. I'm not > knowledgeable with either Steams or Interceptors and would like to get a > few questions answered to hopefully get this data logged to the DB. > > So first a little more background into what I'm trying to do: I don't want > to log the request to the console or file or use log4j or Java's logger. > I'd like and object available to the web service client that can be logged > to the a database in a larger transaction that will also include the > response object. > > How do I gracefully expose a method or object to my main web service client > that can use the data in the interceptor? > > And I believe I want to morph the OutputStream into a printable object? > Basically what is the best object to save to the Database and how do you > get there from handleMessage in the interceptor? > > Thanks for the insights > > > On Tue, Jan 14, 2014 at 1:17 PM, Jeffrey Born wrote: > > > Ah, I missed that I should be adding the Client object via the > > getClient(port) method. > > > > Thanks much for nudging me in the correct direction. > > > > > > On Tue, Jan 14, 2014 at 12:35 PM, José Manuel Prieto < > > joseman...@prietopalacios.net> wrote: > > > >> > >> > http://cxf.apache.org/docs/debugging-and-logging.html#DebuggingandLogging-LoggingMessages > >> > >> Client client = ClientProxy.getClient(port); > >> client.getInInterceptors().add(new LoggingInInterceptor()); > >> client.getOutInterceptors().add(new LoggingOutInterceptor()) > >> > >> In spring application context: > >> > >> > >> > >> > >> > >> > >> or: > >> > >> > >> > >> > >> > >> http://cxf.apache.org/docs/bus-configuration.html > >> http://cxf.apache.org/docs/configuration-of-the-bus.html > >> > >> > http://www.ibm.com/developerworks/webservices/library/ws-apache-cxf-logging/index.html?ca= > >> > >> To create a custom log interceptor: > >> http://cxf.apache.org/docs/interceptors.html > >> > >> ;) > >> JMPrieto > >> > >> > >> > >> 2014/1/14 Jeffrey Born > >> > >> > Hi all, > >> > > >> > I am having problems figuring out how to log the Request and Response > >> > objects after successfully calling a .NET Web Service. I created the > >> > client using Eclipse Kepler that generated all the skeleton code for > me. > >> > I'm using the 2.7.8 version of CXF and Java jdk1.7.0_45. > >> > > >> > I've read a lot about interceptors and believe that is the way to go, > >> > however I can't figure out how to add an interceptor to what is > >> generated. > >> > Everything object generated in the client does not allow an > >> interceptor to > >> > be added. It's like everything got generated at too high of a level > >> for me > >> > to add interceptors. > >> > > >> > Not sure if this section of code will be useful to illustrate what I'm > >> > seeing, but including in hopes that it is: > >> > > >> > PhoneBookManagement ss = new PhoneBookManagement(wsdlURL, > SERVICE_NAME); > >> > PhoneBookManagementSoap port = ss.getPhoneBookManagementSoap(); > >> > > >> > > com.pbsystems.yellow.wsdl.v1x0.PhoneBookVerificationByPhoneNumberRequest > >> > _phoneBookVerificationByPhoneNumber_payload = new > >> > > >> > com.pbsystems.yellow.wsdl.v1x0.PhoneBookVerificationByPhoneNumberRequest(); > >> > > >> > I'd like to log the _phoneBookVerificationByPhoneNumber_payload SOAP > >> > request to the DB at this point, and all I see are my getters and > >> setters > >> > > >> > com.pbsystems.yellow.wsdl.v1x0.PhoneBookVerificationResponse > >> > _phoneBookVerificationByPhoneNumber__return = > >> > > >> > > >> > port.phoneBookVerificationByPhoneNumber(_phoneBookVerificationByPhoneNumber_payload); > >> > > >> > After the call to the service I'd now like to log the > >> > _phoneBookVerificationByPhoneNumber__return SOAP response object to > the > >> DB. > >> > > >> > Thanks for any help with this! > >> > > >> > > > > >
Re: DefaultCryptoCoverageChecker property checkFaults
Sorry, I explain: 1.- Start Tomcat. 2.- In folder "identidad-paxaseMock" run: mvn install. It generate a war file. 3.- Deploy war file in Tomcat. 4.- In folder "identidad-cliente_xunta": - src/main/resources/spring/spring-client_paxase: it has the property "checkFaults". - Test to run (TestNG): - es.depontevedra.soap.interoperabilidad.identidad.paxase.ClientPaxase.consultarIdentidad_prueba (OK) - es.depontevedra.soap.interoperabilidad.identidad.paxase.ClientPaxase.consultarIdentidad_excepcion. (SoapFault, but test must OK) 5.- Change property "checkFault" and run again the tests. thanks JMPrieto 2014/1/15 José Manuel Prieto > Hi coheigea, > I left a project in Google Drive: > > > https://drive.google.com/file/d/0B9NfBsCykkXqNWhielRla0ZiY00/edit?usp=sharing > > thanks > JMPrieto > > > 2014/1/15 Colm O hEigeartaigh > >> Could you create a test-case that shows the problem? >> >> Colm. >> >> >> On Wed, Jan 15, 2014 at 9:23 AM, José Manuel Prieto < >> joseman...@prietopalacios.net> wrote: >> >> > Unsolved >> > >> > I followed this steps: >> > 0.- Create diferent calls in spring file to >> DefaultCryptoCoverageChecker, >> > ref, bean, property --> no changes >> > 1.- I create a custom Interceptor --> no changes >> > public class CustomDefaultCryptoCoverageChecker extends >> > DefaultCryptoCoverageChecker { >> > >> > public CustomDefaultCryptoCoverageChecker(){ >> > setCheckFaults(false); >> > } >> > } >> > >> > 2.- Change jaxb library version: form jaxb-impl:2.2.5-2 to >> > jaxb-impl:2.1.13. --> no changes >> > 3.- Change spring library version form spring:3.0.5.RELEASE to >> > spring:3.2.6.RELEASE --> no changes >> > 4.- Continuing the trace, I get to: >> > DocLiteralInInterceptor.handleMessage(Message message){ >> >... >> >o = dr.read(p, xmlReader); call to --> >> > DataReaderImpl.read(MessagePartInfo part, T reader) >> >... >> > } >> > >> > DataReaderImpl.read(MessagePartInfo part, T reader){ >> >return JAXBEncoderDecoder.unmarshall(createUnmarshaller(), reader, >> part, >> > unwrapJAXBElement); >> > } >> > >> > Who instance JAXB? spring?. >> > Why only one parameter change my wolrd? >> > >> > thanks for readme >> > JMPrieto >> > >> > >> > >> > 2014/1/14 José Manuel Prieto >> > >> > > Hello, >> > > >> > > If I put property checkFaults="false" (in sringframework application >> > > context file), only SoapFault Messages runs as expected. >> > > My service return a Response object. The service response is 200 (OK), >> > > send me a Response (I see it, in the server-log), my client obtain a >> > > Response object but, all atributes to null. >> > > >> > > I trace until to SoapHeaderInterceptor.handleMessage(Message m). This >> > > methods contains: >> > > public void handleMessage(Message m) throws Fault { >> > > SoapMessage message = (SoapMessage) m; >> > > SoapVersion soapVersion = message.getVersion(); >> > > Exchange exchange = message.getExchange(); >> > > >> > > MessageContentsList parameters = >> > > MessageContentsList.getContentsList(message); >> > > >> > > >> > > When checkFaults="true", the var parameters(MessageContentsList) has a >> > > List [size=1] with Response object and atributes with some values. >> > > When checkFaults="false", the var parameters(MessageContentsList) has >> a >> > > List [size=1] with Response object and atributes to NULL. >> > > >> > > I thought it was a problem with springframework, but now i don´t now. >> > > can anybody help me? >> > > >> > > Thanks in advance >> > > JMPrieto >> > > >> > > >> > > >> > > >> > > >> > >> >> >> >> -- >> Colm O hEigeartaigh >> >> Talend Community Coder >> http://coders.talend.com >> > >
Re: DefaultCryptoCoverageChecker property checkFaults
Hi coheigea, I left a project in Google Drive: https://drive.google.com/file/d/0B9NfBsCykkXqNWhielRla0ZiY00/edit?usp=sharing thanks JMPrieto 2014/1/15 Colm O hEigeartaigh > Could you create a test-case that shows the problem? > > Colm. > > > On Wed, Jan 15, 2014 at 9:23 AM, José Manuel Prieto < > joseman...@prietopalacios.net> wrote: > > > Unsolved > > > > I followed this steps: > > 0.- Create diferent calls in spring file to DefaultCryptoCoverageChecker, > > ref, bean, property --> no changes > > 1.- I create a custom Interceptor --> no changes > > public class CustomDefaultCryptoCoverageChecker extends > > DefaultCryptoCoverageChecker { > > > > public CustomDefaultCryptoCoverageChecker(){ > > setCheckFaults(false); > > } > > } > > > > 2.- Change jaxb library version: form jaxb-impl:2.2.5-2 to > > jaxb-impl:2.1.13. --> no changes > > 3.- Change spring library version form spring:3.0.5.RELEASE to > > spring:3.2.6.RELEASE --> no changes > > 4.- Continuing the trace, I get to: > > DocLiteralInInterceptor.handleMessage(Message message){ > >... > >o = dr.read(p, xmlReader); call to --> > > DataReaderImpl.read(MessagePartInfo part, T reader) > >... > > } > > > > DataReaderImpl.read(MessagePartInfo part, T reader){ > >return JAXBEncoderDecoder.unmarshall(createUnmarshaller(), reader, > part, > > unwrapJAXBElement); > > } > > > > Who instance JAXB? spring?. > > Why only one parameter change my wolrd? > > > > thanks for readme > > JMPrieto > > > > > > > > 2014/1/14 José Manuel Prieto > > > > > Hello, > > > > > > If I put property checkFaults="false" (in sringframework application > > > context file), only SoapFault Messages runs as expected. > > > My service return a Response object. The service response is 200 (OK), > > > send me a Response (I see it, in the server-log), my client obtain a > > > Response object but, all atributes to null. > > > > > > I trace until to SoapHeaderInterceptor.handleMessage(Message m). This > > > methods contains: > > > public void handleMessage(Message m) throws Fault { > > > SoapMessage message = (SoapMessage) m; > > > SoapVersion soapVersion = message.getVersion(); > > > Exchange exchange = message.getExchange(); > > > > > > MessageContentsList parameters = > > > MessageContentsList.getContentsList(message); > > > > > > > > > When checkFaults="true", the var parameters(MessageContentsList) has a > > > List [size=1] with Response object and atributes with some values. > > > When checkFaults="false", the var parameters(MessageContentsList) has a > > > List [size=1] with Response object and atributes to NULL. > > > > > > I thought it was a problem with springframework, but now i don´t now. > > > can anybody help me? > > > > > > Thanks in advance > > > JMPrieto > > > > > > > > > > > > > > > > > > > > > -- > Colm O hEigeartaigh > > Talend Community Coder > http://coders.talend.com >
Re: DefaultCryptoCoverageChecker property checkFaults
Unsolved I followed this steps: 0.- Create diferent calls in spring file to DefaultCryptoCoverageChecker, ref, bean, property --> no changes 1.- I create a custom Interceptor --> no changes public class CustomDefaultCryptoCoverageChecker extends DefaultCryptoCoverageChecker { public CustomDefaultCryptoCoverageChecker(){ setCheckFaults(false); } } 2.- Change jaxb library version: form jaxb-impl:2.2.5-2 to jaxb-impl:2.1.13. --> no changes 3.- Change spring library version form spring:3.0.5.RELEASE to spring:3.2.6.RELEASE --> no changes 4.- Continuing the trace, I get to: DocLiteralInInterceptor.handleMessage(Message message){ ... o = dr.read(p, xmlReader); call to --> DataReaderImpl.read(MessagePartInfo part, T reader) ... } DataReaderImpl.read(MessagePartInfo part, T reader){ return JAXBEncoderDecoder.unmarshall(createUnmarshaller(), reader, part, unwrapJAXBElement); } Who instance JAXB? spring?. Why only one parameter change my wolrd? thanks for readme JMPrieto 2014/1/14 José Manuel Prieto > Hello, > > If I put property checkFaults="false" (in sringframework application > context file), only SoapFault Messages runs as expected. > My service return a Response object. The service response is 200 (OK), > send me a Response (I see it, in the server-log), my client obtain a > Response object but, all atributes to null. > > I trace until to SoapHeaderInterceptor.handleMessage(Message m). This > methods contains: > public void handleMessage(Message m) throws Fault { > SoapMessage message = (SoapMessage) m; > SoapVersion soapVersion = message.getVersion(); > Exchange exchange = message.getExchange(); > > MessageContentsList parameters = > MessageContentsList.getContentsList(message); > > > When checkFaults="true", the var parameters(MessageContentsList) has a > List [size=1] with Response object and atributes with some values. > When checkFaults="false", the var parameters(MessageContentsList) has a > List [size=1] with Response object and atributes to NULL. > > I thought it was a problem with springframework, but now i don´t now. > can anybody help me? > > Thanks in advance > JMPrieto > > > > >
Re: Log the Request and Response object from eclipse generated client
http://cxf.apache.org/docs/debugging-and-logging.html#DebuggingandLogging-LoggingMessages Client client = ClientProxy.getClient(port); client.getInInterceptors().add(new LoggingInInterceptor()); client.getOutInterceptors().add(new LoggingOutInterceptor()) In spring application context: or: http://cxf.apache.org/docs/bus-configuration.html http://cxf.apache.org/docs/configuration-of-the-bus.html http://www.ibm.com/developerworks/webservices/library/ws-apache-cxf-logging/index.html?ca= To create a custom log interceptor: http://cxf.apache.org/docs/interceptors.html ;) JMPrieto 2014/1/14 Jeffrey Born > Hi all, > > I am having problems figuring out how to log the Request and Response > objects after successfully calling a .NET Web Service. I created the > client using Eclipse Kepler that generated all the skeleton code for me. > I'm using the 2.7.8 version of CXF and Java jdk1.7.0_45. > > I've read a lot about interceptors and believe that is the way to go, > however I can't figure out how to add an interceptor to what is generated. > Everything object generated in the client does not allow an interceptor to > be added. It's like everything got generated at too high of a level for me > to add interceptors. > > Not sure if this section of code will be useful to illustrate what I'm > seeing, but including in hopes that it is: > > PhoneBookManagement ss = new PhoneBookManagement(wsdlURL, SERVICE_NAME); > PhoneBookManagementSoap port = ss.getPhoneBookManagementSoap(); > > com.pbsystems.yellow.wsdl.v1x0.PhoneBookVerificationByPhoneNumberRequest > _phoneBookVerificationByPhoneNumber_payload = new > com.pbsystems.yellow.wsdl.v1x0.PhoneBookVerificationByPhoneNumberRequest(); > > I'd like to log the _phoneBookVerificationByPhoneNumber_payload SOAP > request to the DB at this point, and all I see are my getters and setters > > com.pbsystems.yellow.wsdl.v1x0.PhoneBookVerificationResponse > _phoneBookVerificationByPhoneNumber__return = > > port.phoneBookVerificationByPhoneNumber(_phoneBookVerificationByPhoneNumber_payload); > > After the call to the service I'd now like to log the > _phoneBookVerificationByPhoneNumber__return SOAP response object to the DB. > > Thanks for any help with this! >
DefaultCryptoCoverageChecker property checkFaults
Hello, If I put property checkFaults="false" (in sringframework application context file), only SoapFault Messages runs as expected. My service return a Response object. The service response is 200 (OK), send me a Response (I see it, in the server-log), my client obtain a Response object but, all atributes to null. I trace until to SoapHeaderInterceptor.handleMessage(Message m). This methods contains: public void handleMessage(Message m) throws Fault { SoapMessage message = (SoapMessage) m; SoapVersion soapVersion = message.getVersion(); Exchange exchange = message.getExchange(); MessageContentsList parameters = MessageContentsList.getContentsList(message); When checkFaults="true", the var parameters(MessageContentsList) has a List [size=1] with Response object and atributes with some values. When checkFaults="false", the var parameters(MessageContentsList) has a List [size=1] with Response object and atributes to NULL. I thought it was a problem with springframework, but now i don´t now. can anybody help me? Thanks in advance JMPrieto