Re: WS-Addressing + CXF 2.7.8 memory leak

2014-01-14 Thread David Karlsen
The latter sounds reasonable to make clients aware of violation of
protocol, but probably as a configurable option (strict mode?). Spec does
not tell how server should behave in these cases?
14. jan. 2014 00:21 skrev Daniel Kulp dk...@apache.org følgende:


 On Jan 13, 2014, at 2:52 PM, Jose María Zaragoza demablo...@gmail.com
 wrote:

  2014/1/13 Daniel Kulp dk...@apache.org:
 
  These are showing that the RelatesTo header wasn’t there or similar as
 it couldn’t correlate the response message to a request.That is
 certainly the cause of the “leak” as the WS-Addressing stuff is not seeing
 a proper response to the request.
 
 
  Thanks Daniel for you reply
 
  In any case, if I don't use WS-Addressing , responses are correlated
  to a request , even the JAX-WS proxy client is shared by many threads.
  I don't know how Apache CXF do it but, would be possible to follow the
  same correlation rule if RelatesTo header is not present in responses
  ?

 Digging through the code, there certainly doesn’t look like an easy way.
 You’d likely need to write an interceptor that would grab the headers from
 the message, loop through, and if there isn’t a RelatesTo header, it either
 adds one or deletes all the addressing headers.

  I would like to protect my webservice against malformed remote responses

 Well, there is the question of what SHOULD CXF be doing with this.   An
 argument certainly could be made that CXF should be throwing an exception
 at this point for a malformed Addressing message.   However, if that
 occurred, the response wouldn’t be processed at all and the client would
 get the exception.

 --
 Daniel Kulp
 dk...@apache.org - http://dankulp.com/blog
 Talend Community Coder - http://coders.talend.com





Re: JAXRS service with CXF KerberosAuthenticationFilter

2014-01-14 Thread Paul O'Brien
The client is a web browser and we can live with it, just wanted to ensure
it wasn't an unexpected error.

On Monday, 13 January 2014, Sergey Beryozkin wrote:

 Hi,
 On 13/01/14 10:46, Paul O'Brien wrote:

 Thanks Sergey,

 Your information was helpful and I narrowed the problem down to the
 -Djava.security.auth.login.config environment variable not being
 configured
 in my environment, setting this has got everything working.

 Note that I do get the same exception even though it's working, it appears
 to be generated as part of the Negotiate handshake process. When a client
 generates a service request the server raises a NotAuthorizedException in
 the tomcat server console while the retry attempt (with the token)
 succeeds.

 Given the way the negotiate protocol works I expect this to be the
 expected
 behavior, any reason to believe this isn't the case?


 I guess if it is possible to configure the client to immediately include a
 token then it is avoidable, I think we can do it with CXF clients, do you
 use CXF on the client side ?

 Cheers, Sergey



 On 13 January 2014 09:48, Sergey Beryozkin sberyoz...@gmail.com wrote:

  FYI, this is how it is picked up in the test:

 String jaasConfig = JAXRSKerberosBookTest.class

 .getResource(/org/apache/cxf/systest/jaxrs/security/
 kerberos.cfg).toURI().getPath();
  System.setProperty(java.security.auth.login.config,
 jaasConfig);

 You may want to try to move the config file to main resources, so that it
 will end up in WEB-INF/classes, it must be something to do with the
 resource location,

 Cheers, Sergey


 On 12/01/14 19:22, Sergey Beryozkin wrote:

  Hi

 It does seem that a context configuration is not found,
 It is unfortunate that only the LoginException handler loses the
 exception info, the other handlers at least log the exception message, I
 will fix it, in meantime I can only suggest to either
 - try to debug with the CXF source, that would be the best option
 - try to register javax.security.auth.login.Configuration implementation
 (via the loginConfig property) instead of setting the loginContextName
 property

 Give it a try please and let us know the result, we can try and narrow
 the problem somehow if the above does not help
 Cheers, Sergey

 On 08/01/14 10:00, Paul O'Brien wrote:

  Hi All,

 Trying to setup CXF JAXRS with Kerberos authentication (Active Directory
 KDC), the CXF endpoint works fine however I'm unable to successfully
 authenticate once the Kerberos Filter is activated.

 Using the sample code on the Apache CXF project homepage as a guide:
 http://cxf.apache.org/docs/jaxrs-kerberos.html

 My project cxf-servlet.conf file has the Kerberos filter enabled as per
 below:

 bean id=kerberosFilter
 class=org.apache.cxf.jaxrs.security.KerberosAuthenticationFilter
 property name=loginContextName value=KerberosServer/
 /bean

 jaxrs:server
 jaxrs:serviceBeans
 bean class=org.mycompany.MyCompanyResource/
 /jaxrs:serviceBeans
 jaxrs:providers
 ref bean=kerberosFilter
 /jaxrs:providers
 /jaxrs:server

 My jaas.conf file has been placed in the /src/main/webapp/WEB-INF
 directory
 and contains the following:

 KerberosServer {
 com.sun.security.auth.module.Krb5LoginModule required storeKey=true;
 };
 KerberosServerKeyTab {
 com.sun.security.auth.module.Krb5LoginModule required
 storeKey=true
 refreshKrb5Config=true
 useKeyTab=true
 keyTab=/etc/tomcat.keytab
 principal=HTTP/Hosting Workstation name@Valid REALM;
 };

 However the following exception is received when making a call against
 the
 protected service:
 Jan 08, 2014 3:57:01 PM
 org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper toResponse
 WARNING: javax.ws.rs.NotAuthorizedException
 at
 org.apache.cxf.jaxrs.security.KerberosAuthenticationFilter.
 handleRequest(KerberosAuthenticationFilter.java:117)

 at
 org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(
 JAXRSInInterceptor.java:208)

 at
 org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(
 JAXRSInInterceptor.java:90)

 at
 org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
 PhaseInterceptorChain.java:272)

 at
 org.apache.cxf.transport.ChainInitiationObserver.onMessage(
 ChainInitiationObserver.java:121)

 at
 org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(
 AbstractHTTPDestination.java:239)

 at
 org.apache.cxf.transport.servlet.ServletController.invokeDestination(
 ServletController.java:248)

 at
 org.apache.cxf.transport.servlet.ServletController.
 invoke(ServletController.java:222)

 at
 org.apache.cxf.transport.servlet.ServletController.
 invoke(ServletController.java:1




RE: CXF - JAAS

2014-01-14 Thread blacar
At the end i was able to set this up thanks to your advices and some google.

I used JAAS and CXF JAASAuthenticationFilter.
To not overcomplicate things i've used BASIC authentication using property
file to store credentials in plain text.

The only point here is to be aware of Base64 encode the username:password
and sent it on the authorization header. Then AuthorizationPolicy is
correctly instantiated and NamePasswordCallbackHandler is called.

The other point was to link all this with Jetty server ... it took me a
while, but at the end was very easy since the only i have to do is set a
system property java.security.auth.login.config pointing to my jaas login
config file where i declared the login modules i need.



--
View this message in context: 
http://cxf.547215.n5.nabble.com/RE-CXF-JAAS-tp5738439p5738526.html
Sent from the cxf-user mailing list archive at Nabble.com.


SecureAnnotationsInterceptor using non default annotation

2014-01-14 Thread blacar
Hello,

How can i setup a different annotation for checking authorization with
SecureAnnotationsInterceptor?

By default it expects javax.annotation.security.RolesAllowed but since it
is not part of Java SE i am not able to use it. However i've read that i
could use a different annotation ... it checks RolesAllowed annotations by
default but one can provide the annotation class name used to specify the
roles.

How can this be done?

Thanks in advance,

RBC



--
View this message in context: 
http://cxf.547215.n5.nabble.com/SecureAnnotationsInterceptor-using-non-default-annotation-tp5738528.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: SecureAnnotationsInterceptor using non default annotation

2014-01-14 Thread Sergey Beryozkin

Hi
On 14/01/14 10:54, blacar wrote:

Hello,

How can i setup a different annotation for checking authorization with
SecureAnnotationsInterceptor?

By default it expects javax.annotation.security.RolesAllowed but since it
is not part of Java SE i am not able to use it. However i've read that i
could use a different annotation ... it checks RolesAllowed annotations by
default but one can provide the annotation class name used to specify the
roles.


Use an 'annotationClassName' property

Cheers, Sergey


How can this be done?

Thanks in advance,

RBC



--
View this message in context: 
http://cxf.547215.n5.nabble.com/SecureAnnotationsInterceptor-using-non-default-annotation-tp5738528.html
Sent from the cxf-user mailing list archive at Nabble.com.





Re: NON-SPRING JSON array serialization workaround please??

2014-01-14 Thread rpd
Hi,

Thanks a lot for the reply. We are using the non Spring Servlet.  Presumably, 
then, in web.xml I would need only to include the entry...

 init-param
    param-namejaxrs.properties/param-name
   param-value
  serializeAsArray=true
   /param-value
 /init-param

Is that it?

Rob

 


 From: Sergey Beryozkin [via CXF] ml-node+s547215n5738478...@n5.nabble.com
To: rpd robpodol...@yahoo.co.uk 
Sent: Sunday, 12 January 2014, 18:24
Subject: Re: NON-SPRING JSON array serialization workaround please??
  


Hi 

You can use CXFNonSpringJaxrsServlet where JSONProvider is configured 
via either custom JAX-RS Application or declaratively, see 
http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAX-RSservicesincontainerwithoutSpring

Cheers, Sergey 
On 10/01/14 12:11, rpd wrote: 




-- 
Sergey Beryozkin 

Talend Community Coders 
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com/





 
If you reply to this email, your message will be added to the discussion below: 
http://cxf.547215.n5.nabble.com/NON-SPRING-JSON-array-serialization-workaround-please-tp5738442p5738478.html
  
To unsubscribe from NON-SPRING JSON array serialization workaround please??, 
click here.
NAML



--
View this message in context: 
http://cxf.547215.n5.nabble.com/NON-SPRING-JSON-array-serialization-workaround-please-tp5738442p5738534.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: NON-SPRING JSON array serialization workaround please??

2014-01-14 Thread Sergey Beryozkin

Hi
On 14/01/14 11:34, rpd wrote:

Hi,

Thanks a lot for the reply. We are using the non Spring Servlet.  Presumably, 
then, in web.xml I would need only to include the entry...

  init-param
 param-namejaxrs.properties/param-name
param-value
   serializeAsArray=true
/param-value
  /init-param

Is that it?

No, the above would set the endpoint properties, JSONProvider does not 
check them, one can do it like this:


init-param
  param-namejaxrs.providers/param-name
  param-value
org.apache.cxf.systest.jaxrs.BookStoreProvider1
org.apache.cxf.systest.jaxrs.BookStoreProvider2(a=b c=d)
  /param-value
 /init-param

In this case though it won't help actually, it is only possible to 
inject simple non-collection properties and the arrayKeys JSONProvider 
property is a list. I can see it can be supported easily enough too, but 
not at the moment.


The only way then for now is to register a custom JAX-RS Application 
when you can directly configure the provider


Cheers, Sergey


Rob




  From: Sergey Beryozkin [via CXF] ml-node+s547215n5738478...@n5.nabble.com
To: rpd robpodol...@yahoo.co.uk
Sent: Sunday, 12 January 2014, 18:24
Subject: Re: NON-SPRING JSON array serialization workaround please??



Hi

You can use CXFNonSpringJaxrsServlet where JSONProvider is configured
via either custom JAX-RS Application or declaratively, see
http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAX-RSservicesincontainerwithoutSpring

Cheers, Sergey
On 10/01/14 12:11, rpd wrote:








Re: NON-SPRING JSON array serialization workaround please??

2014-01-14 Thread Sergey Beryozkin
I was wrong, in fact it is already being tested, you need to do 
something like:


init-param
param-namejaxrs.providers/param-name
param-value
   org.apache.cxf.jaxrs.provider.json.JSONProvider(
 dropRootElement=false
 attributesToElements=true
 arrayKeys=a
 arrayKeys=b
   ),

org.apache.cxf.jaxrs.provider.JAXBElementProvider
  /param-value
/init-param

But going the Application way will offer a more flexible approach (in 
case you need to setup some Map properties, etc)


Cheers, Sergey

On 14/01/14 12:11, Sergey Beryozkin wrote:

Hi
On 14/01/14 11:34, rpd wrote:

Hi,

Thanks a lot for the reply. We are using the non Spring Servlet.
Presumably, then, in web.xml I would need only to include the entry...

  init-param
 param-namejaxrs.properties/param-name
param-value
   serializeAsArray=true
/param-value
  /init-param

Is that it?


No, the above would set the endpoint properties, JSONProvider does not
check them, one can do it like this:

init-param
   param-namejaxrs.providers/param-name
   param-value
 org.apache.cxf.systest.jaxrs.BookStoreProvider1
 org.apache.cxf.systest.jaxrs.BookStoreProvider2(a=b c=d)
   /param-value
  /init-param

In this case though it won't help actually, it is only possible to
inject simple non-collection properties and the arrayKeys JSONProvider
property is a list. I can see it can be supported easily enough too, but
not at the moment.

The only way then for now is to register a custom JAX-RS Application
when you can directly configure the provider

Cheers, Sergey


Rob




  From: Sergey Beryozkin [via CXF]
ml-node+s547215n5738478...@n5.nabble.com
To: rpd robpodol...@yahoo.co.uk
Sent: Sunday, 12 January 2014, 18:24
Subject: Re: NON-SPRING JSON array serialization workaround please??



Hi

You can use CXFNonSpringJaxrsServlet where JSONProvider is configured
via either custom JAX-RS Application or declaratively, see
http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAX-RSservicesincontainerwithoutSpring


Cheers, Sergey
On 10/01/14 12:11, rpd wrote:









--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com


Re: SecureAnnotationsInterceptor using non default annotation

2014-01-14 Thread blacar
Hi Sergey,

I've created a custom annotation. My intention is to use it as
@Secured(admin). I've configured it as you told and i can see it defined
at runtime as annotationClassName attribute ... so, Thanks!

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface Secured {
public String[] value();
}


However i am still missing something. :P

I see interceptor is called, target method is correct but getExpectedRoles
returns empty list, so authorization is always granted; and this is (i
guess) because methodRolesMap is empty and i think it shouldn't ... but i
don't know whats the missing piece.

This is what i added to my application context:

bean id=authorizationFilter
class=org.apache.cxf.jaxrs.security.SimpleAuthorizingFilter
property name=interceptor ref=authorizationInterceptor/
/bean

bean id=authorizationInterceptor

class=org.apache.cxf.interceptor.security.SecureAnnotationsInterceptor
property name=securedObject ref=serviceImpl /
property name=annotationClassName
value=com.blacar.apps.spike.cxf.jaxrs.Secured /
/bean

where serviceImpl is my JAX-RS annotated class with a method holding the
@Secured(admin)

Cheers,




--
View this message in context: 
http://cxf.547215.n5.nabble.com/SecureAnnotationsInterceptor-using-non-default-annotation-tp5738528p5738541.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: SecureAnnotationsInterceptor using non default annotation

2014-01-14 Thread Sergey Beryozkin

Hi
On 14/01/14 13:22, blacar wrote:

Hi Sergey,

I've created a custom annotation. My intention is to use it as
@Secured(admin). I've configured it as you told and i can see it defined
at runtime as annotationClassName attribute ... so, Thanks!

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface Secured {
public String[] value();
}


However i am still missing something. :P

I see interceptor is called, target method is correct but getExpectedRoles
returns empty list, so authorization is always granted; and this is (i
guess) because methodRolesMap is empty and i think it shouldn't ... but i
don't know whats the missing piece.

This is what i added to my application context:

bean id=authorizationFilter
class=org.apache.cxf.jaxrs.security.SimpleAuthorizingFilter
property name=interceptor ref=authorizationInterceptor/
/bean

bean id=authorizationInterceptor

class=org.apache.cxf.interceptor.security.SecureAnnotationsInterceptor
property name=securedObject ref=serviceImpl /
property name=annotationClassName
value=com.blacar.apps.spike.cxf.jaxrs.Secured /
/bean

where serviceImpl is my JAX-RS annotated class with a method holding the
@Secured(admin)

I suspect it is to do with the ordering of properties, at the moment 
when a securedObject property is set then it is checked immediately, it 
will need to be fixed for the ordering not making a difference, but for 
now please set the annotationClassName first and it will work


Cheers, Sergey


Cheers,




--
View this message in context: 
http://cxf.547215.n5.nabble.com/SecureAnnotationsInterceptor-using-non-default-annotation-tp5738528p5738541.html
Sent from the cxf-user mailing list archive at Nabble.com.




--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com


Re: SecureAnnotationsInterceptor using non default annotation

2014-01-14 Thread blacar
I am not sure but it looks like findRoles code is executed before
annotationClassName is setted with the new value then the methodRolesAllowed
gets fill with wrong information.

I'll have to confirm this point.



--
View this message in context: 
http://cxf.547215.n5.nabble.com/SecureAnnotationsInterceptor-using-non-default-annotation-tp5738528p5738543.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: SecureAnnotationsInterceptor using non default annotation

2014-01-14 Thread blacar
Yes ... changing the order of the properties fixes it.

Thanks!



--
View this message in context: 
http://cxf.547215.n5.nabble.com/SecureAnnotationsInterceptor-using-non-default-annotation-tp5738528p5738544.html
Sent from the cxf-user mailing list archive at Nabble.com.


Error reading XMLStreamReader @ SOAPUI but works fine in browser

2014-01-14 Thread harilal.a.s
Hi,
We have a spring-cxf ( Spring 3.0.4, CXF 2.5.10, Java 6) web service
application deployed in WAS 8.0.0.7 @ Linux machine. We are able to access
all services through soap ui by directly using ip on url (through Linux IP
in which application installed). Now the app server is behind the Web server
(iplanet,  configured by client) and now the issue comes(we are using https
to hit the web server where as web server to app server is http).
We are able to see xml content in browser using the url provided by client
but when we access the web service through SOAPUI we are getting Error
reading XMLStreamReader. and following exception in WAS log

--
[1/14/14 5:14:34:375 GMT] 0040 AccDetailsInt I
org.apache.cxf.services.AccountDetailsWSService.AccountDetailsWSPort.AccDetailsInt
 
Inbound Message


ID: 13
Address: https://{ip:port}/infox/services/AccountDetailsWSPort
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml;charset=UTF-8
Headers: {$WSCS=[SSL_RSA_WITH_RC4_128_MD5-128], $WSIS=[true],
$WSPR=[HTTP/1.1], $WSRA=[10.203.118.218], $WSRH=[10.203.118.218],
$WSSC=[https],
$WSSI=[Q1IrQ29oeGJCMFNHRWFPNzdBYjBRSU1RNEVZd3RWSHhlVWJyRGtnaDBEWT0=],
$WSSN=[ip], $WSSP=[2006], _WS_HAPRT_WLMVERSION=[-1],
accept-encoding=[gzip,deflate], conten-lengtth=[1594],
content-type=[text/xml;charset=UTF-8], Host=[{ip:port}],
SOAPAction=[urn:GetAccountProfile],
Surrogate-Capability=[WS-ESI=ESI/1.0+],
User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
--

[1/14/14 5:14:34:376 GMT] 0040 SystemOut O Request XML : 
[1/14/14 5:14:34:376 GMT] 0040 PhaseIntercep W
org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging Interceptor for
{http://wsbroker.core.infx.com/}AccountDetailsWSService has thrown
exception, unwinding now
 org.apache.cxf.binding.soap.SoapFault:
Error reading XMLStreamReader.
at
org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:139)
at
org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:102)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:233)
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:214)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:194)
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:223)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:143)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:199)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:909)
at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
   

Re: NON-SPRING JSON array serialization workaround please??

2014-01-14 Thread rpd
Ok thanks - will investigate this too.  Rob
 


 From: Sergey Beryozkin [via CXF] ml-node+s547215n5738536...@n5.nabble.com
To: rpd robpodol...@yahoo.co.uk 
Sent: Tuesday, 14 January 2014, 12:25
Subject: Re: NON-SPRING JSON array serialization workaround please??
  


I was wrong, in fact it is already being tested, you need to do 
something like: 

init-param 
             param-namejaxrs.providers/param-name 
             param-value 
                            org.apache.cxf.jaxrs.provider.json.JSONProvider( 
                              dropRootElement=false 
                              attributesToElements=true 
                              arrayKeys=a 
                              arrayKeys=b 
                            ), 
  
org.apache.cxf.jaxrs.provider.JAXBElementProvider 
                       /param-value 
         /init-param 

But going the Application way will offer a more flexible approach (in 
case you need to setup some Map properties, etc) 

Cheers, Sergey 

On 14/01/14 12:11, Sergey Beryozkin wrote: 




-- 
Sergey Beryozkin 

Talend Community Coders 
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com/





 
If you reply to this email, your message will be added to the discussion below: 
http://cxf.547215.n5.nabble.com/NON-SPRING-JSON-array-serialization-workaround-please-tp5738442p5738536.html
 
To unsubscribe from NON-SPRING JSON array serialization workaround please??, 
click here.
NAML



--
View this message in context: 
http://cxf.547215.n5.nabble.com/NON-SPRING-JSON-array-serialization-workaround-please-tp5738442p5738546.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: NON-SPRING JSON array serialization workaround please??

2014-01-14 Thread rpd
Thanks - useful to know and it would indeed be a handy feature to be able to do 
this.  By writing my own application do you mean that I would follow...

http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAX-RSservicesprogrammatically

using specifically the JAXRSServerFactoryBean? Would this be outside of my 
web-container (Tomcat)?

Rob
 


 From: Sergey Beryozkin [via CXF] ml-node+s547215n5738535...@n5.nabble.com
To: rpd robpodol...@yahoo.co.uk 
Sent: Tuesday, 14 January 2014, 12:12
Subject: Re: NON-SPRING JSON array serialization workaround please??
  


Hi 
On 14/01/14 11:34, rpd wrote: 


No, the above would set the endpoint properties, JSONProvider does not 
check them, one can do it like this: 

init-param 
   param-namejaxrs.providers/param-name 
   param-value 
     org.apache.cxf.systest.jaxrs.BookStoreProvider1 
     org.apache.cxf.systest.jaxrs.BookStoreProvider2(a=b c=d) 
   /param-value 
  /init-param 

In this case though it won't help actually, it is only possible to 
inject simple non-collection properties and the arrayKeys JSONProvider 
property is a list. I can see it can be supported easily enough too, but 
not at the moment. 

The only way then for now is to register a custom JAX-RS Application 
when you can directly configure the provider 

Cheers, Sergey 








 
If you reply to this email, your message will be added to the discussion below: 
http://cxf.547215.n5.nabble.com/NON-SPRING-JSON-array-serialization-workaround-please-tp5738442p5738535.html
 
To unsubscribe from NON-SPRING JSON array serialization workaround please??, 
click here.
NAML



--
View this message in context: 
http://cxf.547215.n5.nabble.com/NON-SPRING-JSON-array-serialization-workaround-please-tp5738442p5738547.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: NON-SPRING JSON array serialization workaround please??

2014-01-14 Thread Sergey Beryozkin

On 14/01/14 15:34, rpd wrote:

Thanks - useful to know and it would indeed be a handy feature to be able to do this.  By 
writing my own application do you mean that I would follow...

http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAX-RSservicesprogrammatically

using specifically the JAXRSServerFactoryBean? Would this be outside of my 
web-container (Tomcat)?


No, you create your own custom JAX-RS Application and register it with 
CXFJaxrsNonSpringServlet using the parameter name as required by the 
spec, javax.ws.rs.Application,


Cheers, Sergey



Rob



  From: Sergey Beryozkin [via CXF] ml-node+s547215n5738535...@n5.nabble.com
To: rpd robpodol...@yahoo.co.uk
Sent: Tuesday, 14 January 2014, 12:12
Subject: Re: NON-SPRING JSON array serialization workaround please??



Hi
On 14/01/14 11:34, rpd wrote:


No, the above would set the endpoint properties, JSONProvider does not
check them, one can do it like this:

init-param
param-namejaxrs.providers/param-name
param-value
  org.apache.cxf.systest.jaxrs.BookStoreProvider1
  org.apache.cxf.systest.jaxrs.BookStoreProvider2(a=b c=d)
/param-value
   /init-param

In this case though it won't help actually, it is only possible to
inject simple non-collection properties and the arrayKeys JSONProvider
property is a list. I can see it can be supported easily enough too, but
not at the moment.

The only way then for now is to register a custom JAX-RS Application
when you can directly configure the provider

Cheers, Sergey









If you reply to this email, your message will be added to the discussion below: 
http://cxf.547215.n5.nabble.com/NON-SPRING-JSON-array-serialization-workaround-please-tp5738442p5738535.html
To unsubscribe from NON-SPRING JSON array serialization workaround please??, 
click here.
NAML



--
View this message in context: 
http://cxf.547215.n5.nabble.com/NON-SPRING-JSON-array-serialization-workaround-please-tp5738442p5738547.html
Sent from the cxf-user mailing list archive at Nabble.com.




--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com


Message correlation with the JMS transport

2014-01-14 Thread Jens
Hi,

you may remember I've had problems with this on the client side before (and,
for the record, I still believe the current code is suboptimal, tying the
correlation method used to sync/async etc.), and I'm now fighting with this
on the server side as well.

I have a CXF service implementation that receives requests via
JMS/WebsphereMQ and sends replies back the same way. The logic in
JMSDestination is:

if (correlationId set) use correlationId as correlationId in the response
else use msgId as correlationId in the response

Now, my clients send messages with correlationId set but expect to receive
the msgId in the response. I have no control whatsoever over what the
clients send or expect, and I don't see any way to do what they want using
CXF. Is there?

Assuming there is no way to specify MsgIDAsCorrelID, can the request message
be modified in an interceptor before the destination gets to create the
response message? Is the JMSMessage available at that point?

Thanks,
Jens



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Message-correlation-with-the-JMS-transport-tp5738552.html
Sent from the cxf-user mailing list archive at Nabble.com.


Log the Request and Response object from eclipse generated client

2014-01-14 Thread 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

2014-01-14 Thread 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

2014-01-14 Thread José Manuel Prieto
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:
cxf:bus
cxf:outInterceptors
ref bean=logOutbound/
/cxf:outInterceptors
/cxf:bus

or:
cxf:bus
   cxf:features
  cxf:logging /
   /cxf:features
/cxf:bus
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 jeff.b...@gmail.com

 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: Log the Request and Response object from eclipse generated client

2014-01-14 Thread Jeffrey Born
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:
 cxf:bus
 cxf:outInterceptors
 ref bean=logOutbound/
 /cxf:outInterceptors
 /cxf:bus

 or:
 cxf:bus
cxf:features
   cxf:logging /
/cxf:features
 /cxf:bus
 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 jeff.b...@gmail.com

  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: Accessing temporary file name of attachments

2014-01-14 Thread Henry Clout
Hi Sergey.

Sure, so long as it's possible for the service implementation to map an 
attachment to the the generated temp file, that'd work.  I guess for the 
particular use case I was describing it's slightly less clean, since the user 
needs to take into account the fact that the data may be in memory rather than 
on disk.  But then having access to the file itself is more flexible.

Yours,
Henry


On 12 Jan 2014, at 18:19, Sergey Beryozkin sberyoz...@gmail.com wrote:

 Hi Henry, Dan,
 
 Should we offer an interface for users to create a temporary file instead ?
 For example, by default a temp file is created in the system temp drive, 
 developers can customize it by creating a temp File in the right location and 
 with the more user-friendly name if needed ?
 
 Cheers. Sergey


Re: Error reading XMLStreamReader @ SOAPUI but works fine in browser

2014-01-14 Thread harilal.a.s
If any idea on same...please help...we are struggling on it...




--
View this message in context: 
http://cxf.547215.n5.nabble.com/Error-reading-XMLStreamReader-SOAPUI-but-works-fine-in-browser-tp5738545p5738566.html
Sent from the cxf-user mailing list archive at Nabble.com.