User Propagation with REST

2019-02-28 Thread Raggy Fab
Hi cxf users!

At my old company, when using SOAP, we were using Standards like WS-Trust
including a Security Token Service to authenticate SAML Token for our users
(incl. audience-uri-specific claims/role).

We used the WS-Federation Standard to let users authenticate and used
WS-Trust to propagate the user's saml token across multiple
applications/webservice hops. (onBehalfOf Flow). We did use SAML token
issued from service accounts for backend2backend communication.

Now my question is:
Which of these use cases are supported (out of the box or partly supported)
in cxf, based on which protocol/flows REST/OIDC/OAuth2/JWT World? I had
trouble finding input specifically how to implement a onBehalfOf Flow
online.

If you can point me to a specific flow or how to give me hints how achieve
a similar use case (or let me know if there is no standard for a certain
use case) that would be awesome!

greetings
Raggy


Re: JMS+MTOM OutOfMemoryError

2019-02-28 Thread Daniel Kulp

This is almost certainly not going to work.   The JMS spec doesn’t really have 
a way to stream things, so it always holds the entire message in memory.  
(StreamMessage doesn’t actually stream)


Dan



> On Feb 28, 2019, at 10:11 AM, Robert .  wrote:
> 
> Hi cxf users and developers,
> 
> I'm using MTOM to send large files. This works great for SOAP HTTP
> requests. Both the client and server can send the messages with low memory
> consumption.
> Unfortunately when I use SOAP JMS I get a heap space OutOfMemoryError.
> I tried using CXF 3.2.7 and 3.3.0.
> Any help is very much appreciated.
> 
> This is the stack trace:
> 
> Caused by: java.lang.OutOfMemoryError: Java heap space
>at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:77)
>at org.apache.cxf.helpers.IOUtils.readBytesFromStream(IOUtils.java:401)
>at
> org.apache.cxf.io.CachedOutputStream.getBytes(CachedOutputStream.java:306)
>at
> org.apache.cxf.transport.jms.MessageStreamUtil$SendingOutputStream.doClose(MessageStreamUtil.java:81)
>at
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:222)
>at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
>at org.apache.cxf.transport.jms.JMSConduit.close(JMSConduit.java:104)
>at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)
>at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531)
>at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:440)
>at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:355)
>at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
>at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
>at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)
>at com.sun.proxy.$Proxy76.addDocumentMtom(Unknown Source)
> 
> 
> I have configure my JaxWsProxyFactoryBean like this:
> 
>   JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
>Map props = new HashMap<>();
>props.put("mtom-enabled", Boolean.TRUE);
>factory.setProperties(props);
>factory.setFeatures(Collections.singletonList(new
> ConnectionFactoryFeature(connectionFactory)));
> 
> factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
>factory.setServiceClass(DocumentServiceOneWay.class);
> 
> factory.setAddress("jms:queue:DocumentServiceQueue?sessionTransacted=true");
> 
> Kind regards,
> Robert

-- 
Daniel Kulp
dk...@apache.org  - http://dankulp.com/blog 

Talend Community Coder - http://talend.com 


JMS+MTOM OutOfMemoryError

2019-02-28 Thread Robert .
Hi cxf users and developers,

I'm using MTOM to send large files. This works great for SOAP HTTP
requests. Both the client and server can send the messages with low memory
consumption.
Unfortunately when I use SOAP JMS I get a heap space OutOfMemoryError.
I tried using CXF 3.2.7 and 3.3.0.
Any help is very much appreciated.

This is the stack trace:

Caused by: java.lang.OutOfMemoryError: Java heap space
at java.io.ByteArrayOutputStream.(ByteArrayOutputStream.java:77)
at org.apache.cxf.helpers.IOUtils.readBytesFromStream(IOUtils.java:401)
at
org.apache.cxf.io.CachedOutputStream.getBytes(CachedOutputStream.java:306)
at
org.apache.cxf.transport.jms.MessageStreamUtil$SendingOutputStream.doClose(MessageStreamUtil.java:81)
at
org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:222)
at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.jms.JMSConduit.close(JMSConduit.java:104)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:440)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:355)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)
at com.sun.proxy.$Proxy76.addDocumentMtom(Unknown Source)


I have configure my JaxWsProxyFactoryBean like this:

   JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
Map props = new HashMap<>();
props.put("mtom-enabled", Boolean.TRUE);
factory.setProperties(props);
factory.setFeatures(Collections.singletonList(new
ConnectionFactoryFeature(connectionFactory)));

factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
factory.setServiceClass(DocumentServiceOneWay.class);

factory.setAddress("jms:queue:DocumentServiceQueue?sessionTransacted=true");

Kind regards,
Robert


SOAP Action ignored by CXF JMS

2019-02-28 Thread Robert .
Hi,

Could someone please respond to my issue? I have mailed the users mailing
list in October 2018 and the dev mailing list in December 2018.
I'm willing to help to debug and fix the issue, but I want to make sure it
is not just a configuration mistake on my end.
If I am asking for support in the wrong way, or I need to provide
additional information, please let me know.
I have just tested the issue with CXF 3.3.0, and I still have the same
problem.

https://issues.apache.org/jira/browse/CXF-7885

I'm using CXF 3.2.6 and have a HTTP SOAP webservice that uses a
JaxWsProxyFactoryBean to call a (one-way) webservice over SOAP JMS. The
wsdl for this webservice has non-unque body parts; it is not
WSI-BasicProfile compliant, therefore the SOAP Action is important to
determine which method of the target webservice must be called.

I can see that CXF sets the SOAP Action header "SOAPJMS_soapAction", and
this is received by the CXF JMS listener. However it then uses the
namespace and local part name to determine which method should be called,
instead of the SOAP Action.

Kind Regards,
Robert