Re: Code review on use of cxf in Apache Tika?

2022-05-07 Thread Sergey Beryozkin
 Hi Andriy

No problems at all, thanks a million for starting looking into it

Sergey

On Fri, May 6, 2022 at 2:06 AM Andriy Redko  wrote:

> Hey Sergey,
>
> My apologies, I was off last week and only now caught up with all the
> things,
> so let me understand the problem first. I have looked at [1] and saw that
> team
> has added programmatic SSL/TLS configuration [2]. However, another
> approach team is
> looking at is to use declarative cxf.xml to replace the programmatic one,
> is that
> an accurate description? And once tried, we have separate Jetty server
> spawn up?
>
> Thank you!
>
> [1] https://issues.apache.org/jira/browse/TIKA-3719
> [2]
> https://github.com/apache/tika/commit/c1c69dac4f5f948f38e0b198c3fdaad61a7d80be#diff-32fed2ec8d113792f680c2242ac6cb0cb67cfdd142660d993dbe92aaede00f6fR265
>
> Best Regards,
> Andriy Redko
>
>
> SB> Hey Andriy
>
> SB> Great stuff, glad to hear, it is a collection of JAX-RS endpoints
> backed up
> SB> by CXF, so the team needs some help to setup HTTPS, Basic (and possibly
> SB> bearer JWT token verification going forward), I can help with
> clarifying
> SB> some details related to JWT, CXF has everything related to it...
>
> SB> Cheers, Sergey
>
> SB> On Sat, Apr 23, 2022 at 8:02 PM Andriy Redko  wrote:
>
> >> Hi Tim & Sergey,
>
> >> Yeah, sure, happy to help here. I think I understood the problem, will
> try
> >> to
> >> look shortly on how to address that in context of Tika Server (I have
> never
> >> used the server-based deployment of Tika yet).
>
> >> Best Regards,
> >> Andriy Redko
>
> >> SB> Hi Tim
>
> >> SB> Apologies I'm totally occupied with Quarkus right now, I'm sorry it
> >> SB> consumes all the time.
> >> SB> Andriy, if you could help the Tika colleagues then it would be
> great,
> >> as
> >> SB> you've helped with integrating Tika in Apache CXF as well, recall
> how
> >> we
> >> SB> enjoyed the presentation about Tika at one of ASF Conferences :-).
>
> >> SB> Cheers, Sergey
>
> >> SB> On Thu, Apr 21, 2022 at 10:55 PM Tim Allison 
> >> wrote:
>
> >> >> Friends and colleagues,
>
> >> >>   Over on Apache Tika, our server has been using cxf for a long time.
> >> >> We've been very happy with its capabilities and robustness.  So,
> thank
> >> >> you!
>
> >> >>   Recently we were asked to add TLS, and we managed to do so
> >> >> programmatically[0]. The requestor on that issue noted that it would
> >> >> be great if we could use the regular cxf.xml file configuration
> >> >> process[1].  Further, the requestor noted that if he put a cxf.xml
> >> >> file on his class path, a separate jetty server was spun up.  Are
> >> >> there better ways we can use CXF and its configuration process?
> >> >>   This is how we're initializing the server [2].
>
> >> >>Thank you!
>
> >> >>   Best,
>
> >> >>  Tim
>
> >> >> [0]
> >> >>
> >>
> https://github.com/apache/tika/blob/TIKA-3719/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java#L259
>
> >> >> [1]
> >> >>
> >>
> https://issues.apache.org/jira/browse/TIKA-3725?focusedCommentId=17526098=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17526098
>
> >> >> [2]
> >> >>
> >>
> https://github.com/apache/tika/blob/main/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java#L234
>
>


Re: Code review on use of cxf in Apache Tika?

2022-04-23 Thread Sergey Beryozkin
Hey Andriy

Great stuff, glad to hear, it is a collection of JAX-RS endpoints backed up
by CXF, so the team needs some help to setup HTTPS, Basic (and possibly
bearer JWT token verification going forward), I can help with clarifying
some details related to JWT, CXF has everything related to it...

Cheers, Sergey

On Sat, Apr 23, 2022 at 8:02 PM Andriy Redko  wrote:

> Hi Tim & Sergey,
>
> Yeah, sure, happy to help here. I think I understood the problem, will try
> to
> look shortly on how to address that in context of Tika Server (I have never
> used the server-based deployment of Tika yet).
>
> Best Regards,
> Andriy Redko
>
> SB> Hi Tim
>
> SB> Apologies I'm totally occupied with Quarkus right now, I'm sorry it
> SB> consumes all the time.
> SB> Andriy, if you could help the Tika colleagues then it would be great,
> as
> SB> you've helped with integrating Tika in Apache CXF as well, recall how
> we
> SB> enjoyed the presentation about Tika at one of ASF Conferences :-).
>
> SB> Cheers, Sergey
>
> SB> On Thu, Apr 21, 2022 at 10:55 PM Tim Allison 
> wrote:
>
> >> Friends and colleagues,
>
> >>   Over on Apache Tika, our server has been using cxf for a long time.
> >> We've been very happy with its capabilities and robustness.  So, thank
> >> you!
>
> >>   Recently we were asked to add TLS, and we managed to do so
> >> programmatically[0]. The requestor on that issue noted that it would
> >> be great if we could use the regular cxf.xml file configuration
> >> process[1].  Further, the requestor noted that if he put a cxf.xml
> >> file on his class path, a separate jetty server was spun up.  Are
> >> there better ways we can use CXF and its configuration process?
> >>   This is how we're initializing the server [2].
>
> >>Thank you!
>
> >>   Best,
>
> >>  Tim
>
> >> [0]
> >>
> https://github.com/apache/tika/blob/TIKA-3719/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java#L259
>
> >> [1]
> >>
> https://issues.apache.org/jira/browse/TIKA-3725?focusedCommentId=17526098=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17526098
>
> >> [2]
> >>
> https://github.com/apache/tika/blob/main/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java#L234
>
>


Re: Code review on use of cxf in Apache Tika?

2022-04-23 Thread Sergey Beryozkin
Hi Tim

Apologies I'm totally occupied with Quarkus right now, I'm sorry it
consumes all the time.
Andriy, if you could help the Tika colleagues then it would be great, as
you've helped with integrating Tika in Apache CXF as well, recall how we
enjoyed the presentation about Tika at one of ASF Conferences :-).

Cheers, Sergey

On Thu, Apr 21, 2022 at 10:55 PM Tim Allison  wrote:

> Friends and colleagues,
>
>   Over on Apache Tika, our server has been using cxf for a long time.
> We've been very happy with its capabilities and robustness.  So, thank
> you!
>
>   Recently we were asked to add TLS, and we managed to do so
> programmatically[0]. The requestor on that issue noted that it would
> be great if we could use the regular cxf.xml file configuration
> process[1].  Further, the requestor noted that if he put a cxf.xml
> file on his class path, a separate jetty server was spun up.  Are
> there better ways we can use CXF and its configuration process?
>   This is how we're initializing the server [2].
>
>Thank you!
>
>   Best,
>
>  Tim
>
> [0]
> https://github.com/apache/tika/blob/TIKA-3719/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java#L259
>
> [1]
> https://issues.apache.org/jira/browse/TIKA-3725?focusedCommentId=17526098=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17526098
>
> [2]
> https://github.com/apache/tika/blob/main/tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/TikaServerProcess.java#L234
>


Re: CXF, OAuth2 and social login

2018-02-12 Thread Sergey Beryozkin

Hi

I'm assuming you are mainly interested in making your web application 
acting as OpenIdConnect client or RP, i.e, a user who is about to access 
this web application needs to authenticated first against Google/etc ?


CXF offers quite a decent support for it, I'd recommend to experiment 
with jaxrs_big_query and also jaxrs/basic_oidc, and also check

http://cxf.apache.org/docs/jax-rs-oidc.html

HTH, Sergey

On 12/02/18 10:11, Vassilis Virvilis wrote:

Hi,

I am looking in CXF support for OAuth2 support in general and social 
logins in particular. See http://cxf.apache.org/docs/jax-rs-oauth2.html


 From the docs it is not immediately evident if the OAuth2 support has 
been written with the "social login" workflow in mind. There is of 
course 
http://cxf.apache.org/docs/jax-rs-oauth2.html#JAX-RSOAuth2-ThirdPartyClientAuthentication 
but it still feels to me like the "I want to create and own OAuth2 
server" case.


Is CXF supposed be used for such a task or should give up on CXF and use 
something else such as:


1) Apache Oltu: https://oltu.apache.org/
minus: Doesn't look very vibrant: 
https://mail-archives.apache.org/mod_mbox/oltu-dev/201801.mbox/%3CA760F1A0-A0C2-4039-B6FA-87320722DFAB%40adobe.com%3E 



2) Google 
https://developers.google.com/api-client-library/java/google-oauth-java-client/oauth2 

minus: I have already the CXF framework in place. Why use another 
framewrok?


3) Spring: https://geowarin.github.io/social-login-with-spring.html
minus: It's spring

4) Other: https://github.com/3pillarlabs/socialauth

Any suggestions are welcome.




Re: CXF startup error in OSGi container (checkBindingFactory)

2018-02-09 Thread Sergey Beryozkin
Modifying the code with may be the log entries (in various 
BindingFactoryManagerImpl parts and AbstractJAXRSFactoryBean NPE poit 
level) to get a better idea of the ordering and then redeploying might 
help...It is tricky


Sergey



On 09/02/18 16:51, Andrei Shakirin wrote:

Hi Sergey,

Thanks for your response.
Yeah ... these are my favourite issues: happens once per 20 starts, only on 
some environments, not really debuggable.

Thanks for the hints, will fighting.

Regards,
Andrei.



-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: Freitag, 9. Februar 2018 12:06
To: Andrei Shakirin
Cc: users@cxf.apache.org; a.vinogra...@itos.eu.org
Subject: Re: CXF startup error in OSGi container (checkBindingFactory)

Hi Andrei

Looks like the problem is happening earlier,

https://github.com/apache/cxf/blob/cxf-
3.1.7/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFact
oryBean.java#L99

and the stack-trace suggests that BindingFactoryManager is null, it is not set 
as
a bus extension.

Why is that manager is null I'm not sure.
May make sense debugging what is happening inside

https://github.com/apache/cxf/blob/cxf-
3.1.7/core/src/main/java/org/apache/cxf/bus/managers/BindingFactoryManag
erImpl.java,
may be even recompile with some printlns there and in
AbstractJAXRSFactoryBean.java to confirm it is actually a race condition...
May be also try 3.1.14

Sergey



On 09/02/18 09:12, Andrei Shakirin wrote:

Hi Sergey,

Could you quick look in following stack trace, occurs sometimes by startup

CXF client in OSGi Karaf container:


2018-02-09 04:02:11,452 WARN[{{bundle.name,org.apache.cxf.cxf-rt-

transports-http}{bundle.version,3.1.7}{bundle.id,252}}] [null]
org.apache.cxf.transport.servlet.ServletController  Can't find the
the request for http://172.16.4.38/basit/services/1/server-availability's
Observer

2018-02-09 04:02:11,502 ERROR   [{{bundle.name,org.apache.cxf.cxf-rt-

rs-client}{bundle.version,3.1.7}{bundle.id,246}}]   [null]
org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean
java.lang.NullPointerException : null

2018-02-09 04:02:11,503 WARN

[{{bundle.name,org.apache.aries.blueprint.core}{bundle.version,1.6.2}{
bundle.id,16}}] [null]  org.apache.aries.blueprint.container.BeanRecipe
Object to be destroyed is not an instance of UnwrapperedBeanHolder,
type: null

2018-02-09 04:02:11,504 INFO

[{{bundle.name,org.apache.camel.camel-
core}{bundle.version,2.17.3}{bundle.id,199}}]   [null]
org.apache.camel.blueprint.BlueprintCamelContextApache Camel
2.17.3 (CamelContext: schedulingCamelContext) is shutting down

2018-02-09 04:02:11,511 INFO

[{{bundle.name,org.apache.camel.camel-
core}{bundle.version,2.17.3}{bundle.id,199}}]   [null]
org.apache.camel.blueprint.BlueprintCamelContextApache Camel
2.17.3 (CamelContext: schedulingCamelContext) uptime 0.236 seconds

2018-02-09 04:02:11,511 INFO

[{{bundle.name,org.apache.camel.camel-
core}{bundle.version,2.17.3}{bundle.id,199}}]   [null]
org.apache.camel.blueprint.BlueprintCamelContextApache Camel
2.17.3 (CamelContext: schedulingCamelContext) is shutdown in 0.007 seconds


2018-02-09 04:02:11,518 ERROR

[{{bundle.name,org.apache.aries.blueprint.core}{bundle.version,1.6.2}{
bundle.id,16}}] [null]
org.apache.aries.blueprint.container.BlueprintContainerImpl
Unable to start blueprint container for bundle de.conrad.ccp.basit.core-
domain-bee/10.13.3
org.osgi.service.blueprint.container.ComponentDefinitionException:
Error when instantiating bean ikaEventServiceConnector of class
de.conrad.ccp.basit.bee.core.ika.impl.IkaEventServiceConnectorImpl

at

org.apache.aries.blueprint.container.BeanRecipe.wrapAsCompDefEx(BeanReci
pe.java:361)[16:org.apache.aries.blueprint.core:1.6.2]

at

org.apache.aries.blueprint.container.BeanRecipe.getInstanceFromType(BeanRe
cipe.java:351)[16:org.apache.aries.blueprint.core:1.6.2]

at

org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:
282)[16:org.apache.aries.blueprint.core:1.6.2]

at

org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.j
ava:830)[16:org.apache.aries.blueprint.core:1.6.2]

at

org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.ja
va:811)[16:org.apache.aries.blueprint.core:1.6.2]

at

org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[16:
org.apache.aries.blueprint.core:1.6.2]

at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_151]
at

org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[16
:org.apache.aries.blueprint.core:1.6.2]

at

org.apache.aries.blueprint.container.BlueprintRepository.createInstances(Bluep
rintRepository.java:255)[16:org.apache.aries.blueprint.core:1.6.2

Re: CXF startup error in OSGi container (checkBindingFactory)

2018-02-09 Thread Sergey Beryozkin

Hi Andrei

Looks like the problem is happening earlier,

https://github.com/apache/cxf/blob/cxf-3.1.7/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java#L99

and the stack-trace suggests that BindingFactoryManager is null, it is 
not set as a bus extension.


Why is that manager is null I'm not sure.
May make sense debugging what is happening inside

https://github.com/apache/cxf/blob/cxf-3.1.7/core/src/main/java/org/apache/cxf/bus/managers/BindingFactoryManagerImpl.java, 
may be even recompile with some printlns there and in 
AbstractJAXRSFactoryBean.java

to confirm it is actually a race condition...
May be also try 3.1.14

Sergey



On 09/02/18 09:12, Andrei Shakirin wrote:

Hi Sergey,

Could you quick look in following stack trace, occurs sometimes by startup CXF 
client in OSGi Karaf container:

2018-02-09 04:02:11,452 WARN
[{{bundle.name,org.apache.cxf.cxf-rt-transports-http}{bundle.version,3.1.7}{bundle.id,252}}]
[null]  org.apache.cxf.transport.servlet.ServletController  Can't find 
the the request for http://172.16.4.38/basit/services/1/server-availability's 
Observer   
2018-02-09 04:02:11,502 ERROR   
[{{bundle.name,org.apache.cxf.cxf-rt-rs-client}{bundle.version,3.1.7}{bundle.id,246}}]
  [null]  org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean  
java.lang.NullPointerException : null   
2018-02-09 04:02:11,503 WARN
[{{bundle.name,org.apache.aries.blueprint.core}{bundle.version,1.6.2}{bundle.id,16}}]
   [null]  org.apache.aries.blueprint.container.BeanRecipe Object to be 
destroyed is not an instance of UnwrapperedBeanHolder, type: null  
2018-02-09 04:02:11,504 INFO
[{{bundle.name,org.apache.camel.camel-core}{bundle.version,2.17.3}{bundle.id,199}}]
 [null]  org.apache.camel.blueprint.BlueprintCamelContextApache 
Camel 2.17.3 (CamelContext: schedulingCamelContext) is shutting down 
2018-02-09 04:02:11,511 INFO
[{{bundle.name,org.apache.camel.camel-core}{bundle.version,2.17.3}{bundle.id,199}}]
 [null]  org.apache.camel.blueprint.BlueprintCamelContextApache 
Camel 2.17.3 (CamelContext: schedulingCamelContext) uptime 0.236 seconds 
2018-02-09 04:02:11,511 INFO
[{{bundle.name,org.apache.camel.camel-core}{bundle.version,2.17.3}{bundle.id,199}}]
 [null]  org.apache.camel.blueprint.BlueprintCamelContextApache 
Camel 2.17.3 (CamelContext: schedulingCamelContext) is shutdown in 0.007 
seconds 
2018-02-09 04:02:11,518 ERROR   
[{{bundle.name,org.apache.aries.blueprint.core}{bundle.version,1.6.2}{bundle.id,16}}]
   [null]  org.apache.aries.blueprint.container.BlueprintContainerImpl 
Unable to start blueprint container for bundle 
de.conrad.ccp.basit.core-domain-bee/10.13.3  
org.osgi.service.blueprint.container.ComponentDefinitionException: Error when 
instantiating bean ikaEventServiceConnector of class 
de.conrad.ccp.basit.bee.core.ika.impl.IkaEventServiceConnectorImpl
at 
org.apache.aries.blueprint.container.BeanRecipe.wrapAsCompDefEx(BeanRecipe.java:361)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.container.BeanRecipe.getInstanceFromType(BeanRecipe.java:351)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:282)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:830)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:811)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[16:org.apache.aries.blueprint.core:1.6.2]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_151]
at 
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:255)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:186)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:724)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:411)[16:org.apache.aries.blueprint.core:1.6.2]
at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:276)[16:org.apache.aries.blueprint.core:1.6.2]
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_151]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_151]
at 

Re: Remove obsolete RxJava code and keep RxJava2 only one

2018-02-06 Thread Sergey Beryozkin
I'd still favour removing RxJava, if you would like to keep it then I 
guess the new module would indeed have to be introduced


Cheers, Sergey

On 06/02/18 03:49, John D. Ament wrote:

I was just about to remove the optional marking on reactive streams, and
noticed that rxjava was still around.  I guess it was decided to keep it?
I'll point out, this now makes the dependency chain even harder to follow
(since rxjava2 uses reactive streams, but rxjava does not).

John

On Wed, Nov 15, 2017 at 6:53 PM Andriy Redko <drr...@gmail.com> wrote:


Hey Sergey,

That would be ideal I think (move RxJava into separate module). RxJava2 and
RxJava are quite different frameworks, some people just stuck with RxJava
so
we could support them there. Thanks.

Best Regards,
 Andriy Redko

JDA> What about just leaving the old RxJava code in a module by itself
(when I
JDA> was looking recently, it didn't make much sense to see both RxJava and
JDA> RxJava2 in one module).

JDA> On Wed, Nov 15, 2017 at 10:56 AM Sergey Beryozkin <
sberyoz...@gmail.com>
JDA> wrote:


Hi



cxf-rt-rs-extension-rx ships the code for both (old) RxJava and RxJava2
code. It supports returning RxJava2 Flowable and Observable on the
server and accepting it on the client, and the same for the (old) RxJava
Observable...



While even the (old) RxJava code is very new for CXF, the reality is
that RxJava has been around for a while now and with RxJava2 embracing
org.reactivestreams, it's hard to see CXF users preferring to start with
the (old) RxJava.



The other minor problem is that cxf-rt-rs-extension-rx has optional
RxJava and RxJava2 deps to be able to ship the relevant code in the same
module and splitting it into 2 modules will be too much at this point.



I suggest that unless some users confirm (I CC to the users) that they
need to use the (old) RxJava code, then we just remove it and make
things much simpler...



Thanks, Sergey










Re: Reactive Services & CDI

2018-02-05 Thread Sergey Beryozkin

Hi John
On 04/02/18 19:19, John D. Ament wrote:

On Sun, Feb 4, 2018 at 2:01 PM Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


I thought I'd point to the utility of that module anyway (by the way, in
the updated code below the AsyncResponse is also not needed)



Yep, I know that.  Was seeing the issue either way, and as far as I know
the AsyncResponse approach is the more spec appropriate way.

It is only needed in this case to init a CXF-specific subscriber hence a 
portability issue while without it one would have a portable code 
consistent with the way CompletableFuture is supported in 2.1 - where 
you just return it...



In the servlet container you may need to enable the async (via the
standard servlet param).



haha, that was it.  Thanks!

Np, sometimes it is probably not needed, I thought I saw some examples 
before where it just works, may be some servlet containers are stricter...


Sergey




Cheers, Sergey

On 04/02/18 17:59, John D. Ament wrote:

Sergey,

I think you're mixing emails (the email on dev@ is unrelated).

On Sun, Feb 4, 2018 at 12:53 PM Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


That dependency you referred to should let you do:

@Path("/")
public class RestController {
 @GET
 @Produces(MediaType.APPLICATION_JSON)
 public Flux doGet(@Suspended AsyncResponse asyncResponse) {
 ClientBuilder.newClient()
 .register(MyAppFeature.class)
 .target("https://postman-echo.com/get;)
 .queryParam("arg1", "arg1")
 .queryParam("arg2", "arg2")
 .request(MediaType.APPLICATION_JSON_TYPE)
 .rx(ReactorInvoker.class)
 .get(JsonObject.class);
}

Not sure why Continuation is not init-ed though, something to do with
the servlet setup



Anything you can suggest to debug through?

I'm following the async example I wrote, but within a servlet container
(I'm assuming the systests are running a jetty instance).




Sergey



On 04/02/18 16:16, John D. Ament wrote:

BTW, sample project can be found @
https://github.com/johnament/cxf-demo-reactive-cdi


On Sun, Feb 4, 2018 at 11:13 AM John D. Ament <johndam...@apache.org>

wrote:



I built a simple webapp (WAR file, deploying to Tomcat) that depends

on

the CXF 3.2.2 libraries + Weld 3.0.2.  I don't believe CDI has

anything

to

do with my problem though.

I registered a feature/server customizer that can deal with the

invoker

logic required, and provided a rest controller that simply invokes the
postman echo service

Feature/Extension:

@ApplicationScoped
public class MyAppFeature implements Feature,
JAXRSServerFactoryCustomizationExtension {
   public boolean configure(FeatureContext featureContext) {
   featureContext.register(JsrProvider.class);
   featureContext.register(ReactorInvokerProvider.class);
   return true;
   }

   @Override
   public void customize(JAXRSServerFactoryBean

jaxrsServerFactoryBean) {

   ReactorInvoker invoker = new ReactorInvoker();
   invoker.setUseStreamingSubscriberIfPossible(false);
   jaxrsServerFactoryBean.setInvoker(invoker);
   StreamingResponseProvider streamProvider = new
StreamingResponseProvider<>();





streamProvider.setProduceMediaTypes(Collections.singletonList("application/json"));

   jaxrsServerFactoryBean.setProvider(streamProvider);
   jaxrsServerFactoryBean.getOutInterceptors().add(new
LoggingOutInterceptor());
   }
}

RestController:

@RequestScoped
@Path("/")
public class RestController {
   @GET
   @Produces(MediaType.APPLICATION_JSON)
   public void doGet(@Suspended AsyncResponse asyncResponse) {
   ClientBuilder.newClient()
   .register(MyAppFeature.class)
   .target("https://postman-echo.com/get;)
   .queryParam("arg1", "arg1")
   .queryParam("arg2", "arg2")
   .request(MediaType.APPLICATION_JSON_TYPE)
   .rx(ReactorInvoker.class)
   .get(JsonObject.class)
   .subscribe(new
JsonStreamingAsyncSubscriber<>(asyncResponse));
   }
}

When I attempt to invoke this endpoint, I see a NPE in the logs

04-Feb-2018 11:07:20.245 WARNING [http-nio-8080-exec-69]
org.apache.cxf.phase.PhaseInterceptorChain.doDefaultLogging

Interceptor

for

{http://rest.mycompany.com/}RestController has thrown exception,
unwinding now
java.lang.NullPointerException
at




org.apache.cxf.jaxrs.impl.AsyncResponseImpl.initContinuation(AsyncResponseImpl.java:306)

at




org.apache.cxf.jaxrs.impl.AsyncResponseImpl.(AsyncResponseImpl.java:68)

at




org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:826)

at




o

Re: Reactive Services & CDI

2018-02-04 Thread Sergey Beryozkin
I thought I'd point to the utility of that module anyway (by the way, in 
the updated code below the AsyncResponse is also not needed)


In the servlet container you may need to enable the async (via the 
standard servlet param).


Cheers, Sergey

On 04/02/18 17:59, John D. Ament wrote:

Sergey,

I think you're mixing emails (the email on dev@ is unrelated).

On Sun, Feb 4, 2018 at 12:53 PM Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


That dependency you referred to should let you do:

   @Path("/")
   public class RestController {
@GET
@Produces(MediaType.APPLICATION_JSON)
public Flux doGet(@Suspended AsyncResponse asyncResponse) {
ClientBuilder.newClient()
.register(MyAppFeature.class)
.target("https://postman-echo.com/get;)
.queryParam("arg1", "arg1")
.queryParam("arg2", "arg2")
.request(MediaType.APPLICATION_JSON_TYPE)
.rx(ReactorInvoker.class)
.get(JsonObject.class);
   }

Not sure why Continuation is not init-ed though, something to do with
the servlet setup



Anything you can suggest to debug through?

I'm following the async example I wrote, but within a servlet container
(I'm assuming the systests are running a jetty instance).




Sergey



On 04/02/18 16:16, John D. Ament wrote:

BTW, sample project can be found @
https://github.com/johnament/cxf-demo-reactive-cdi


On Sun, Feb 4, 2018 at 11:13 AM John D. Ament <johndam...@apache.org>

wrote:



I built a simple webapp (WAR file, deploying to Tomcat) that depends on
the CXF 3.2.2 libraries + Weld 3.0.2.  I don't believe CDI has anything

to

do with my problem though.

I registered a feature/server customizer that can deal with the invoker
logic required, and provided a rest controller that simply invokes the
postman echo service

Feature/Extension:

@ApplicationScoped
public class MyAppFeature implements Feature,
JAXRSServerFactoryCustomizationExtension {
  public boolean configure(FeatureContext featureContext) {
  featureContext.register(JsrProvider.class);
  featureContext.register(ReactorInvokerProvider.class);
  return true;
  }

  @Override
  public void customize(JAXRSServerFactoryBean

jaxrsServerFactoryBean) {

  ReactorInvoker invoker = new ReactorInvoker();
  invoker.setUseStreamingSubscriberIfPossible(false);
  jaxrsServerFactoryBean.setInvoker(invoker);
  StreamingResponseProvider streamProvider = new
StreamingResponseProvider<>();



streamProvider.setProduceMediaTypes(Collections.singletonList("application/json"));

  jaxrsServerFactoryBean.setProvider(streamProvider);
  jaxrsServerFactoryBean.getOutInterceptors().add(new
LoggingOutInterceptor());
  }
}

RestController:

@RequestScoped
@Path("/")
public class RestController {
  @GET
  @Produces(MediaType.APPLICATION_JSON)
  public void doGet(@Suspended AsyncResponse asyncResponse) {
  ClientBuilder.newClient()
  .register(MyAppFeature.class)
  .target("https://postman-echo.com/get;)
  .queryParam("arg1", "arg1")
  .queryParam("arg2", "arg2")
  .request(MediaType.APPLICATION_JSON_TYPE)
  .rx(ReactorInvoker.class)
  .get(JsonObject.class)
  .subscribe(new
JsonStreamingAsyncSubscriber<>(asyncResponse));
  }
}

When I attempt to invoke this endpoint, I see a NPE in the logs

04-Feb-2018 11:07:20.245 WARNING [http-nio-8080-exec-69]
org.apache.cxf.phase.PhaseInterceptorChain.doDefaultLogging Interceptor

for

{http://rest.mycompany.com/}RestController has thrown exception,
unwinding now
   java.lang.NullPointerException
at


org.apache.cxf.jaxrs.impl.AsyncResponseImpl.initContinuation(AsyncResponseImpl.java:306)

at


org.apache.cxf.jaxrs.impl.AsyncResponseImpl.(AsyncResponseImpl.java:68)

at


org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:826)

at


org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:795)

at


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

at


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

at


org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)

at


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

at


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

at


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

at


org.apache.cxf.transport.servlet

Re: Reactive Services & CDI

2018-02-04 Thread Sergey Beryozkin

That dependency you referred to should let you do:

 @Path("/")
 public class RestController {
  @GET
  @Produces(MediaType.APPLICATION_JSON)
  public Flux doGet(@Suspended AsyncResponse asyncResponse) {
  ClientBuilder.newClient()
  .register(MyAppFeature.class)
  .target("https://postman-echo.com/get;)
  .queryParam("arg1", "arg1")
  .queryParam("arg2", "arg2")
  .request(MediaType.APPLICATION_JSON_TYPE)
  .rx(ReactorInvoker.class)
  .get(JsonObject.class);
 }

Not sure why Continuation is not init-ed though, something to do with 
the servlet setup


Sergey



On 04/02/18 16:16, John D. Ament wrote:

BTW, sample project can be found @
https://github.com/johnament/cxf-demo-reactive-cdi


On Sun, Feb 4, 2018 at 11:13 AM John D. Ament  wrote:


I built a simple webapp (WAR file, deploying to Tomcat) that depends on
the CXF 3.2.2 libraries + Weld 3.0.2.  I don't believe CDI has anything to
do with my problem though.

I registered a feature/server customizer that can deal with the invoker
logic required, and provided a rest controller that simply invokes the
postman echo service

Feature/Extension:

@ApplicationScoped
public class MyAppFeature implements Feature,
JAXRSServerFactoryCustomizationExtension {
 public boolean configure(FeatureContext featureContext) {
 featureContext.register(JsrProvider.class);
 featureContext.register(ReactorInvokerProvider.class);
 return true;
 }

 @Override
 public void customize(JAXRSServerFactoryBean jaxrsServerFactoryBean) {
 ReactorInvoker invoker = new ReactorInvoker();
 invoker.setUseStreamingSubscriberIfPossible(false);
 jaxrsServerFactoryBean.setInvoker(invoker);
 StreamingResponseProvider streamProvider = new
StreamingResponseProvider<>();

streamProvider.setProduceMediaTypes(Collections.singletonList("application/json"));
 jaxrsServerFactoryBean.setProvider(streamProvider);
 jaxrsServerFactoryBean.getOutInterceptors().add(new
LoggingOutInterceptor());
 }
}

RestController:

@RequestScoped
@Path("/")
public class RestController {
 @GET
 @Produces(MediaType.APPLICATION_JSON)
 public void doGet(@Suspended AsyncResponse asyncResponse) {
 ClientBuilder.newClient()
 .register(MyAppFeature.class)
 .target("https://postman-echo.com/get;)
 .queryParam("arg1", "arg1")
 .queryParam("arg2", "arg2")
 .request(MediaType.APPLICATION_JSON_TYPE)
 .rx(ReactorInvoker.class)
 .get(JsonObject.class)
 .subscribe(new
JsonStreamingAsyncSubscriber<>(asyncResponse));
 }
}

When I attempt to invoke this endpoint, I see a NPE in the logs

04-Feb-2018 11:07:20.245 WARNING [http-nio-8080-exec-69]
org.apache.cxf.phase.PhaseInterceptorChain.doDefaultLogging Interceptor for
{http://rest.mycompany.com/}RestController has thrown exception,
unwinding now
  java.lang.NullPointerException
at
org.apache.cxf.jaxrs.impl.AsyncResponseImpl.initContinuation(AsyncResponseImpl.java:306)
at
org.apache.cxf.jaxrs.impl.AsyncResponseImpl.(AsyncResponseImpl.java:68)
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:826)
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:795)
at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:214)
at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:191)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:225)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at

Re: Reactive Services & CDI

2018-02-04 Thread Sergey Beryozkin

Why should be optional ?

Sergey
On 04/02/18 16:13, John D. Ament wrote:

I built a simple webapp (WAR file, deploying to Tomcat) that depends on the
CXF 3.2.2 libraries + Weld 3.0.2.  I don't believe CDI has anything to do
with my problem though.

I registered a feature/server customizer that can deal with the invoker
logic required, and provided a rest controller that simply invokes the
postman echo service

Feature/Extension:

@ApplicationScoped
public class MyAppFeature implements Feature,
JAXRSServerFactoryCustomizationExtension {
 public boolean configure(FeatureContext featureContext) {
 featureContext.register(JsrProvider.class);
 featureContext.register(ReactorInvokerProvider.class);
 return true;
 }

 @Override
 public void customize(JAXRSServerFactoryBean jaxrsServerFactoryBean) {
 ReactorInvoker invoker = new ReactorInvoker();
 invoker.setUseStreamingSubscriberIfPossible(false);
 jaxrsServerFactoryBean.setInvoker(invoker);
 StreamingResponseProvider streamProvider = new
StreamingResponseProvider<>();

streamProvider.setProduceMediaTypes(Collections.singletonList("application/json"));
 jaxrsServerFactoryBean.setProvider(streamProvider);
 jaxrsServerFactoryBean.getOutInterceptors().add(new
LoggingOutInterceptor());
 }
}

RestController:

@RequestScoped
@Path("/")
public class RestController {
 @GET
 @Produces(MediaType.APPLICATION_JSON)
 public void doGet(@Suspended AsyncResponse asyncResponse) {
 ClientBuilder.newClient()
 .register(MyAppFeature.class)
 .target("https://postman-echo.com/get;)
 .queryParam("arg1", "arg1")
 .queryParam("arg2", "arg2")
 .request(MediaType.APPLICATION_JSON_TYPE)
 .rx(ReactorInvoker.class)
 .get(JsonObject.class)
 .subscribe(new
JsonStreamingAsyncSubscriber<>(asyncResponse));
 }
}

When I attempt to invoke this endpoint, I see a NPE in the logs

04-Feb-2018 11:07:20.245 WARNING [http-nio-8080-exec-69]
org.apache.cxf.phase.PhaseInterceptorChain.doDefaultLogging Interceptor for
{http://rest.mycompany.com/}RestController has thrown exception, unwinding
now
  java.lang.NullPointerException
at
org.apache.cxf.jaxrs.impl.AsyncResponseImpl.initContinuation(AsyncResponseImpl.java:306)
at
org.apache.cxf.jaxrs.impl.AsyncResponseImpl.(AsyncResponseImpl.java:68)
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:826)
at
org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:795)
at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:214)
at
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:78)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at
org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:191)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:225)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at

Re: Strategies for randomizing or verifying port number for JAXRSServerFactoryBean, or using local transport

2018-01-15 Thread Sergey Beryozkin

Hi David

WebClient.getConfig() would work but only if you pass to it 
InvocationBuilder (JAX-RS 2.0 Client.target().request(), etc)


But you can set whatever properties you need to pass to the CXF client 
runtime on the JAX-RS 2.0 Client Configuration which is simpler.


By the way, I'm not sure DIRECT_DISPATCH is still needed for non-proxy 
clients to try the local transport, try both options...


Cheers, Sergey
On 12/01/18 23:17, KARR, DAVID wrote:

-Original Message-
From: KARR, DAVID
Sent: Friday, January 12, 2018 2:31 PM
To: users@cxf.apache.org
Subject: Strategies for randomizing or verifying port number for
JAXRSServerFactoryBean, or using local transport

Our codebase is going to have some unit tests using
JAXRSServerFactoryBean.  To be reliable, I not only have to ensure that
I use a port number that is uncommon, I have to make sure that the other
unit tests are using a different port.

Besides just using a plain random number generator in a range, are there
any viable strategies for doing this?

I thought about using "local transport"
(https://urldefense.proofpoint.com/v2/url?u=https-
3A__cwiki.apache.org_confluence_display_CXF20DOC_JAXRS-
2BTesting=DwIFAg=LFYZ-o9_HUMeMTSQicvjIg=OsTemSXEn-
xy2uk0vYF_EA=HLSf-QGNUTDyT41PijTXyOMDk707zXxi-
bJP7X8li3s=n2pLBzH8YBAvtug2zK-MgiRtBaFo5e3thOgIICL9jzY= ), which
might solve this problem, but it appears that doing this requires at
least a small change on the client side (setting DIRECT_DISPATCH on the
request context), and I'm not sure our client interface is even
compatible.  We're using Client to get a WebTarget, and then an
Invocation.Builder.  Is it even possible to set this to use direct
dispatch?


As an update, I'm trying to get local transport working.

In our current code, we produce a "client" object of type 
"org.apache.cxf.jaxrs.client.spec.ClientImpl", then get a Target, then get a Builder.

I tried doing the following:


WebClient.getConfig(client).getRequestContext().put(LocalConduit.DIRECT_DISPATCH,
 Boolean.TRUE);

This fails with "Not a valid Client" in 
"org.apache.cxf.jaxrs.client.WebClient.getConfig(Object)" because it needs to be an instance of 
"org.apache.cxf.jaxrs.client.Client".

I now see that the declared type of "client" is "javax.ws.rs.client.Client".

Confusing.  What can I do here?



Re: Some questions about JAXRSServerFactoryBean

2018-01-12 Thread Sergey Beryozkin

Hi David

I vaguely recall it was be needed to help set up the endpoint, but it is 
a default value now, so no need to set it explicitly


Sergey
On 12/01/18 17:50, KARR, DAVID wrote:

In the Javadoc for the "JAXRSServerFactoryBean" class, it shows in the example that it sets the 
"bindingId" property.  The apparently suggested value is "JAXRS_BINDING_ID", which is a 
URI (being something that looks like a URL but doesn't refer to an actual URL resource).

What is this for?  I don't even see this done in any other CXF JAX-RS examples. 
 I see it referenced in some JAX-WS examples in the CXF codebase.



Re: Incoming message processing: filters, interceptors, invokers?

2018-01-12 Thread Sergey Beryozkin

Hi

But can you have a single JAX-RS service implementation which simply 
delegates to the Task ?


A CXF endpoint needs to have an implementation, for example, I 
experimented with delegating the calls to Olingo recently:


https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/odata/src/main/java/odata/server/JaxrsODataService.java

So this becomes an OData server with the CXF code doing nothing but 
preparing a call to the Olingo which actually does OData. So you can try 
do something similar, have, as Andrei suggested, GET/POST/etc methods, 
listening on the wildcard patterns and all delegating to a common code 
which calls Task.


May be, alternatively, you can try Camel.

Cheers, Sergey



I wonder if Camel would fit better in this case,
On 11/01/18 11:01, Andrea Turli wrote:

Andrei,

thanks for your suggestions. I think I was looking at a way to avoid to
re-implement the Rest resources to delegate calls to the Task framework,
some kind of embedded mechanism to process all calls in the same way.

Maybe I should look at filters?

Thanks

On Thu, Jan 11, 2018 at 11:52 AM, Andrei Shakirin 
wrote:


Hi Andrea,

The invokers link you posted relates to JAX-WS (SOAP services)
implementation and not to JAX-RS (Rest services). There are custom invokers
in CXF JAX-RS as well (http://cxf.apache.org/docs/jax-rs-filters.html),
however they dedicated to pre or post process of main invocation.

As I far as I understand your use case, you would like to get incoming
REST call using CXF and delegate it to your Task Framework for further
processing.
In this case, I would simply create a CXF JAX-RS service with required
Rest interface (resources, HTTP methods, etc) and provide java
implementation for exposed Rest Resources delegating calls to your Task
Framework.
You can take this implementation as example:
https://github.com/apache/cxf/tree/master/distribution/src/
main/release/samples/jax_rs/basic/src/main/java/demo/jaxrs/server

Is it useful way for you?

Regards,
Andrei.


-Original Message-
From: Andrea Turli (apache.org) [mailto:andreatu...@apache.org]
Sent: Mittwoch, 10. Januar 2018 15:15
To: users@cxf.apache.org
Subject: Incoming message processing: filters, interceptors, invokers?

Hi,

Apache Brooklyn project uses CXF3.1.10 to implement the REST server in

front

of the Brooklyn core.

We want to execute each service method (i.e. the execution of each REST

api

call) in our Task Framework. We therefore want to be able to wrap up the
incoming restful calls to that method in a callable that is submitted to

the task

framework.

What would you recommend to use to achieve the above result? I'm
considering http://cxf.apache.org/docs/invokers.html, do you think it

is a good

start?

Any example would be appreciated, thanks!
Andrea






Re: How to customize BINARY_CONTENT_MEDIA_TYPES in DefaultLogEventMapper?

2017-12-28 Thread Sergey Beryozkin

Hi

I've added application/pdf to the default list.
The new logging interceptors do not allow the customization, Christian, 
if you can get few mins, have a look please :-). Adding the property to 
the abstract logger makes sense IMHO...


Cheers, Sergey
On 26/12/17 07:48, Vjacheslav V. Borisov wrote:

Hi!

How to customize BINARY_CONTENT_MEDIA_TYPES in DefaultLogEventMapper?
E.g. add application/pdf

public class DefaultLogEventMapper {
 private static final Set BINARY_CONTENT_MEDIA_TYPES;
 static {
 BINARY_CONTENT_MEDIA_TYPES = new HashSet();
 BINARY_CONTENT_MEDIA_TYPES.add("application/octet-stream");
 BINARY_CONTENT_MEDIA_TYPES.add("image/png");
 BINARY_CONTENT_MEDIA_TYPES.add("image/jpeg");
 BINARY_CONTENT_MEDIA_TYPES.add("image/gif");
 }



Re: @Context Application injection not available for Feature

2017-12-19 Thread Sergey Beryozkin

Hi Carlos

Should be fixed now...

Sergey
On 07/12/17 18:14, Carlos Sierra Andrés wrote:

Hi again Sergey,

so I just checked with Glassfish Jersey 2.26 and it injects the
Application into the Feature with:

     @Provider
     public static class MyFeature implements Feature {

     @Override
     public boolean configure(FeatureContext context) {
     System.out.println("Application: " + _application);

     return true;
     }

     @Context
     Application _application;
     }

when registering either as a class or a singleton.

Do you think CXF should do the same. It kinds of feel right, doesn't it?

Should I file a JIRA ticket?

Bests.

Carlos.


El 5/12/17 a las 11:42, Sergey Beryozkin escribió:

Hi Carlos

I can see how it might work, but there should be some more evidence it
will be portable should some whiteboard implementation decide to use
the non-CXF code...
Feature can be in the client or server scopes, or both scopes, typing
a 'server' type like Application inside the feature code makes the
scope property ambiguous, so I'm not sure, I guess the question is
what RI or RestEasy do about it...

Cheers, Sergey
On 05/12/17 08:30, Carlos Sierra Andrés wrote:

Hey Sergey,

I just extracted that from the 2.1 JAX-RS spec. They say that Feature
is a provider and in the providers lifecycle they mention that:

"First the constructor is called, then any requested dependencies are
injected, then the appropriate methods are called (simultaneously) as
needed"

I understand that Feature are called during bootstrap, and it would
not make sense to have some types injected, but I can't see why the
application could not be there since it should be already instantiated.

What do you think?

Bests.

Carlos.


El 4/12/17 a las 23:15, Sergey Beryozkin escribió:

Hi Carlos

Is it expected to be supported ? I do not see it Feature#configure docs

Cheers, Sergey
On 04/12/17 09:00, Carlos Sierra Andrés wrote:

Hello there,

I was trying to get the current application using `@Context
Application application` inside a Feature. I can see in the code
that Features do not get context proxies injected when their
configure method is invoked.

Is this intentional or is this a bug?

Bests.

Carlos.

--
Carlos Sierra
Software Engineer
Liferay España y Portugal / Liferay Spain and Portugal
Tel. +34 917336343
www.liferay.com <http://www.liferay.com/>


Enterprise. Open Source. For Life.

Visit Us: www.liferay.com <http://www.liferay.com/>  |  Like Us:
facebook.com/liferay <http://facebook.com/liferay>  |  Follow Us:
twitter.com/liferay_es <http://twitter.com/liferay>






Re: CXF JAX-RS servers/providers and OSGi whiteboard

2017-12-19 Thread Sergey Beryozkin

Hi Carlos
On 19/12/17 11:01, Carlos Sierra Andrés wrote:

h... this is a very legit question.

I had already answered as if François was meaning JAX-RS Features.

If you don't mean JAX-RS features, but CXF or Karaf features, then I
think there is no way to register them, yet.

So far we are focusing on implementing the spec but I guess we won't
discard adding some extension points that are implementation dependent.

If you ever consider it then, for CXF, it can be about recognizing the 
CXF @Provider annotation which Swagger2Feature/etc is annotated with and 
which has a type (feature, in or out interceptors, in fault or out fault 
interceptor) and a scope (all, server, client) attributes


Cheers, Sergey


Sorry for the confusion.

Carlos.


El 19/12/17 a las 11:54, Jean-Baptiste Onofré escribió:

What do you mean by "features" ? Karaf or CXF features ?

Regards
JB

On 12/19/2017 11:51 AM, Francois Papon wrote:

Hi Carlos,

I'm interesting by this and I would like to know if this is the same
approach for features ? (Swagger feature for example)

Thanks,

François


Le 19/12/2017 à 14:36, Carlos Sierra Andrés a écrit :

Hello Matteo,

you can just publish the filters as OSGi services advertising the
interfaces you want them to be registered by. I am not aware of any
specific example for CXF services, but in the tests you can see how
"extensions" can be registered:
https://github.com/apache/aries-jax-rs-whiteboard/blob/master/jax-rs.itests/src/main/java/test/JaxrsTest.java#L1674


I hope this helps.

Carlos.

El 19/12/17 a las 11:14, matteo escribió:

Hello,
In OSGi I usually configure my CXF REST endpoints using blueprints as
follows:

 


I would like to avoid blueprint-based configuration and switch to
declarative services. I saw an example on how to do this with OSGi
whiteboard:

https://github.com/apache/aries-jax-rs-whiteboard/tree/master/jax-rs.example/src/main/java/org/apache/aries/jax/rs/example


What is the right approach to combine CXF filters such as
CrossOriginResourceSharingFilter, OAuthContextProvider and all that
with the
whiteboard approach? Is there any example or documentation page that
explains how to configure CXF JAX-RS servers and CXF providers in
this way?

Thank you very much,
Matteo



-
matteo
--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html








Re: DELETE with body

2017-12-12 Thread Sergey Beryozkin

Hi Andy

As far as I recall HttpURLConnection does not support DELETE with the body,
So the solution is to add the async conduit module,
JAXRSAsyncClientTest#deleteWithBody shows it

Cheers, Sergey
On 12/12/17 04:04, Andy McCright wrote:

Hi Matthew,

If you are using the WebClient APIs directly, you can call the
invoke(String method, Object body) method - under the covers, that's what
the delete() method does - for example:
 response = webClient.invoke("DELETE", myMsgBody);

Likewise in the JAX-RS Client APIs, you would use the 'method' method, like:
 response = client.target(url).request().method("DELETE",
Entity.json(myObject));

Hope this helps,

Andy

On Mon, Dec 11, 2017 at 3:33 PM, Matthew Broadhead <
matthew.broadh...@nbmlaw.co.uk> wrote:


i am using cxf webclient to communicate with a rest server that needs a
delete command to send a body.  it can't seem to do that. is there a
workaround?






Re: Passing InvocationCallback via JAX-RS client proxy method param ?

2017-12-11 Thread Sergey Beryozkin

Hi

The proxy invocations, sync or async ones, are not specified by JAX-RS 
at all,


However, this effort,
https://github.com/eclipse/microprofile-rest-client

attempts to standardize the proxy approach, please propose there,

Cheers, Sergey


On 08/12/17 16:00, Romain Quinio wrote:

Hello,

I was reviewing asynchronous JAX-RS client proxy invocations 
(http://cxf.apache.org/docs/jax-rs-client-api.html#JAX-RSClientAPI-Asynchronousproxyinvocations),
 and if it would make sense to go one step further, and pass directly the 
InvocationCallback as a proxy method parameter (similar to AsyncHandler with 
asynchronous JAX-WS client proxy invocations).

Current way:

WebClient.getConfig(proxy).getRequestContext().put(InvocationCallback.class.getName(),
 callback);
assertNull(proxy.getBook(123L));

Improved way:

Future future = proxy.getBookAsync(123L, callback);

The Future object returned would allow to test if a response has arrived yet.
The #getBookAsync signature makes explicit whether the call is synchronous or 
asynchronous, otherwise it's unclear.
As asynchronous proxy invocations are unspecified by JAX-RS spec (I wonder why 
!), this would obviously be CXF specific, but the blog post 
http://sberyozkin.blogspot.fr/2016/06/asynchronous-jax-rs-proxies-in-cxf.html 
seemed to hint in that direction ?

As we're using swagger, that would likely mean tweaking swagger-codegen cxf 
language template with an option to generate these extra signatures as well.

Best Regards,
Romain Quinio



Re: Multipart data in AbstractPhaseInterceptor

2017-12-07 Thread Sergey Beryozkin

Hi

Try implementing MultipartInputFilter, ex:
https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/multipart/JwsMultipartSignatureInFilter.java

and then register it from your interceptor like this:

https://github.com/apache/cxf/blob/master/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/multipart/AbstractJwsMultipartVerificationFilter.java#L45

It's quite new, should be avail starting from 3.1.14

Sergey
On 06/12/17 17:10, narayanasgs wrote:

Hi,

I am creating a RESTful file upload using CXF. The method is crated as below
and I am able to test it from Fiddler and via a HTML form with
enctype='multipart/form-data'.

I need to access one of these multipart data in the interceptor that
implements AbstractPhaseInterceptor with Phase.PRE_INVOKE.

I tried using Apache Commons File upload 1.2.2 to read multipart data but
got this error: org.apache.commons.fileupload.FileUploadException: Stream
closed.

Please help me with details of how to access any of these multipart
attributes like code, desc etc in interceptor.


Web service method:
@POST
 @Path("addAttachment")
@Consumes({MediaType.MULTIPART_FORM_DATA})
public int addAttachment(@Multipart(value = "id", type = "text/plain")
Integer ID,
@Multipart(value = "code", type = "text/plain") Integer 
code,
@Multipart(value = "desc", type = "text/plain") String 
desc,
MultipartBody multipartBody) throws WebServiceFault {
}

Thanks in advance.



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html



Re: CXF 3.2.1 swagger generation are wrong for json

2017-12-06 Thread Sergey Beryozkin

Hi Nino

So it is a pure OSGI issue now, right ?
Lets ask Christian as well, Christian, can you advise how to overcome 
this annotations issue ?


Cheers, Sergey
On 06/12/17 11:30, nino martinez wael wrote:
No change after getting the javax.xml.bind.annotation.. I can see I can 
change how some of the interpretations are done when adding jackson 
specific json annotations.. But it's still not correct. :(


On Wed, Dec 6, 2017 at 7:07 AM, nino martinez wael 
<nino.martinez.w...@gmail.com <mailto:nino.martinez.w...@gmail.com>> wrote:


Okay after adding swagger annotations as an export from my bundle.
The swagger json are now including whatever I describe in the
annotations. However the maven bundle plugin keeps removing my
export for javax.xml.bind.annotation and so I cannot test if this
also have an impact on swagger ignoring my javax.xml.bind.annotation
configurations, however it does seem logical.. Digging further.


regards Nino

On Tue, Dec 5, 2017 at 8:07 AM, nino martinez wael
<nino.martinez.w...@gmail.com <mailto:nino.martinez.w...@gmail.com>>
wrote:

I've started testing that idea, and it seems to have an impact..
I will return once I know more!!

Thanks!

On Mon, Dec 4, 2017 at 5:08 PM, Sergey Beryozkin
<sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>> wrote:

CXF Swagger feature itself is not importing Swagger
annotations because it does not work with them, I'm not
sure, may be you need to have your application bundle
exporting the annotations to make the visible...

Sergey
On 04/12/17 15:06, nino martinez wael wrote:

No, no namespaces

And I am still pussled on why it does not do it the
"right" way.. Currently I am experimenting putting in
io.swagger.annotations BUT they seem to have no effect
on the generated swagger describtion when placed in our
backend models, they are in another bundle, im wondering
if the swagger feature somehow are not able to read the
annotations across the bundles, that would very much
explain why its not working..?

        On Mon, Dec 4, 2017 at 11:46 AM, Sergey Beryozkin
<sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>>> wrote:

     Nice,
     Just out of curiosity, what does Swagger set the
XML Object's
     namespace to ? Is it initialized ?

     Sergey

     On 04/12/17 06:03, nino martinez wael wrote:

         Okay so I've looked into this a bit. And turned
the problem
         upside down. Instead of trying to make the cxf
swagger feature
         use jackson, just taking a look at the outcome
and play around
         trying to change it.. Again if there is any way
to see what the
         swagger feature plugin are using runtime to
process file with,
         it would very helpfull..

         It seems that the swagger feature are partially
ignoring my
         annotations, so picking up @xmlrootelement but
partially
         ignoring the list annotations..

         @XmlAccessorType(XmlAccessType.FIELD)
         @XmlRootElement(name = "contacts")
         public class MinimalContactWrapper {

               @XmlElementWrapper(name = "wrap")
               @XmlElement(name = "minimalcontact")
               private List contactList;

               public List
getMinimalContacts() {
                   return contactList;
               }

               public void
setMinimalContacts(List
         minimalContacts) {
                   this.contactList = minimalContacts;
               }

         }


         to

         @XmlAccessorType(XmlAccessType.FIELD)
         @XmlRootElement(name ="contacts")
         public class MinimalContactWrapper {

               @XmlElementRef(name ="minimalContact")
               @Valid
         @NotNull
         @Size(min =1)
 

Re: @Context Application injection not available for Feature

2017-12-05 Thread Sergey Beryozkin

Hi Carlos

I can see how it might work, but there should be some more evidence it 
will be portable should some whiteboard implementation decide to use the 
non-CXF code...
Feature can be in the client or server scopes, or both scopes, typing a 
'server' type like Application inside the feature code makes the scope 
property ambiguous, so I'm not sure, I guess the question is what RI or 
RestEasy do about it...


Cheers, Sergey
On 05/12/17 08:30, Carlos Sierra Andrés wrote:

Hey Sergey,

I just extracted that from the 2.1 JAX-RS spec. They say that Feature is 
a provider and in the providers lifecycle they mention that:


"First the constructor is called, then any requested dependencies are 
injected, then the appropriate methods are called (simultaneously) as 
needed"


I understand that Feature are called during bootstrap, and it would not 
make sense to have some types injected, but I can't see why the 
application could not be there since it should be already instantiated.


What do you think?

Bests.

Carlos.


El 4/12/17 a las 23:15, Sergey Beryozkin escribió:

Hi Carlos

Is it expected to be supported ? I do not see it Feature#configure docs

Cheers, Sergey
On 04/12/17 09:00, Carlos Sierra Andrés wrote:

Hello there,

I was trying to get the current application using `@Context 
Application application` inside a Feature. I can see in the code that 
Features do not get context proxies injected when their configure 
method is invoked.


Is this intentional or is this a bug?

Bests.

Carlos.

--
Carlos Sierra
Software Engineer
Liferay España y Portugal / Liferay Spain and Portugal
Tel. +34 917336343
www.liferay.com <http://www.liferay.com/>


Enterprise. Open Source. For Life.

Visit Us: www.liferay.com <http://www.liferay.com/>  |  Like Us: 
facebook.com/liferay <http://facebook.com/liferay>  |  Follow Us: 
twitter.com/liferay_es <http://twitter.com/liferay>




Re: @Context Application injection not available for Feature

2017-12-04 Thread Sergey Beryozkin

Hi Carlos

Is it expected to be supported ? I do not see it Feature#configure docs

Cheers, Sergey
On 04/12/17 09:00, Carlos Sierra Andrés wrote:

Hello there,

I was trying to get the current application using `@Context Application 
application` inside a Feature. I can see in the code that Features do 
not get context proxies injected when their configure method is invoked.


Is this intentional or is this a bug?

Bests.

Carlos.

--
Carlos Sierra
Software Engineer
Liferay España y Portugal / Liferay Spain and Portugal
Tel. +34 917336343
www.liferay.com 


Enterprise. Open Source. For Life.

Visit Us: www.liferay.com   |  Like Us: 
facebook.com/liferay   |  Follow Us: 
twitter.com/liferay_es 


Re: CXF 3.2.1 swagger generation are wrong for json

2017-12-04 Thread Sergey Beryozkin
CXF Swagger feature itself is not importing Swagger annotations because 
it does not work with them, I'm not sure, may be you need to have your 
application bundle exporting the annotations to make the visible...


Sergey
On 04/12/17 15:06, nino martinez wael wrote:

No, no namespaces

And I am still pussled on why it does not do it the "right" way.. 
Currently I am experimenting putting in io.swagger.annotations BUT they 
seem to have no effect on the generated swagger describtion when placed 
in our backend models, they are in another bundle, im wondering if the 
swagger feature somehow are not able to read the annotations across the 
bundles, that would very much explain why its not working..?


On Mon, Dec 4, 2017 at 11:46 AM, Sergey Beryozkin <sberyoz...@gmail.com 
<mailto:sberyoz...@gmail.com>> wrote:


Nice,
Just out of curiosity, what does Swagger set the XML Object's
namespace to ? Is it initialized ?

Sergey

On 04/12/17 06:03, nino martinez wael wrote:

Okay so I've looked into this a bit. And turned the problem
upside down. Instead of trying to make the cxf swagger feature
use jackson, just taking a look at the outcome and play around
trying to change it.. Again if there is any way to see what the
swagger feature plugin are using runtime to process file with,
it would very helpfull..

It seems that the swagger feature are partially ignoring my
annotations, so picking up @xmlrootelement but partially
ignoring the list annotations..

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "contacts")
public class MinimalContactWrapper {

      @XmlElementWrapper(name = "wrap")
      @XmlElement(name = "minimalcontact")
      private List contactList;

      public List getMinimalContacts() {
          return contactList;
      }

      public void setMinimalContacts(List
minimalContacts) {
          this.contactList = minimalContacts;
      }

}


to

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name ="contacts")
public class MinimalContactWrapper {

      @XmlElementRef(name ="minimalContact")
      @Valid
@NotNull
@Size(min =1)
      private ListminimalContacts=new ArrayList<>();

      public List getMinimalContacts() {
          return minimalContacts;
      }

      public void setMinimalContacts(List
minimalContacts) {
          this.minimalContacts = minimalContacts;
      }

}

Made the xml results required equal in the swagger feature to
what CXF and enunciate feels it should be... Namely this:


...


Instead of something like this:





string
0
string
string
string
0
string
string
string
string
string
string
string
string
string
string
string
string







On Thu, Nov 30, 2017 at 1:43 PM, nino martinez wael
<nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>
<mailto:nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>>> wrote:

     No change without setting swagger2customizer..

     I'll let it rest for a day..

     On Thu, Nov 30, 2017 at 1:30 PM, nino martinez wael
     <nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>
<mailto:nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>>>
     wrote:

         yup have set skip.default.json.provider.re
<http://skip.default.json.provider.re>
         <http://skip.default.json.provider.re
<http://skip.default.json.provider.re>>gistration..

         But no matter what I do it has no effect on what the
swagger
         feature generates.. Where it's changing the json
provider or
         removing it all together..

         Trying it now without setting swagger2Customizer..


         On Thu, Nov 30, 2017 at 1:04 PM, Sergey Beryozkin
         <sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>> wrote:

             Just FYI, removing Jettison lib will ensure it's not
             auto-installed by CXF, and if it is not possible to
remove
             then the other option is to set
 

Re: CXF 3.2.1 swagger generation are wrong for json

2017-12-04 Thread Sergey Beryozkin

Nice,
Just out of curiosity, what does Swagger set the XML Object's namespace 
to ? Is it initialized ?


Sergey
On 04/12/17 06:03, nino martinez wael wrote:
Okay so I've looked into this a bit. And turned the problem upside down. 
Instead of trying to make the cxf swagger feature use jackson, just 
taking a look at the outcome and play around trying to change it.. Again 
if there is any way to see what the swagger feature plugin are using 
runtime to process file with, it would very helpfull..


It seems that the swagger feature are partially ignoring my annotations, 
so picking up @xmlrootelement but partially ignoring the list annotations..


@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "contacts")
public class MinimalContactWrapper {

     @XmlElementWrapper(name = "wrap")
     @XmlElement(name = "minimalcontact")
     private List contactList;

     public List getMinimalContacts() {
         return contactList;
     }

     public void setMinimalContacts(List minimalContacts) {
         this.contactList = minimalContacts;
     }

}


to

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name ="contacts")
public class MinimalContactWrapper {

 @XmlElementRef(name ="minimalContact")
 @Valid
@NotNull
@Size(min =1)
 private ListminimalContacts=new ArrayList<>();

 public List getMinimalContacts() {
 return minimalContacts;
 }

 public void setMinimalContacts(List minimalContacts) {
 this.minimalContacts = minimalContacts;
 }

}

Made the xml results required equal in the swagger feature to what CXF 
and enunciate feels it should be... Namely this:


...


Instead of something like this:





string
0
string
string
string
0
string
string
string
string
string
string
string
string
string
string
string
string







On Thu, Nov 30, 2017 at 1:43 PM, nino martinez wael 
<nino.martinez.w...@gmail.com <mailto:nino.martinez.w...@gmail.com>> wrote:


No change without setting swagger2customizer..

I'll let it rest for a day..

On Thu, Nov 30, 2017 at 1:30 PM, nino martinez wael
<nino.martinez.w...@gmail.com <mailto:nino.martinez.w...@gmail.com>>
wrote:

yup have set skip.default.json.provider.re
<http://skip.default.json.provider.re>gistration..

But no matter what I do it has no effect on what the swagger
feature generates.. Where it's changing the json provider or
removing it all together..

Trying it now without setting swagger2Customizer..


On Thu, Nov 30, 2017 at 1:04 PM, Sergey Beryozkin
<sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>> wrote:

Just FYI, removing Jettison lib will ensure it's not
auto-installed by CXF, and if it is not possible to remove
then the other option is to set
a "skip.default.json.provider.re
<http://skip.default.json.provider.re>gistration" bus property.

However it's not related to Swagger at all, Jettison if
installed will only affect the way JSON is generated for
service responses

Sergey

On 30/11/17 11:57, nino martinez wael wrote:

It does not seem to be a jettison problem.. And neither
an problem with
jackson versions, I just wiped all jettison and
jackson(except 2.9.1 )
versions from my running environment..

Looking into of it could be something with
JacksonJaxbJsonProvider vs
JacksonJsonProvider

On Thu, Nov 30, 2017 at 12:45 PM, nino martinez wael <
nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>> wrote:

IS there somewhere while on runtime where I can
print current registered
providers for cxf, I have a feeling that it somehow
are using jettison for
json...

On Thu, Nov 30, 2017 at 12:17 PM, nino martinez wael <
nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>> wrote:

Okay I will check into libraries whats on class
path.. I have the same
gut feeling that it could be something like that.

    I have enunciate up and working on the side..

On Thu, Nov 30, 2017 at 11:18 AM, Sergey
Beryozkin <sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>>
wrote:

Yes, the minor Swagger version caused this
cha

Re: CXF 3.21 and bean validation

2017-12-01 Thread Sergey Beryozkin
Continuing on this, dealing with the user issues, however trivial or 
complex they might be, definitely does not qualify as a 'loss of time'. 
However, having something more specific to look at, the test case, or 
some 'evidence' like the log, etc, can help decide if it is a problem 
and then resolve the problem faster :-)


Sergey
On 01/12/17 10:03, Sergey Beryozkin wrote:
Np at all, sorry for actually being impatient as I actually did not lose 
any time :-). You know, sometimes, one can get a bit more protective 
than needed of the code :-) which is as it happens not ideal and may 
indeed have bugs hidden somewhere...


Sergey

On 01/12/17 06:13, nino martinez wael wrote:
Somehow I cannot replicate the issue today !!! Not on my developer 
machine

or our test server! Typical when you fired up your debugger!

I am terrible sorry for the loss of your time Sergey :(

-Nino

On Fri, Dec 1, 2017 at 6:43 AM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

Well its not a custom exception, unless you consider jax rs 2, my 
creation

:)

javax.ws.rs.NotAcceptableException

I will digg into it, thanks for your patience.

On Thu, Nov 30, 2017 at 3:31 PM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Can you please debug ?

Sergey

On 30/11/17 14:08, Sergey Beryozkin wrote:


I'm sorry but I don't have time for dealing with some indirect
assumptions that ValidationExceptionMapper which is typed with
toResponse(ValidationException) somehow accepts your custom
NotAcceptableException.

Unless it is an instance of ValidationException ?
On 30/11/17 14:02, nino martinez wael wrote:


When my app throws:

throw new NotAcceptableException("Client tried with wrong format <" +
orgImportRecord.toString() + ">");


the client gets an 500.. looking in the log I can see that the
ValidationExceptionMapper is "responsible"..


I can come with an more complete example. if you want?



On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin 
<sberyoz...@gmail.com



wrote:

How did you come to this conclusion ?


Sergey
On 30/11/17 13:22, nino martinez wael wrote:

Hi


Is it possible to use both

org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper

And

org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper

together.. Currently is seems the ValidationExceptionMapper are
catching my NotAcceptableException etc and coughing up 500's





--
Sergey Beryozkin

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











--
Sergey Beryozkin

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





--
Best regards / Med venlig hilsen
Nino Martinez







Re: CXF 3.21 and bean validation

2017-12-01 Thread Sergey Beryozkin
Np at all, sorry for actually being impatient as I actually did not lose 
any time :-). You know, sometimes, one can get a bit more protective 
than needed of the code :-) which is as it happens not ideal and may 
indeed have bugs hidden somewhere...


Sergey

On 01/12/17 06:13, nino martinez wael wrote:

Somehow I cannot replicate the issue today !!! Not on my developer machine
or our test server! Typical when you fired up your debugger!

I am terrible sorry for the loss of your time Sergey :(

-Nino

On Fri, Dec 1, 2017 at 6:43 AM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:


Well its not a custom exception, unless you consider jax rs 2, my creation
:)

javax.ws.rs.NotAcceptableException

I will digg into it, thanks for your patience.

On Thu, Nov 30, 2017 at 3:31 PM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Can you please debug ?

Sergey

On 30/11/17 14:08, Sergey Beryozkin wrote:


I'm sorry but I don't have time for dealing with some indirect
assumptions that ValidationExceptionMapper which is typed with
toResponse(ValidationException) somehow accepts your custom
NotAcceptableException.

Unless it is an instance of ValidationException ?
On 30/11/17 14:02, nino martinez wael wrote:


When my app throws:

throw new NotAcceptableException("Client tried with wrong format <" +
orgImportRecord.toString() + ">");


the client gets an 500.. looking in the log I can see that the
ValidationExceptionMapper is "responsible"..


I can come with an more complete example. if you want?



On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin <sberyoz...@gmail.com



wrote:

How did you come to this conclusion ?


Sergey
On 30/11/17 13:22, nino martinez wael wrote:

Hi


Is it possible to use both

org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper

And

org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper

together.. Currently is seems the ValidationExceptionMapper are
catching my NotAcceptableException etc and coughing up 500's





--
Sergey Beryozkin

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











--
Sergey Beryozkin

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





--
Best regards / Med venlig hilsen
Nino Martinez







Re: CXF 3.21 and bean validation

2017-11-30 Thread Sergey Beryozkin

Can you please debug ?

Sergey
On 30/11/17 14:08, Sergey Beryozkin wrote:
I'm sorry but I don't have time for dealing with some indirect 
assumptions that ValidationExceptionMapper which is typed with

toResponse(ValidationException) somehow accepts your custom
NotAcceptableException.

Unless it is an instance of ValidationException ?
On 30/11/17 14:02, nino martinez wael wrote:

When my app throws:

throw new NotAcceptableException("Client tried with wrong format <" +
orgImportRecord.toString() + ">");


the client gets an 500.. looking in the log I can see that the
ValidationExceptionMapper is "responsible"..


I can come with an more complete example. if you want?



On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


How did you come to this conclusion ?

Sergey
On 30/11/17 13:22, nino martinez wael wrote:


Hi

Is it possible to use both

org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper

And

org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper

together.. Currently is seems the ValidationExceptionMapper are
catching my NotAcceptableException etc and coughing up 500's





--
Sergey Beryozkin

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











--
Sergey Beryozkin

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


Re: CXF 3.21 and bean validation

2017-11-30 Thread Sergey Beryozkin
I'm sorry but I don't have time for dealing with some indirect 
assumptions that ValidationExceptionMapper which is typed with

toResponse(ValidationException) somehow accepts your custom
NotAcceptableException.

Unless it is an instance of ValidationException ?
On 30/11/17 14:02, nino martinez wael wrote:

When my app throws:

throw new NotAcceptableException("Client tried with wrong format <" +
orgImportRecord.toString() + ">");


the client gets an 500.. looking in the log I can see that the
ValidationExceptionMapper is "responsible"..


I can come with an more complete example. if you want?



On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


How did you come to this conclusion ?

Sergey
On 30/11/17 13:22, nino martinez wael wrote:


Hi

Is it possible to use both

org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper

And

org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper

together.. Currently is seems the ValidationExceptionMapper are
catching my NotAcceptableException etc and coughing up 500's





--
Sergey Beryozkin

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








--
Sergey Beryozkin

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


Re: CXF 3.21 and bean validation

2017-11-30 Thread Sergey Beryozkin

How did you come to this conclusion ?

Sergey
On 30/11/17 13:22, nino martinez wael wrote:

Hi

Is it possible to use both

org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper

And

org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/org.apache.cxf.jaxrs.validation.ValidationExceptionMapper

together.. Currently is seems the ValidationExceptionMapper are
catching my NotAcceptableException etc and coughing up 500's





--
Sergey Beryozkin

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


Re: CXF 3.2.1 swagger generation are wrong for json

2017-11-30 Thread Sergey Beryozkin
Yes, the minor Swagger version caused this change, what was working 
3.1.x, specifically the serializers approach, was not working any longer 
with the new Swagger version, hence this update.


I honestly do not know why exactly a JAXB annotated bean is not 
correctly represented in the Swagger-generated #definitions, it's 
obviously something to do with the way Jackson and JAXB interacts.
Perhaps Jackson you register with DOSGI is not the same version 
installed by the CXF swagger2 feature, perhaps some diff JAXB versions 
are involved, please keep experimenting


Sergey

defaultSwagger2Serializers.setJavadocProvider(new JavaDocProvider());
swagger.setSwagger2Serializers(defaultSwagger2Serializers);

I think this could be the same:

Swagger2Customizer swagger2Customizer = new Swagger2Customizer();
swagger2Customizer.setJavadocProvider(new JavaDocProvider());


swagger.setCustomizer(swagger2Customizer);


I have setup CXF to use JACKSON (JacksonJaxbJsonProvider)


How can I tell swagger to do the same? I think that's the problem..



regards Nino




On Thu, Nov 30, 2017 at 10:50 AM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:


Im wondering if this could be the problem :

https://github.com/swagger-api/swagger-core/issues/960

On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:


So I have a bean CXF accepts only this interpretation for my endpoint:

{
 "contactList": [
 {
 "campaignId": "2",
 "id":"",
 "indexNumber": "",
 "accountNumber": "232",
 "queueNumber": "0",
 "balance": 0,
 "personalIdentificationNumber1": "string",
 "firstName1": "string",
 "lastName1": "string",
 "personalIdentificationNumber2": "string",
 "firstName2": "string",
 "lastName2": "string",
 "address": "string",
 "zipCode": "string",
 "city": "string",
 "homePhone": "+4521",
 "mobilePhone": "+45122",
 "campaing": "string",
 "dateForExtract": "string"

 }
 ]
}

However the swagger feature are generating this as example:

{
   "minimalContacts": [
 {
   "campaignId": "string",
   "id": 0,
   "indexNumber": "string",
   "accountNumber": "string",
   "queueNumber": "string",
   "balance": 0,
   "personalIdentificationNumber1": "string",
   "firstName1": "string",
   "lastName1": "string",
   "personalIdentificationNumber2": "string",
   "firstName2": "string",
   "lastName2": "string",
   "address": "string",
   "zipCode": "string",
   "city": "string",
   "homePhone": "string",
   "mobilePhone": "string",
   "campaing": "string",
   "dateForExtract": "string"
 }
   ]
}

MinimalContactWrapper

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "contacts")
public class MinimalContactWrapper {

 @XmlElementWrapper
 @XmlElementRef
 @Valid
 @NotNull
 @Size(min = 1)
 private List contactList=new ArrayList<>();

 public List getMinimalContacts() {
 return contactList;
 }

 public void setMinimalContacts(List minimalContacts) {
 this.contactList = minimalContacts;
 }


MinimalContact

@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlRootElement(name="minimalcontact")
public class MinimalContact {

 @NotNull
 @Size(min=1, max=240)
 private String campaignId;

 private Long id;
 @Size(min=1, max=240)
 private String indexNumber;
 @Size(min=1, max=20)
 @NotNull
 private String accountNumber;
 @Size(min=1, max=8)
 private String queueNumber;


 private Float balance;

 @Size(min=0, max=11)
 private String personalIdentificationNumber1;

 @Size(min=0, max=55)
 private String firstName1;

 @Size(min=0, max=55)
 private String lastName1;

 @Size(min=0, max=11)
 private String personalIdentificationNumber2;

 private String firstName2;

 private String lastName2;

 private String address;

 private String zipCode;
 private String city;

 @NotNull
 @Size(min=0, max=20)
 private String homePhone;

 @NotNull
 @Size(min=0, max=20)
 private String mobilePhone;

 private String campaing;

 @NotNull
 private String dateForExtract;






--
Best regards / Med venlig hilsen
Nino Martinez





--
Best regards / Med venlig hilsen
Nino Martinez







Re: Transformation interceptor to replace arbitrary text content

2017-11-29 Thread Sergey Beryozkin
Right, the transform feature is not meant to replace XSLT, it would be 
much faster for straightforward transforms at the element 
structure/namespace level but it's not a good fit for the complex 
transformations...
Note if all of these arbitrary simple elements are united by a namespace 
which does not qualify complex ones as well, then you may still be able 
to use the transform one, check the tests, there some examples how to 
use the wildcards


Sergey
On 29/11/17 13:32, Marcel Stör wrote:

I think either of us doesn't understand ;-)

Since the service provider essentially replaced the SOAP string type
with its own 'StringType' simple type that "VEMPTY" text content can
appear in any element. Hence, I need to globally replace that text in
every SOAP message - regardless of which XML element it is used with.
That's why I concluded that I can't use the standard TransformationFeature.

I was also checking whether CXF allowed to register custom
deserializers/mapper for a given type (i.e. from that custom XML
StringType to Java String) but I haven't found anything yet.

On 29.11.17 14:22, Sergey Beryozkin wrote:

You should be able to replace it:

https://github.com/apache/cxf/blob/master/core/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java#L56


and

https://github.com/apache/cxf/blob/master/core/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java#L73


You'd likely need to say that {someNs}modifiedBy has to be replaced by
{someNs}modifiedBy

HTH, Sergey
On 29/11/17 09:22, Marcel Stör wrote:

We're consuming SOAP messages for which the string type was extended or
redefined (see at the bottom). To denote null/empty values the XML
element uses "VEMPTY" as text content.

Example: VEMPTY

Before the message is deserialized and mapped to the Java model we'd
like to transform "VEMPTY" to "". As this special text content can
appear in arbitrary elements I don't think the standard
TransformationFeature as per
https://cxf.apache.org/docs/transformationfeature.html#TransformationFeature-Replacingtextcontent

is applicable. Correct?

I suspect we need to use the XSLT transformation, right?

[StringType]

  
  
  ...some documentation...
  VEMPTY if effective value is null
  ...some more documentation...
  
  
  



  
  
  
  
  










Re: Transformation interceptor to replace arbitrary text content

2017-11-29 Thread Sergey Beryozkin

Or may be

"{http://bar}a;, "{http://bar}a= " or similar, please experiment.
XSLTFeature should def work though...
On 29/11/17 13:22, Sergey Beryozkin wrote:

You should be able to replace it:

https://github.com/apache/cxf/blob/master/core/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java#L56 



and

https://github.com/apache/cxf/blob/master/core/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java#L73 



You'd likely need to say that {someNs}modifiedBy has to be replaced by 
{someNs}modifiedBy


HTH, Sergey
On 29/11/17 09:22, Marcel Stör wrote:

We're consuming SOAP messages for which the string type was extended or
redefined (see at the bottom). To denote null/empty values the XML
element uses "VEMPTY" as text content.

Example: VEMPTY

Before the message is deserialized and mapped to the Java model we'd
like to transform "VEMPTY" to "". As this special text content can
appear in arbitrary elements I don't think the standard
TransformationFeature as per
https://cxf.apache.org/docs/transformationfeature.html#TransformationFeature-Replacingtextcontent 


is applicable. Correct?

I suspect we need to use the XSLT transformation, right?

[StringType]

 
 
 ...some documentation...
 VEMPTY if effective value is null
 ...some more documentation...
 
 
 



 
 
 
 
 







Re: Transformation interceptor to replace arbitrary text content

2017-11-29 Thread Sergey Beryozkin

You should be able to replace it:

https://github.com/apache/cxf/blob/master/core/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java#L56

and

https://github.com/apache/cxf/blob/master/core/src/test/java/org/apache/cxf/staxutils/transform/InTransformReaderTest.java#L73

You'd likely need to say that {someNs}modifiedBy has to be replaced by 
{someNs}modifiedBy


HTH, Sergey
On 29/11/17 09:22, Marcel Stör wrote:

We're consuming SOAP messages for which the string type was extended or
redefined (see at the bottom). To denote null/empty values the XML
element uses "VEMPTY" as text content.

Example: VEMPTY

Before the message is deserialized and mapped to the Java model we'd
like to transform "VEMPTY" to "". As this special text content can
appear in arbitrary elements I don't think the standard
TransformationFeature as per
https://cxf.apache.org/docs/transformationfeature.html#TransformationFeature-Replacingtextcontent
is applicable. Correct?

I suspect we need to use the XSLT transformation, right?

[StringType]

 
 
 ...some documentation...
 VEMPTY if effective value is null
 ...some more documentation...
 
 
 



 
 
 
 
 





--
Sergey Beryozkin

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


Re: CXF 3.2.1 JAX RS and bean validation

2017-11-29 Thread Sergey Beryozkin

It has an optional addMessageToResponse property,

and you can always customize, example, as David suggested, create your 
own mapper, may be it will just extend ValidationExceptionMapper and set 
its addMessageToResponse to true, etc


Cheers, Sergey
On 29/11/17 09:17, nino martinez wael wrote:

I would think that was exactly what
org.apache.cxf.jaxrs.validation.ValidationExceptionMapper
did?


regards Nino

On Wed, Nov 29, 2017 at 9:10 AM, David Karlsen 
wrote:


You could maybe implement an ExceptionMapper to handle them and transform
over to the wanted output format:
https://docs.oracle.com/javaee/7/api/javax/ws/rs/ext/ExceptionMapper.html
https://dennis-xlc.gitbooks.io/restful-java-with-jax-rs-2-
0-2rd-edition/en/part1/chapter7/exception_handling.html


2017-11-29 8:51 GMT+01:00 nino martinez wael 

Re: CDI injection in CXF interceptor.

2017-11-17 Thread Sergey Beryozkin

Sorry, that won't work with JAX-WS.
May be, instead of using @InInterceptors, register the interceptor on 
the endpoint the same way you do it with the service class.


Sergey
On 17/11/17 10:34, Sergey Beryozkin wrote:

Hi

Try to add
org.apache.cxf.annotations.Provider annotation:
@Provider(Type.InInterceptor)
to InfoInterceptor instead of @InInterceptors...

Sergey
On 17/11/17 09:28, Balu S wrote:

Hi,

I have tried to inject CDI Bean (using @Inject) in the CXF interceptor 
but

it is not instantiated and is null.
However If I use the CDI injection in the Webservice implementation 
class,

then it is instantiated correctly.

*Interceptor*
public class InfoInterceptor extends AbstractPhaseInterceptor  {

public InfoInterceptor() {
super(Phase.RECEIVE);
}

@Inject InfoBean info;  // not instantiated and null!!

  }

*Webservice* (declared interceptor in webservice).
@org.apache.cxf.interceptor.InInterceptors(interceptors =
{"org.test.sample.InfoInterceptor"})
@WebService()
public class InfoImpl { ...

@Inject InfoBean info;  // works here
...
}

Does CXF interceptors not support CDI injection currently ?

Appreciate your response on this. Thanks

regards
Balu



Re: CDI injection in CXF interceptor.

2017-11-17 Thread Sergey Beryozkin

Hi

Try to add
org.apache.cxf.annotations.Provider annotation:
@Provider(Type.InInterceptor)
to InfoInterceptor instead of @InInterceptors...

Sergey
On 17/11/17 09:28, Balu S wrote:

Hi,

I have tried to inject CDI Bean (using @Inject) in the CXF interceptor but
it is not instantiated and is null.
However If I use the CDI injection in the Webservice implementation class,
then it is instantiated correctly.

*Interceptor*
public class InfoInterceptor extends AbstractPhaseInterceptor  {

public InfoInterceptor() {
super(Phase.RECEIVE);
}

@Inject InfoBean info;  // not instantiated and null!!

  }

*Webservice* (declared interceptor in webservice).
@org.apache.cxf.interceptor.InInterceptors(interceptors =
{"org.test.sample.InfoInterceptor"})
@WebService()
public class InfoImpl { ...

@Inject InfoBean info;  // works here
...
}

Does CXF interceptors not support CDI injection currently ?

Appreciate your response on this. Thanks

regards
Balu



Re: Remove obsolete RxJava code and keep RxJava2 only one

2017-11-15 Thread Sergey Beryozkin

Hi Christian

Thanks, I'd rather just remove it, but given that RxJava was introduced 
on the user request, I guess we may as well keep it for a bit after all.

Once the code makes it into CXF it then becomes tricky to remove it :-)

Sergey
On 15/11/17 16:09, Christian Schneider wrote:

+1
for removing the old rxjava support

I would also be fine with it living in a separate module.

Christian

2017-11-15 16:56 GMT+01:00 Sergey Beryozkin <sberyoz...@gmail.com>:


Hi

cxf-rt-rs-extension-rx ships the code for both (old) RxJava and RxJava2
code. It supports returning RxJava2 Flowable and Observable on the server
and accepting it on the client, and the same for the (old) RxJava
Observable...

While even the (old) RxJava code is very new for CXF, the reality is that
RxJava has been around for a while now and with RxJava2 embracing
org.reactivestreams, it's hard to see CXF users preferring to start with
the (old) RxJava.

The other minor problem is that cxf-rt-rs-extension-rx has optional RxJava
and RxJava2 deps to be able to ship the relevant code in the same module
and splitting it into 2 modules will be too much at this point.

I suggest that unless some users confirm (I CC to the users) that they
need to use the (old) RxJava code, then we just remove it and make things
much simpler...

Thanks, Sergey







Re: Remove obsolete RxJava code and keep RxJava2 only one

2017-11-15 Thread Sergey Beryozkin

Hi,

Indeed, creating a new module specifically for RxJava is technically 
clean, but creating it for a code which no one will probably use and 
also adding one module to the large number of CXF modules, with only 2/3 
Java files :-) is a bit problematic...


I guess I can keep it as is in 3.2.x but remove it once a new master 
opens...


Thanks, Sergey
On 15/11/17 16:04, John D. Ament wrote:

What about just leaving the old RxJava code in a module by itself (when I
was looking recently, it didn't make much sense to see both RxJava and
RxJava2 in one module).

On Wed, Nov 15, 2017 at 10:56 AM Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Hi

cxf-rt-rs-extension-rx ships the code for both (old) RxJava and RxJava2
code. It supports returning RxJava2 Flowable and Observable on the
server and accepting it on the client, and the same for the (old) RxJava
Observable...

While even the (old) RxJava code is very new for CXF, the reality is
that RxJava has been around for a while now and with RxJava2 embracing
org.reactivestreams, it's hard to see CXF users preferring to start with
the (old) RxJava.

The other minor problem is that cxf-rt-rs-extension-rx has optional
RxJava and RxJava2 deps to be able to ship the relevant code in the same
module and splitting it into 2 modules will be too much at this point.

I suggest that unless some users confirm (I CC to the users) that they
need to use the (old) RxJava code, then we just remove it and make
things much simpler...

Thanks, Sergey





Remove obsolete RxJava code and keep RxJava2 only one

2017-11-15 Thread Sergey Beryozkin

Hi

cxf-rt-rs-extension-rx ships the code for both (old) RxJava and RxJava2 
code. It supports returning RxJava2 Flowable and Observable on the 
server and accepting it on the client, and the same for the (old) RxJava

Observable...

While even the (old) RxJava code is very new for CXF, the reality is 
that RxJava has been around for a while now and with RxJava2 embracing 
org.reactivestreams, it's hard to see CXF users preferring to start with 
the (old) RxJava.


The other minor problem is that cxf-rt-rs-extension-rx has optional 
RxJava and RxJava2 deps to be able to ship the relevant code in the same 
module and splitting it into 2 modules will be too much at this point.


I suggest that unless some users confirm (I CC to the users) that they 
need to use the (old) RxJava code, then we just remove it and make 
things much simpler...


Thanks, Sergey


Re: How to generate WADL on "root" of controller, not just with "?_wadl"?

2017-11-08 Thread Sergey Beryozkin

Well, in principle, having Accept: application/vnd.sun.wadl+xml

should be enough but it's hard to do it in the browser which is a main 
'consumer' thus having a .wadl or ?wadl query is needed


Cheers, Sergey
On 08/11/17 16:56, KARR, DAVID wrote:

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: Tuesday, November 07, 2017 3:07 PM
To: users@cxf.apache.org
Subject: Re: How to generate WADL on "root" of controller, not just with
"?_wadl"?

Can you try a breakpoint at

https://urldefense.proofpoint.com/v2/url?u=https-
3A__github.com_apache_cxf_blob_master_rt_frontend_jaxrs_src_main_java_or
g_apache_cxf_jaxrs_impl_RequestPreprocessor.java-23L111=DwICaQ=LFYZ-
o9_HUMeMTSQicvjIg=OsTemSXEn-
xy2uk0vYF_EA=TIOLNb851DZraIfg7Tp6grZ49Sz6DcznHxbu3aWxDpA=8XehshxT4pC
MwtkDCMs1HGTx55e768vfuTaHng0WRCg=

?


Ah, I figured something out.

The normal way to get the wadl would have required this URL:

 http://localhost:8080/combinedAtgUslMonitorService?_wadl

Using the extension mapping approach requires this URL:

 http://localhost:8080/combinedAtgUslMonitorService/controller.wadl

Until now, I wasn't adding "/controller" to the URL in my test.


Now that this is working, I'd like to experiment with other options.  For 
instance, how can I make accessing the following URL give me the WADL?

 http://localhost:8080/combinedAtgUslMonitorService/controller


On 07/11/17 17:52, KARR, DAVID wrote:

-----Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: Tuesday, November 07, 2017 9:17 AM
To: users@cxf.apache.org
Subject: Re: How to generate WADL on "root" of controller, not just
with "?_wadl"?

Try
application/vnd.sun.wadl+xml
please.


Changed the entry to:
---
  


Still doesn't work.

'http://localhost:8080/combinedAtgUslMonitorService.wadl' still gets
404.  Changing ".wadl" to "?_wadl" works.



On 07/11/17 16:43, KARR, DAVID wrote:

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: Tuesday, November 07, 2017 3:16 AM
To: users@cxf.apache.org
Subject: Re: How to generate WADL on "root" of controller, not just
with "?_wadl"?

Hi David

I looked at the code, I think you can add a '.wadl' to the path
instead
- and for this to work at the server it requires an
extensionMappings map property to have a "wadl":"application/wadl"
pair


If that could work, it's still not quite what I'm looking for, but
it

would be marginally better.  However, it doesn't appear to work.


I changed my extensionMappings block to this:
-
   
   
   
   
   
-

I restarted the app.

I ran "curl

'http://localhost:8080/combinedAtgUslMonitorService.wadl'", which
returned a 404.


I retested the normal "curl

'http://localhost:8080/combinedAtgUslMonitorService/?_wadl&_type=json
'",
and that worked fine.



On 06/11/17 22:54, KARR, DAVID wrote:

I managed to add the 'cxf-rt-rs-service-description' artifact to
my

build, so that I get the WADL when I add "?_wadl" to my URL.  I'd
actually like to make it return the WADL when I just try to access
the "root" of the controller, without having to add the "?_wadl"

string.

This feels like a more natural way of exploring the service, like
running a Linux command in bash without any parameters to have it
tell me what the options are.




Re: Tomcat 9.0.1 start in CXF tests

2017-11-08 Thread Sergey Beryozkin

Hi Max

I'm not sure we've ever updated the start up code of the demos to work 
with Jetty 9, may be Dan knows...


Sergey
On 08/11/17 15:40, Maxim Solodovnik wrote:

BTW, maybe you have examples for CXF under java9? :)

On Wed, Nov 8, 2017 at 10:39 PM, Maxim Solodovnik <solomax...@gmail.com>
wrote:


Yep :)
This was was my initial fix

But then I got recommendations from Konstantin and refactor a little bit :)

On Wed, Nov 8, 2017 at 10:37 PM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Hi Max

Thanks for this info, will save us a lot of time with trying to migrate
to Tomcat 9 :-).
In the simplest case, is it enough just to add a .getConnector() call,
without having to set up a Connector explicitly as in your code ?

Cheers. Sergey

On 08/11/17 13:58, Maxim Solodovnik wrote:


Hello,

Recently I found an issue with running Tomcat to perform web-services
tests
There were no issues until I have updated to Tomcat 9.0.1

The code to start Tomcat was taken from
https://github.com/apache/cxf/blob/master/systests/cdi/base/
src/main/java/org/apache/cxf/systests/cdi/base/tomcat/Abstra
ctTomcatServer.java#L45

Here is the discussion in Tomcat mailing list:
http://tomcat.10.x6.nabble.com/Start-embedded-Tomcat-9-0-1-s
erver-from-java-code-td5068985.html

Here is how it is currently look like in our code base:
https://github.com/apache/openmeetings/blob/master/openmeeti
ngs-web/src/test/java/org/apache/openmeetings/webservice/
AbstractWebServiceTest.java#L100

Hope it will be helpful :))





--
WBR
Maxim aka solomax







Re: Tomcat 9.0.1 start in CXF tests

2017-11-08 Thread Sergey Beryozkin

Hi Max

Thanks for this info, will save us a lot of time with trying to migrate 
to Tomcat 9 :-).
In the simplest case, is it enough just to add a .getConnector() call, 
without having to set up a Connector explicitly as in your code ?


Cheers. Sergey
On 08/11/17 13:58, Maxim Solodovnik wrote:

Hello,

Recently I found an issue with running Tomcat to perform web-services tests
There were no issues until I have updated to Tomcat 9.0.1

The code to start Tomcat was taken from
https://github.com/apache/cxf/blob/master/systests/cdi/base/src/main/java/org/apache/cxf/systests/cdi/base/tomcat/AbstractTomcatServer.java#L45

Here is the discussion in Tomcat mailing list:
http://tomcat.10.x6.nabble.com/Start-embedded-Tomcat-9-0-1-server-from-java-code-td5068985.html

Here is how it is currently look like in our code base:
https://github.com/apache/openmeetings/blob/master/openmeetings-web/src/test/java/org/apache/openmeetings/webservice/AbstractWebServiceTest.java#L100

Hope it will be helpful :))



Re: How to generate WADL on "root" of controller, not just with "?_wadl"?

2017-11-07 Thread Sergey Beryozkin

Can you try a breakpoint at

https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestPreprocessor.java#L111

?

I'll try to get a test done (unless it's already there) in the next few days

Sergey

On 07/11/17 17:52, KARR, DAVID wrote:

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: Tuesday, November 07, 2017 9:17 AM
To: users@cxf.apache.org
Subject: Re: How to generate WADL on "root" of controller, not just with
"?_wadl"?

Try
application/vnd.sun.wadl+xml
please.


Changed the entry to:
---
 


Still doesn't work.  'http://localhost:8080/combinedAtgUslMonitorService.wadl' still gets 404.  
Changing ".wadl" to "?_wadl" works.


On 07/11/17 16:43, KARR, DAVID wrote:

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: Tuesday, November 07, 2017 3:16 AM
To: users@cxf.apache.org
Subject: Re: How to generate WADL on "root" of controller, not just
with "?_wadl"?

Hi David

I looked at the code, I think you can add a '.wadl' to the path
instead
- and for this to work at the server it requires an extensionMappings
map property to have a "wadl":"application/wadl" pair


If that could work, it's still not quite what I'm looking for, but it

would be marginally better.  However, it doesn't appear to work.


I changed my extensionMappings block to this:
-
   
  
  
  
   
-

I restarted the app.

I ran "curl

'http://localhost:8080/combinedAtgUslMonitorService.wadl'", which
returned a 404.


I retested the normal "curl

'http://localhost:8080/combinedAtgUslMonitorService/?_wadl&_type=json'",
and that worked fine.



On 06/11/17 22:54, KARR, DAVID wrote:

I managed to add the 'cxf-rt-rs-service-description' artifact to my

build, so that I get the WADL when I add "?_wadl" to my URL.  I'd
actually like to make it return the WADL when I just try to access
the "root" of the controller, without having to add the "?_wadl"

string.

This feels like a more natural way of exploring the service, like
running a Linux command in bash without any parameters to have it
tell me what the options are.




Re: How to generate WADL on "root" of controller, not just with "?_wadl"?

2017-11-07 Thread Sergey Beryozkin

Try
application/vnd.sun.wadl+xml
please.

Sergey
On 07/11/17 16:43, KARR, DAVID wrote:

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: Tuesday, November 07, 2017 3:16 AM
To: users@cxf.apache.org
Subject: Re: How to generate WADL on "root" of controller, not just with
"?_wadl"?

Hi David

I looked at the code, I think you can add a '.wadl' to the path instead
- and for this to work at the server it requires an extensionMappings
map property to have a "wadl":"application/wadl" pair


If that could work, it's still not quite what I'm looking for, but it would be 
marginally better.  However, it doesn't appear to work.

I changed my extensionMappings block to this:
-
   
 
 
 
   
-

I restarted the app.

I ran "curl 'http://localhost:8080/combinedAtgUslMonitorService.wadl'", which 
returned a 404.

I retested the normal "curl 
'http://localhost:8080/combinedAtgUslMonitorService/?_wadl&_type=json'", and that 
worked fine.


On 06/11/17 22:54, KARR, DAVID wrote:

I managed to add the 'cxf-rt-rs-service-description' artifact to my

build, so that I get the WADL when I add "?_wadl" to my URL.  I'd
actually like to make it return the WADL when I just try to access the
"root" of the controller, without having to add the "?_wadl" string.
This feels like a more natural way of exploring the service, like
running a Linux command in bash without any parameters to have it tell
me what the options are.




Re: cxf-java2wadl-plugin java2wadl questions

2017-11-07 Thread Sergey Beryozkin

OK, thanks for the confirmation it all works now...

Cheers Sergey
On 07/11/17 13:35, Eyal Weingart wrote:

Yep, it is out there :-)

Got it and after i've configured the customization class then it is being 
activated - nice!
Also, i see that the multiple DocTarget.RESPONSE logic we've talked about was 
implemented (and i see it generates multiple response in the wadl) - or at 
least i see it is working... (or maybe it was implemented somewhere between 
3.1.4 version i was using to 3.1.14 i'm using now)

Thanks a lot for all of your help!!!


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 07 November, 2017 14:15
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users 
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Sorry I forgot, I think 3.1.14 is already available in Central

Give it another try please

Cheers, Sergey
On 07/11/17 12:07, Eyal Weingart wrote:

Hi
Tried with the 3.1.13 libs and now i fail on:
[exec] Caused by: java.lang.ClassNotFoundException:
org.apache.cxf.jaxrs.model.wadl.WadlGenerator
And i see it under cxf-rt-rs-service-description-3.1.13.jar

Not sure i will be able to "test" this locally so my next question is - do you 
plan to add it to future release, and if so when can i expect it (give or take :-) )?


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 07 November, 2017 12:02
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi

Well, something is going wrong there given this class in the cxf-core.
You only need to get the snapshot of the cxf-java2wadl-plugin, it will
work OK with other existing 3.1.13 libs

Sergey
On 07/11/17 07:52, Eyal Weingart wrote:

Hi Sergey

We've taken 3.1.14-20171106.085950 jars but still failing (see below).
So for the use of "cxf-java2wadl-plugin" I've taken also "cxf-rt-rs-service-description" 
and "cxf-core" with same snapshot releases (just to make sure) but did not help.
Ami i missing something?

   [exec] WARNING: Error injecting: 
org.apache.cxf.maven_plugin.javatowadl.Java2WADLMojo
   [exec] java.lang.NoClassDefFoundError: org/apache/cxf/Bus
   [exec]   at java.lang.Class.getDeclaredMethods0(Native Method)
   [exec]   at 
java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
   [exec]   at java.lang.Class.getDeclaredMethods(Class.java:1975)
   [exec]   at 
com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:664)
   [exec]   at 
com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:358)
   [exec]   at 
com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:155)
   [exec]   at 
com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:585)
   [exec]   at 
com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:542)
   [exec]   at 
com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:528)
   [exec]   at 
com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:833)
   [exec]   at 
com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:758)
   [exec]   at 
com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:255)
   [exec]   at 
com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:204)
   [exec]   at 
com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:954)
   [exec]   at 
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:987)
   [exec]   at 
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
   [exec]   at 
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
   [exec]   at 
org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
   [exec]   at 
com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
   [exec]   at 
com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
   [exec]   at 
com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
   [exec]   at 
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
   [exec]   at 
org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
   [exec]   at 
com.google.in

Re: cxf-java2wadl-plugin java2wadl questions

2017-11-07 Thread Sergey Beryozkin

Sorry I forgot, I think 3.1.14 is already available in Central

Give it another try please

Cheers, Sergey
On 07/11/17 12:07, Eyal Weingart wrote:

Hi
Tried with the 3.1.13 libs and now i fail on:
[exec] Caused by: java.lang.ClassNotFoundException: 
org.apache.cxf.jaxrs.model.wadl.WadlGenerator
And i see it under cxf-rt-rs-service-description-3.1.13.jar

Not sure i will be able to "test" this locally so my next question is - do you 
plan to add it to future release, and if so when can i expect it (give or take :-) )?


Thanks,
Eyal


-Original Message-----
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 07 November, 2017 12:02
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users 
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi

Well, something is going wrong there given this class in the cxf-core.
You only need to get the snapshot of the cxf-java2wadl-plugin, it will work OK 
with other existing 3.1.13 libs

Sergey
On 07/11/17 07:52, Eyal Weingart wrote:

Hi Sergey

We've taken 3.1.14-20171106.085950 jars but still failing (see below).
So for the use of "cxf-java2wadl-plugin" I've taken also "cxf-rt-rs-service-description" 
and "cxf-core" with same snapshot releases (just to make sure) but did not help.
Ami i missing something?

  [exec] WARNING: Error injecting: 
org.apache.cxf.maven_plugin.javatowadl.Java2WADLMojo
  [exec] java.lang.NoClassDefFoundError: org/apache/cxf/Bus
  [exec]at java.lang.Class.getDeclaredMethods0(Native Method)
  [exec]at 
java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
  [exec]at java.lang.Class.getDeclaredMethods(Class.java:1975)
  [exec]at 
com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:664)
  [exec]at 
com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:358)
  [exec]at 
com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:155)
  [exec]at 
com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:585)
  [exec]at 
com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:542)
  [exec]at 
com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:528)
  [exec]at 
com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:833)
  [exec]at 
com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:758)
  [exec]at 
com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:255)
  [exec]at 
com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:204)
  [exec]at 
com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:954)
  [exec]at 
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:987)
  [exec]at 
com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:950)
  [exec]at 
com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1000)
  [exec]at 
org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
  [exec]at 
com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:84)
  [exec]at 
com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:52)
  [exec]at 
com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
  [exec]at 
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
  [exec]at 
org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
  [exec]at 
com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:108)
  [exec]at 
com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
  [exec]at 
com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
  [exec]at 
com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
  [exec]at 
com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:965)
  [exec]at 
com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1011)
  [exec]at 
com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:961)
   

Re: How to generate WADL on "root" of controller, not just with "?_wadl"?

2017-11-07 Thread Sergey Beryozkin

Hi David

I looked at the code, I think you can add a '.wadl' to the path instead 
- and for this to work at the server it requires an extensionMappings 
map property to have a "wadl":"application/wadl" pair


Sergey
On 06/11/17 22:54, KARR, DAVID wrote:

I managed to add the 'cxf-rt-rs-service-description' artifact to my build, so that I get the WADL when I add 
"?_wadl" to my URL.  I'd actually like to make it return the WADL when I just try to access the 
"root" of the controller, without having to add the "?_wadl" string.  This feels like a 
more natural way of exploring the service, like running a Linux command in bash without any parameters to 
have it tell me what the options are.



Re: cxf-java2wadl-plugin java2wadl questions

2017-11-07 Thread Sergey Beryozkin
anager.java:92)
 [exec] at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
 [exec] at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
 [exec] at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
 [exec] at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
 [exec] at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
 [exec] at 
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
 [exec] at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
 [exec] at 
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
 [exec] at 
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
 [exec] at 
org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
 [exec] at 
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
 [exec] at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
 [exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
 [exec] at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 [exec] at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [exec] at java.lang.reflect.Method.invoke(Method.java:498)
 [exec] at 
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
 [exec] at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
 [exec] at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
 [exec] at 
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
 [exec] Caused by: java.lang.ClassNotFoundException: org.apache.cxf.Bus
 [exec] at 
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
 [exec] at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
 [exec] at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)

Thanks,
Eyal

-----Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 01 November, 2017 16:58
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users 
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi

You can get it from

https://repository.apache.org/content/groups/snapshots/org/apache/cxf/cxf-java2wadl-plugin/3.1.14-SNAPSHOT/

Sergey
On 01/11/17 14:27, Eyal Weingart wrote:

Hi Sergey,

I'm struggling here with downloading it thru the maven build (i was
told that in my local environment i'm connecting only to a local maven 
repository) Is it possible to send me the jar for this snapshot version so we 
can upload it to our local maven repository and then work with it?


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 23 October, 2017 12:19
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi, I think you'll need to enable the snapshot repositories

Sergey
On 22/10/17 09:14, Eyal Weingart wrote:

Hi Sergey

Should i download something manually for the 3.1.14-SNAPSHOT version (and if so 
how and from where)?
Because i'm trying to do it thru the maven build (defining the version of the 
artifact as 3.1.14-SNAPSHOT) and it does not download this version.

And it comes with the below error (of course) :
Plugin org.apache.cxf:cxf-java2wadl-plugin:3.1.14-SNAPSHOT or one of 
its dependencies could not be resolved: Failed to read artifact descriptor for 
org.apache.cxf:cxf-java2wadl-   plugin:jar:3.1.14-SNAPSHOT: Could not find 
artifact org.apache.cxf:cxf-java2wadl-plugin:pom:3.1.14-SNAPSHOT in


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 19 October, 2017 17:01
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Np, by the way, the custom provider will need to have a constructor accepting 
'Bus' which it can provide to the super...

Sergey
On 19/10/17 14:06, Eyal Weingart wrote:

Thanks a lot!
I will check this on Sunday (leaving for the weekend) and will let
you know Working currently with version 3.1.4 and not 3.1.14 so will need to 
fix some dependencies so my build will not fail...

Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 19 October, 2017 15:20
To: Eyal Weing

Re: cxf-java2wadl-plugin java2wadl questions

2017-11-01 Thread Sergey Beryozkin

Hi

You can get it from

https://repository.apache.org/content/groups/snapshots/org/apache/cxf/cxf-java2wadl-plugin/3.1.14-SNAPSHOT/

Sergey
On 01/11/17 14:27, Eyal Weingart wrote:

Hi Sergey,

I'm struggling here with downloading it thru the maven build (i was told that 
in my local environment i'm connecting only to a local maven repository)
Is it possible to send me the jar for this snapshot version so we can upload it 
to our local maven repository and then work with it?


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 23 October, 2017 12:19
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users 
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi, I think you'll need to enable the snapshot repositories

Sergey
On 22/10/17 09:14, Eyal Weingart wrote:

Hi Sergey

Should i download something manually for the 3.1.14-SNAPSHOT version (and if so 
how and from where)?
Because i'm trying to do it thru the maven build (defining the version of the 
artifact as 3.1.14-SNAPSHOT) and it does not download this version.

And it comes with the below error (of course) :
Plugin org.apache.cxf:cxf-java2wadl-plugin:3.1.14-SNAPSHOT or one of 
its dependencies could not be resolved: Failed to read artifact descriptor for 
org.apache.cxf:cxf-java2wadl-   plugin:jar:3.1.14-SNAPSHOT: Could not find 
artifact org.apache.cxf:cxf-java2wadl-plugin:pom:3.1.14-SNAPSHOT in


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 19 October, 2017 17:01
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Np, by the way, the custom provider will need to have a constructor accepting 
'Bus' which it can provide to the super...

Sergey
On 19/10/17 14:06, Eyal Weingart wrote:

Thanks a lot!
I will check this on Sunday (leaving for the weekend) and will let
you know Working currently with version 3.1.4 and not 3.1.14 so will need to 
fix some dependencies so my build will not fail...

Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 19 October, 2017 15:20
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi Eyal
On 19/10/17 09:47, Eyal Weingart wrote:

Hi Sergey

1. Do you see a future option to custom the WADL generator class
during the maven build? If so, what is a reasonable timeline for this?
(Just to know how to plan ahead)


I've added a 'customWadlGenerator' parameter, give 3.1.14-SNAPSHOT or
3.2.1-SNAPSHOT a try

2. Regarding the "classResourceNames" and multiple WADL files question, i think 
i was misunderstood, it is not that each rest class holds 1 service, i meant that each 
rest class holds
1 business with few operations.
For example, 1 class holds books operations, another class holds 
teachers operations and another class will hold course operations - so our 
expectation is that we should have
3 separate WADLs generated - what do you think?


That is fine, it is just that it can't be really solved at the
WADLGenerator level - in your case the separation may be clean, in
other cases - may be not. And from the practical point of view it
will push the already very complex WADLGenerator code to the limit if
we started trying updating it to push the info to many files

Thanks, Sergey


Thanks,
Eyal


-Original Message-
From: Eyal Weingart
Sent: 18 October, 2017 13:47
To: Sergey Beryozkin <sberyoz...@gmail.com>; users
<users@cxf.apache.org>
Subject: RE: cxf-java2wadl-plugin java2wadl questions

Well, actually i was referring to applicative error codes (and their
descriptions) - that might be useful by users so can they understand
the exact issue


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 18 October, 2017 12:44
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

That said, while customizing a response serialization in order to show the 
extra statuses can help users see them, one can document it as well.

For example, I do not see how the information that a given response can return 
405 can be practically used. Well, one can type for example a 405 catch block 
on the client knowing 405 can be returned, but I'm not sure what difference it 
makes, where this 405 info is located in the response statuses or in the docs...

Cheers, Sergey
On 18/10/17 10:37, Sergey Beryozkin wrote:

I forgot it's really about using a Maven plugin.
Hmm...I guess we may need to support a custom class...

Sergey
On 18/10/17 07:06, Eyal Weingart wrote:

Thanks again.
Regarding: "Create MyWadlGenerator extending WADLGenerator,
override whatever is

Re: fediz production

2017-10-31 Thread Sergey Beryozkin

Hi Matthew

Thanks for the feedback. Finally I get a chance to contribute to this 
thread :-).
Putting aside the fact KeyCloak is a high quality project, I'd like to 
say the fact you could not figure out how to set up the keys is not 
sufficient to conclude Fediz is not ready for use in production. I'm not 
sure you if were referring to the WS-Fed or not.


FYI, Fediz OIDC is currently is in production. The actual number is 
small. And the team behind one of this productions put a lot of effort 
into getting it in. I agree and I believe we all do, a major effort is 
needed to push it to the next level, which is really making it very 
straightforward for the users to get started with it fast.


Thanks, Sergey
On 31/10/17 16:55, Matthew Broadhead wrote:

Thanks Colm,

I really appreciate the time you took to respond to my emails.  I spent 
a lot of time trying to get Fediz to work.  I also submitted a couple of 
PRs on github.


But in the end I have moved to keycloak.  It is a much more mature 
project and has an installation program and a web interface.   I had it 
fully working in under 2 hours!


Fediz could move to the next level if it could be:
- simply installed standalone without any configuration whatsover
- reside behind apache httpd for ssl certificates rather than using 
tomcat connector
- all configuration done in a web interface and stored in the database 
rather than "spring" configuration files


I would be happy to offer some time towards helping achieve that goal 
but at the moment I don't think Fediz is ready for use in production.


Cheers,
Matthew

On 31/10/2017 11:50, Colm O hEigeartaigh wrote:

Are you using the same Tomcat instance for the IdP and the STS? Or is the
Tomcat IdP instance set to ask for client authentication? Failing that, I
don't have any more ideas - I need to see a test-case to help any 
further.


Colm.

On Mon, Oct 30, 2017 at 8:35 AM, Matthew Broadhead <
matthew.broadh...@nbmlaw.co.uk> wrote:


hi Colm,

Sorry to keep bothering you with this issue.

It is still prompting me for a certificate when redirecting to the 
idp.  I
have checked line by line the differences between the original code 
and my
production code and cannot see any major difference.  i have tried 
with the
production certificate and with a custom generated certificate but 
both are

the same.

Is there anything else I can try for debugging?

Matthew

On 26/10/2017 14:58, Matthew Broadhead wrote:


comments below

On 26/10/2017 13:46, Colm O hEigeartaigh wrote:

Are you using Java 9? If so please try with Java 8 instead. The 
warnings

should be harmless, however I haven't tested Fediz with Java 9.


i am using openjdk 1.8.0.151

"when i first connect with fedizhelloworld it pops up a box asking 
for a
certificate." - can you reproduce this with a test-case? It sounds 
as if

you are not using the "up" endpoint of the IdP but instead the client
cert
endpoint?


my fediz_config.xml has
https://domain.tld:9443/idp/federation

security-up-config.xml is the same as the example except with the
endpoints changed from localhost:9443 to domain.tld:9443

if it is not related to that can you tell me where i should be looking
for the endpoint config?


Colm.

On Thu, Oct 26, 2017 at 12:06 PM, Matthew Broadhead <
matthew.broadh...@nbmlaw.co.uk> wrote:

Hi Colm,
I am not sure that would be very easy to provide a test case? 
Everything

was working fine on localhost with the test certificates.

Testing on production is completely different using letsencrypt certs
and
having to change lots of configuration files in the code? You 
would be

welcome to look directly at my setup although you are probably busy?

It looks as though the idpcert in the ststrust.jks is not being 
properly
sent and trusted by the idp during handshake?  i am converting it 
using
openssl to pkcs12 and then importing it into a jks.  then i export 
the

cert.  is it possible the chain is being dropped?
openssl pkcs12 -export -in ${cert}fullchain.pem -inkey
${cert}privkey.pem
-out ${p12} -name mytomidpkey -password pass:tompass
keytool -importkeystore -deststorepass tompass -destkeypass tompass
-destkeystore ${idpKey} -srckeystore ${p12} -srcstoretype PKCS12
-srcstorepass tompass -alias mytomidpkey
keytool -keystore ${idpKey} -storepass tompass -export -alias
mytomidpkey
-file ${idpCert}

also i get a lot of these warnings when creating keystores. should 
i be

changing everything to use pkcs12?
Warning:
The JKS keystore uses a proprietary format. It is recommended to 
migrate

to PKCS12 which is an industry standard format using

Matthew

On 26/10/2017 10:43, Colm O hEigeartaigh wrote:

Could you create a test-case and upload it to github somewhere + I 
will

take a look?

Colm.

On Wed, Oct 25, 2017 at 10:39 PM, Matthew Broadhead <
matthew.broadh...@nbmlaw.co.uk> wrote:

Thanks for pointing me in the right direction.

basically what the documentation lacks is that the ststrust.jks 
must

contain MyTCIDP.cer, i.e.
keytool -import 

Re: Swagger2feature / 3.1.12 (DOSGI)

2017-10-31 Thread Sergey Beryozkin

Hi

Thanks for the confirmation, 3.2.1 will probably be available in central 
next week


Sergey
On 27/10/17 06:01, nino martinez wael wrote:
I think my IDE cached exactly that dependency.. I can confirm that you 
guard/fix are working :) Do you know when 3.2.1 will be released?



regards Nino

On Thu, Oct 26, 2017 at 4:20 PM, Sergey Beryozkin <sberyoz...@gmail.com 
<mailto:sberyoz...@gmail.com>> wrote:


As I said, I've added a check there, try 3.1.14-SNAPSHOT

Sergey
On 26/10/17 13:09, nino martinez wael wrote:

okay, I have what are happening.. First call are spring that
sets the host property.. Immediately after this, the following
happens:

AbstractSwaggerFeature.initialize:67 are being called. which hits


Swagger2Feature.setBasePathByAddress:423 with the
valuehttp://0.0.0.0:9000/swaggerSample
<http://0.0.0.0:9000/swaggerSample>  which causes it to reset
the host to http://0.0.0.0:9000...


SO


protected void setBasePathByAddress(String address) {
      if (!address.startsWith("/")) {
          URI u = URI.create(address);
          this.setBasePath(u.getPath());
          this.setHost(u.getPort() <0 ? u.getHost() :
u.getHost() +":" + u.getPort());
      }else {
          this.setBasePath(address);
      }

}

should be


protected void setBasePathByAddress(String address) {
      if (!address.startsWith("/") && host == null) {
          URI u = URI.create(address);
          this.setBasePath(u.getPath());
          this.setHost(u.getPort() <0 ? u.getHost() :
u.getHost() +":" + u.getPort());
      }else {
          this.setBasePath(address);
      }

}


If somebody already set the host it should probably not be
overwritten? OR remove the setHost statement altogether?






On Thu, Oct 26, 2017 at 1:59 PM, nino martinez wael
<nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>
<mailto:nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>>> wrote:

     Hi again

     I've been stepping through the code, and something are
definitely
     wrong. All other properties set in the app context xml have
been
     processed and set in the swagger 2 feature and are acting
logical..
     BUT the HOST property are 0.0.0.0:9000
<http://0.0.0.0:9000> <http://0.0.0.0:9000> on
     initialization.. Which seems strange, I'll debug some more
    and see
         what are modifying the property..

     On Mon, Oct 23, 2017 at 11:56 AM, Sergey Beryozkin
     <sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>> wrote:

         Thanks, sure, I've added a guard there to avoid
auto-setting the
         host value if it's not null, you can try 3.1.14-SNAPSHOT or
         3.2.1-SNAPSHOT now.
         However, the question remains where '0.0.0.0' comes
from in your
         case, when no host is set, which is a typical scenario,
and I
         can see it is reported from URI.getHost().

         What address value do you see in
         Swagger2Feature.setBasePathByAddress, before it tries to
         auto-set the host ?

         Sergey

         On 23/10/17 05:47, nino martinez wael wrote:

             It enters the conditional statement (sethost have been
             called). And address becomes
             "http://0.0.0.0:9090/tdc/dialer/webservices/v1
<http://0.0.0.0:9090/tdc/dialer/webservices/v1>
             <http://0.0.0.0:9090/tdc/dialer/webservices/v1
<http://0.0.0.0:9090/tdc/dialer/webservices/v1>>"




             On Thu, Oct 12, 2017 at 3:51 PM, Sergey Beryozkin
             <sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>
             <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com> <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>>>>
             wrote:

                  Hmm... I may've been wrong with some of the
assumptions
             about what
                  Swagger2Feature does.

                  Can you please do a breakpoint at


https://github.com/apache/cxf/blob/cxf-3.1.12/rt/rs/description-swagger/src/main/java/org/apache/

Re: Swagger2feature / 3.1.12 (DOSGI)

2017-10-26 Thread Sergey Beryozkin

As I said, I've added a check there, try 3.1.14-SNAPSHOT

Sergey
On 26/10/17 13:09, nino martinez wael wrote:
okay, I have what are happening.. First call are spring that sets the 
host property.. Immediately after this, the following happens:


AbstractSwaggerFeature.initialize:67 are being called. which hits


Swagger2Feature.setBasePathByAddress:423 with the 
valuehttp://0.0.0.0:9000/swaggerSample  which causes it to reset the host to 
http://0.0.0.0:9000...


SO


protected void setBasePathByAddress(String address) {
 if (!address.startsWith("/")) {
 URI u = URI.create(address);
 this.setBasePath(u.getPath());
 this.setHost(u.getPort() <0 ? u.getHost() : u.getHost() +":" + 
u.getPort());
 }else {
 this.setBasePath(address);
 }

}

should be


protected void setBasePathByAddress(String address) {
 if (!address.startsWith("/") && host == null) {
 URI u = URI.create(address);
 this.setBasePath(u.getPath());
 this.setHost(u.getPort() <0 ? u.getHost() : u.getHost() +":" + 
u.getPort());
 }else {
 this.setBasePath(address);
 }

}


If somebody already set the host it should probably not be overwritten? OR 
remove the setHost statement altogether?






On Thu, Oct 26, 2017 at 1:59 PM, nino martinez wael 
<nino.martinez.w...@gmail.com <mailto:nino.martinez.w...@gmail.com>> wrote:


Hi again

I've been stepping through the code, and something are definitely
wrong. All other properties set in the app context xml have been
processed and set in the swagger 2 feature and are acting logical..
BUT the HOST property are 0.0.0.0:9000 <http://0.0.0.0:9000> on
initialization.. Which seems strange, I'll debug some more and see
what are modifying the property..

On Mon, Oct 23, 2017 at 11:56 AM, Sergey Beryozkin
<sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>> wrote:

Thanks, sure, I've added a guard there to avoid auto-setting the
host value if it's not null, you can try 3.1.14-SNAPSHOT or
3.2.1-SNAPSHOT now.
However, the question remains where '0.0.0.0' comes from in your
case, when no host is set, which is a typical scenario, and I
can see it is reported from URI.getHost().

What address value do you see in
Swagger2Feature.setBasePathByAddress, before it tries to
auto-set the host ?

Sergey

On 23/10/17 05:47, nino martinez wael wrote:

It enters the conditional statement (sethost have been
called). And address becomes
"http://0.0.0.0:9090/tdc/dialer/webservices/v1
<http://0.0.0.0:9090/tdc/dialer/webservices/v1>"




On Thu, Oct 12, 2017 at 3:51 PM, Sergey Beryozkin
<sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>>
wrote:

     Hmm... I may've been wrong with some of the assumptions
about what
     Swagger2Feature does.

     Can you please do a breakpoint at


https://github.com/apache/cxf/blob/cxf-3.1.12/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java#L103

<https://github.com/apache/cxf/blob/cxf-3.1.12/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java#L103>

<https://github.com/apache/cxf/blob/cxf-3.1.12/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java#L103


<https://github.com/apache/cxf/blob/cxf-3.1.12/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java#L103>>

     and see what happens, without even doing setHost().

     I won't have time for a while to investigate it. But
I'll take care
     of adding a test for checking that setHost() works later on

     Cheers, Sergey

     On 12/10/17 13:42, nino martinez wael wrote:

         Sure, I've made the changes to the cxf spring boot
sample:


https://github.com/nmwael/cxf/commit/86630259982786f013faad658e84bd27bca368b7

<https://github.com/nmwael/cxf/commit/86630259982786f013faad658e84bd27bca368b7>

<https://github.com/nmwael/cxf/commit/86630259982786f013faad658e84bd27bca368b7


<https://github.com/nmwael/cxf/commit/86630259982786f013faad658e84bd27bca368b7>>


         The resulting swagger.json does not honor the host
property,
         host remains the same no matter what:

         "host":"0.0.0.0:9000 <http://

Re: Swagger2feature / 3.1.12 (DOSGI)

2017-10-23 Thread Sergey Beryozkin
Thanks, sure, I've added a guard there to avoid auto-setting the host 
value if it's not null, you can try 3.1.14-SNAPSHOT or 3.2.1-SNAPSHOT now.
However, the question remains where '0.0.0.0' comes from in your case, 
when no host is set, which is a typical scenario, and I can see it is 
reported from URI.getHost().


What address value do you see in Swagger2Feature.setBasePathByAddress, 
before it tries to auto-set the host ?


Sergey

On 23/10/17 05:47, nino martinez wael wrote:
It enters the conditional statement (sethost have been called). And 
address becomes "http://0.0.0.0:9090/tdc/dialer/webservices/v1;





On Thu, Oct 12, 2017 at 3:51 PM, Sergey Beryozkin <sberyoz...@gmail.com 
<mailto:sberyoz...@gmail.com>> wrote:


Hmm... I may've been wrong with some of the assumptions about what
Swagger2Feature does.

Can you please do a breakpoint at


https://github.com/apache/cxf/blob/cxf-3.1.12/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java#L103

<https://github.com/apache/cxf/blob/cxf-3.1.12/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java#L103>

and see what happens, without even doing setHost().

I won't have time for a while to investigate it. But I'll take care
of adding a test for checking that setHost() works later on

Cheers, Sergey

On 12/10/17 13:42, nino martinez wael wrote:

Sure, I've made the changes to the cxf spring boot sample:


https://github.com/nmwael/cxf/commit/86630259982786f013faad658e84bd27bca368b7

<https://github.com/nmwael/cxf/commit/86630259982786f013faad658e84bd27bca368b7>


The resulting swagger.json does not honor the host property,
host remains the same no matter what:

"host":"0.0.0.0:9000 <http://0.0.0.0:9000> <http://0.0.0.0:9000>"







On Thu, Oct 12, 2017 at 1:32 PM, Sergey Beryozkin
<sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>> wrote:

     Hi

     CXF does not contribute itself to the generation of 'host'
within
     the Swagger JSON. For example, try a jaxrs/spring-boot
demo, or some
     of other swagger2 demos...

     If you'd like you can get the CXF source, and step through
the CXF
     Swagger2Feature

     Sergey

     On 12/10/17 11:06, nino martinez wael wrote:

         Hi Sergey,

         I've tried this:

         Swagger2Feature swagger =new Swagger2Feature();

         swagger.setHost("127.0.0.1:9090 <http://127.0.0.1:9090>
<http://127.0.0.1:9090>
         <http://127.0.0.1:9090>");

         swagger.setUsePathBasedConfig(true);


         BUT the swagger json still states:


0.0.0.0:9090 <http://0.0.0.0:9090> <http://0.0.0.0:9090>
<http://0.0.0.0:9090>


         As far as I can see it is something CXF generates.. I cant
         really pinpoint where CXF grabs the configuration from,
but if I
         change

         swagger.setLicense("Commercial DOES THIS APPLY?");


         It does apply in the swagger json and I am able to
    change that
             part, it is as CXF ignores the swagger.getHOST method...



         On Thu, Oct 12, 2017 at 11:25 AM, Sergey Beryozkin
         <sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>
         <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com> <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>>>> wrote:

              In this case it is really somewhere in the Swagger
code

              Sergey
              On 11/10/17 18:29, nino martinez wael wrote:

                  No problem, I tried both configurations but no
matter
         what I do,
                  the host remains the same 0.0.0.0:9090
    <http://0.0.0.0:9090>
         <http://0.0.0.0:9090> <http://0.0.0.0:9090>
                  <http://0.0.0.0:9090>

                  On 11 Oct 2017 15:51, "Sergey Beryozkin"
         <sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>
                  <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>
         <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>>> <mailto:sberyoz...@gmail.com
  

Re: cxf-java2wadl-plugin java2wadl questions

2017-10-23 Thread Sergey Beryozkin

Hi, I think you'll need to enable the snapshot repositories

Sergey
On 22/10/17 09:14, Eyal Weingart wrote:

Hi Sergey

Should i download something manually for the 3.1.14-SNAPSHOT version (and if so 
how and from where)?
Because i'm trying to do it thru the maven build (defining the version of the 
artifact as 3.1.14-SNAPSHOT) and it does not download this version.

And it comes with the below error (of course) :
Plugin org.apache.cxf:cxf-java2wadl-plugin:3.1.14-SNAPSHOT or one of 
its dependencies could not be resolved: Failed to read artifact descriptor for 
org.apache.cxf:cxf-java2wadl-   plugin:jar:3.1.14-SNAPSHOT: Could not find 
artifact org.apache.cxf:cxf-java2wadl-plugin:pom:3.1.14-SNAPSHOT in


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 19 October, 2017 17:01
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users 
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Np, by the way, the custom provider will need to have a constructor accepting 
'Bus' which it can provide to the super...

Sergey
On 19/10/17 14:06, Eyal Weingart wrote:

Thanks a lot!
I will check this on Sunday (leaving for the weekend) and will let you
know Working currently with version 3.1.4 and not 3.1.14 so will need to fix 
some dependencies so my build will not fail...

Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 19 October, 2017 15:20
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi Eyal
On 19/10/17 09:47, Eyal Weingart wrote:

Hi Sergey

1. Do you see a future option to custom the WADL generator class
during the maven build? If so, what is a reasonable timeline for this?
(Just to know how to plan ahead)


I've added a 'customWadlGenerator' parameter, give 3.1.14-SNAPSHOT or
3.2.1-SNAPSHOT a try

2. Regarding the "classResourceNames" and multiple WADL files question, i think 
i was misunderstood, it is not that each rest class holds 1 service, i meant that each 
rest class holds
1 business with few operations.
For example, 1 class holds books operations, another class holds 
teachers operations and another class will hold course operations - so our 
expectation is that we should have
3 separate WADLs generated - what do you think?


That is fine, it is just that it can't be really solved at the
WADLGenerator level - in your case the separation may be clean, in
other cases - may be not. And from the practical point of view it will
push the already very complex WADLGenerator code to the limit if we
started trying updating it to push the info to many files

Thanks, Sergey


Thanks,
Eyal


-Original Message-
From: Eyal Weingart
Sent: 18 October, 2017 13:47
To: Sergey Beryozkin <sberyoz...@gmail.com>; users
<users@cxf.apache.org>
Subject: RE: cxf-java2wadl-plugin java2wadl questions

Well, actually i was referring to applicative error codes (and their
descriptions) - that might be useful by users so can they understand
the exact issue


Thanks,
Eyal


-----Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 18 October, 2017 12:44
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

That said, while customizing a response serialization in order to show the 
extra statuses can help users see them, one can document it as well.

For example, I do not see how the information that a given response can return 
405 can be practically used. Well, one can type for example a 405 catch block 
on the client knowing 405 can be returned, but I'm not sure what difference it 
makes, where this 405 info is located in the response statuses or in the docs...

Cheers, Sergey
On 18/10/17 10:37, Sergey Beryozkin wrote:

I forgot it's really about using a Maven plugin.
Hmm...I guess we may need to support a custom class...

Sergey
On 18/10/17 07:06, Eyal Weingart wrote:

Thanks again.
Regarding: "Create MyWadlGenerator extending WADLGenerator,
override whatever is needed, and register MyWadlGenerator as a jaxrs:provider"
Where exactly do i need to register the MyWadlGenerator as a
jaxrs:provider? I saw it can be done in a spring file that serves
cases for WADL Auto Generation at Runtime.
But where/how should i do it in the pom.xml for the
cxf-java2wadl-plugin in order for it to be activated during build
time


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 17 October, 2017 17:48
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi,
On 17/10/17 15:28, Eyal Weingart wrote:

Thanks Sergey for the quick response.

1. Regarding the customization opti

Re: cxf-java2wadl-plugin java2wadl questions

2017-10-19 Thread Sergey Beryozkin
Np, by the way, the custom provider will need to have a constructor 
accepting 'Bus' which it can provide to the super...


Sergey
On 19/10/17 14:06, Eyal Weingart wrote:

Thanks a lot!
I will check this on Sunday (leaving for the weekend) and will let you know
Working currently with version 3.1.4 and not 3.1.14 so will need to fix some 
dependencies so my build will not fail...

Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 19 October, 2017 15:20
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users 
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi Eyal
On 19/10/17 09:47, Eyal Weingart wrote:

Hi Sergey

1. Do you see a future option to custom the WADL generator class
during the maven build? If so, what is a reasonable timeline for this?
(Just to know how to plan ahead)


I've added a 'customWadlGenerator' parameter, give 3.1.14-SNAPSHOT or 
3.2.1-SNAPSHOT a try

2. Regarding the "classResourceNames" and multiple WADL files question, i think 
i was misunderstood, it is not that each rest class holds 1 service, i meant that each 
rest class holds
1 business with few operations.
For example, 1 class holds books operations, another class holds 
teachers operations and another class will hold course operations - so our 
expectation is that we should have
3 separate WADLs generated - what do you think?


That is fine, it is just that it can't be really solved at the WADLGenerator 
level - in your case the separation may be clean, in other cases - may be not. 
And from the practical point of view it will push the already very complex 
WADLGenerator code to the limit if we started trying updating it to push the 
info to many files

Thanks, Sergey


Thanks,
Eyal


-Original Message-
From: Eyal Weingart
Sent: 18 October, 2017 13:47
To: Sergey Beryozkin <sberyoz...@gmail.com>; users
<users@cxf.apache.org>
Subject: RE: cxf-java2wadl-plugin java2wadl questions

Well, actually i was referring to applicative error codes (and their
descriptions) - that might be useful by users so can they understand
the exact issue


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 18 October, 2017 12:44
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

That said, while customizing a response serialization in order to show the 
extra statuses can help users see them, one can document it as well.

For example, I do not see how the information that a given response can return 
405 can be practically used. Well, one can type for example a 405 catch block 
on the client knowing 405 can be returned, but I'm not sure what difference it 
makes, where this 405 info is located in the response statuses or in the docs...

Cheers, Sergey
On 18/10/17 10:37, Sergey Beryozkin wrote:

I forgot it's really about using a Maven plugin.
Hmm...I guess we may need to support a custom class...

Sergey
On 18/10/17 07:06, Eyal Weingart wrote:

Thanks again.
Regarding: "Create MyWadlGenerator extending WADLGenerator, override
whatever is needed, and register MyWadlGenerator as a jaxrs:provider"
Where exactly do i need to register the MyWadlGenerator as a
jaxrs:provider? I saw it can be done in a spring file that serves
cases for WADL Auto Generation at Runtime.
But where/how should i do it in the pom.xml for the
cxf-java2wadl-plugin in order for it to be activated during build
time


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 17 October, 2017 17:48
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi,
On 17/10/17 15:28, Eyal Weingart wrote:

Thanks Sergey for the quick response.

1. Regarding the customization option, one example i can think of
(and it relates to issue#2 below) is that we want to use multiple
DocTarget.RESPONSE in order to display multiple error codes and
since the generic code does not support it then this logic could
have been applied in the customization class.


Well, there are so many possible customization points that one can
think of, some parts like the docs can be easier customized than
others, but FYI, nearly all of if not all of methods in
WADLGenerator are protected.
Create MyWadlGenerator extending WADLGenerator, override whatever is
needed, and register MyWadlGenerator as a jaxrs:provider


3. Sorry, but did not understand the answer regarding generating 1
WADL per 1 Rest API class.
  Each Rest API class is a different service so don't you think
it should have the option to have its own WADL file?


It depends. They can be part of the composite service, and quite
often, they can share the same (XML) schema types. It's not
something WADLGenerator should be co

Re: cxf-java2wadl-plugin java2wadl questions

2017-10-19 Thread Sergey Beryozkin

Hi Eyal
On 19/10/17 09:47, Eyal Weingart wrote:

Hi Sergey

1. Do you see a future option to custom the WADL generator class during the 
maven build? If so, what is a reasonable timeline for this? (Just to know how 
to plan ahead)

I've added a 'customWadlGenerator' parameter, give 3.1.14-SNAPSHOT or 
3.2.1-SNAPSHOT a try

2. Regarding the "classResourceNames" and multiple WADL files question, i think 
i was misunderstood, it is not that each rest class holds 1 service, i meant that each 
rest class holds
1 business with few operations.
For example, 1 class holds books operations, another class holds 
teachers operations and another class will hold course operations - so our 
expectation is that we should have
3 separate WADLs generated - what do you think?

That is fine, it is just that it can't be really solved at the 
WADLGenerator level - in your case the separation may be clean, in other 
cases - may be not. And from the practical point of view it will push 
the already very complex WADLGenerator code to the limit if we started 
trying updating it to push the info to many files


Thanks, Sergey


Thanks,
Eyal


-Original Message-
From: Eyal Weingart
Sent: 18 October, 2017 13:47
To: Sergey Beryozkin <sberyoz...@gmail.com>; users <users@cxf.apache.org>
Subject: RE: cxf-java2wadl-plugin java2wadl questions

Well, actually i was referring to applicative error codes (and their 
descriptions) - that might be useful by users so can they understand the exact 
issue


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 18 October, 2017 12:44
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users 
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

That said, while customizing a response serialization in order to show the 
extra statuses can help users see them, one can document it as well.

For example, I do not see how the information that a given response can return 
405 can be practically used. Well, one can type for example a 405 catch block 
on the client knowing 405 can be returned, but I'm not sure what difference it 
makes, where this 405 info is located in the response statuses or in the docs...

Cheers, Sergey
On 18/10/17 10:37, Sergey Beryozkin wrote:

I forgot it's really about using a Maven plugin.
Hmm...I guess we may need to support a custom class...

Sergey
On 18/10/17 07:06, Eyal Weingart wrote:

Thanks again.
Regarding: "Create MyWadlGenerator extending WADLGenerator, override
whatever is needed, and register MyWadlGenerator as a jaxrs:provider"
Where exactly do i need to register the MyWadlGenerator as a
jaxrs:provider? I saw it can be done in a spring file that serves
cases for WADL Auto Generation at Runtime.
But where/how should i do it in the pom.xml for the
cxf-java2wadl-plugin in order for it to be activated during build
time


Thanks,
Eyal


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 17 October, 2017 17:48
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi,
On 17/10/17 15:28, Eyal Weingart wrote:

Thanks Sergey for the quick response.

1. Regarding the customization option, one example i can think of
(and it relates to issue#2 below) is that we want to use multiple
DocTarget.RESPONSE in order to display multiple error codes and
since the generic code does not support it then this logic could
have been applied in the customization class.


Well, there are so many possible customization points that one can
think of, some parts like the docs can be easier customized than
others, but FYI, nearly all of if not all of methods in WADLGenerator
are protected.
Create MyWadlGenerator extending WADLGenerator, override whatever is
needed, and register MyWadlGenerator as a jaxrs:provider


3. Sorry, but did not understand the answer regarding generating 1
WADL per 1 Rest API class.
 Each Rest API class is a different service so don't you think it
should have the option to have its own WADL file?


It depends. They can be part of the composite service, and quite
often, they can share the same (XML) schema types. It's not something
WADLGenerator should be concerned about, trying to push each service
docs into a separate file, and thinking of how to avoid the schema
duplication.

If, in your case, each class does indeed represent a standalone
service, then IMHO it would be better to create N jaxrs:endpoints,
one per each class, as opposed to having 1 endpoint with N classes

Sergey



Thanks,
Eyal

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 17 October, 2017 00:06
To: users <users@cxf.apache.org>
Cc: Eyal Weingart <eyal.weing...@exlibrisgroup.com>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi
On 16/10/17 12:35, Eyal Weingart wrote:


Re: providing basic auth via wadl2java?

2017-10-19 Thread Sergey Beryozkin
OK, I've renamed it to "authentication", but please do test it before it 
gets released


Sergey
On 15/09/17 16:03, Shan Syed wrote:

Truthfully I think "authentication" is a more appropriate word, but it's
not a big deal ;)

On Thu, Sep 14, 2017 at 5:16 PM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Thanks, should we rename 'authorization' to 'authentication' ?

First I named it 'nameAndPassword', then thought, well, too specific,
renamed it to 'authorization' (prob because of Http Authorization header).
May be we will leave it as is...

Sergey

On 14/09/17 18:52, Shan Syed wrote:


yes, it's communicating fine and processing the remote WADL :)

thanks!

On Thu, Sep 14, 2017 at 12:07 PM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:

Can you please try 3.1.14-SNAPSHOT now ?


Sergey

On 13/09/17 18:34, Shan Syed wrote:

ok, thanks, looking forward to it!


On Wednesday, September 13, 2017, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

For some reasons I thought it was about retrieving the internal
references


only, so more work is needed then in 3.1.14-SNAPSHOT

On 13/09/17 16:19, Shan Syed wrote:

So I just got the 3.1.14-SNAPSHOT working (sorry, was a silly issue),
and


still getting 401 from it.


On Wed, Sep 13, 2017 at 11:12 AM, Shan Syed <shan...@gmail.com>
wrote:

So outside of my snapshot issues, I updated my local
jaxrs-toolspec.xml,

locally here:

.m2\repository\org\apache\cxf\cxf-tools-wadlto-jaxrs\3.1.13

I updated the option section for authorization, so all the items
match



Specifies a colon separated user name and
password
for
retrieving the
remote WADL content from the servers requiring
Basic
authentication


authorization

authorization

In my POM:



https://whatever/api/somemodel?_wadl
true
com.whatever

-authorization
apiuser:apiuser




I'm still getting a 401

java.io.IOException: Server returned HTTP response code: 401 for URL:
https://... snip -> [Help 1]



On Wed, Sep 13, 2017 at 10:25 AM, Shan Syed <shan...@gmail.com>
wrote:

Unfortunately, I can't seem to build off of the snapshots; I have
this
in

my POM:




apache-snapshot-repo
http://repository.apache.org/snapshots

true




..SNIP..

org.apache.cxf
cxf-wadl2java-plugin
3.1.14-SNAPSHOT

..SNIP..

Getting this error:

"[ERROR] Plugin org.apache.cxf:cxf-wadl2java-plugin:3.1.14-SNAPSHOT
or
one of its dependencies could not be resolved: Could not find
artifact
org.apache.cxf:cxf-wadl2java-plugin:jar
:3.1.14-SNAPSHOT -> [Help 1]"

Any ideas? I looked around in the repo, nothing seems off at a first
glance, I can't see why it's not being found.



On Tue, Sep 12, 2017 at 6:09 AM, Sergey Beryozkin <
sberyoz...@gmail.com



wrote:



I've deployed a cxf-tools-wadlto-jaxrs/3.1.14-SNAPSHOT with the
fix,

can you try it ?

If it works then may be you can just update the jaxrs-toolspec.xml
in
the 3.1.13 version in the .m2 repository and use till 3.1.14 is out

Sergey

On 11/09/17 22:17, Sergey Beryozkin wrote:

Yes, I did it few days before the release,



https://github.com/apache/cxf/blob/cxf-3.2.0/tools/wadlto/ja
xrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-to
olspec.xml#L262

I changed the 'id', but did not changed the switch...That's why
it's
always useful to test the snapshot...

The fix will be avail in 3.1.14/3.2.1

Sergey
On 11/09/17 22:12, Shan Syed wrote:

Also, I just managed to grab the 3.2.0 release (congrats!)



I noticed that wadl2java has this option now: -namePassword

though in your commits, it looks like this was later renamed to
"authorization"

I tried both via the bat file, and "authorization" is an unknown
option

there are no complaints when I supply the namePassword though,
like
this:
\apache-cxf-3.2.0\bin>wadl2java -namePassword apiuser:apiuser
https://whatever:8000/api/rest/somemodel?_wadl

I still get:  Server returned HTTP response code: 401

Looks like the auth pair didn't seem to affect the connection?




On Mon, Sep 11, 2017 at 3:39 PM, Shan Syed <shan...@gmail.com>
wrote:

Hi, I I tried this on 3.0.15 just now, and it doesn't seem like
the

"authorization" is available as an option for me. In my POM:




https://whatever8000/api/rest/somemodel?_wadl
true
apiuser:apiuser
com.whatever


"Cannot find 'authorization' in class
org.apache.cxf.maven_plugin.wa
dlto.WadlOption"

Does the option go somewhere else? Thanks!





On Fri, Sep 8, 2017 at 12:23 PM, Shan Syed <shan...@gmail.com>
wrote:

Great, I will try it when it's available!


On Wed, Sep 6, 2017 at 11:39 AM, Sergey Beryozkin <

sberyoz...@gmail.com>
wrote:

Np. hope that code I added will work from the 1st attempt :-),
I
did

not


want to introduce a strong dep on the CXF JAX-RS client cod

Re: cxf-java2wadl-plugin java2wadl questions

2017-10-18 Thread Sergey Beryozkin
That said, while customizing a response serialization in order to show 
the extra statuses can help users see them, one can document it as well.


For example, I do not see how the information that a given response can 
return 405 can be practically used. Well, one can type for example a 405 
catch block on the client knowing 405 can be returned, but I'm not sure 
what difference it makes, where this 405 info is located in the response 
statuses or in the docs...


Cheers, Sergey
On 18/10/17 10:37, Sergey Beryozkin wrote:

I forgot it's really about using a Maven plugin.
Hmm...I guess we may need to support a custom class...

Sergey
On 18/10/17 07:06, Eyal Weingart wrote:

Thanks again.
Regarding: "Create MyWadlGenerator extending WADLGenerator, override 
whatever is needed, and register MyWadlGenerator as a jaxrs:provider"
Where exactly do i need to register the MyWadlGenerator as a 
jaxrs:provider? I saw it can be done in a spring file that serves 
cases for WADL Auto Generation at Runtime.
But where/how should i do it in the pom.xml for the 
cxf-java2wadl-plugin in order for it to be activated during build time



Thanks,
Eyal


-Original Message-----
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 17 October, 2017 17:48
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users 
<users@cxf.apache.org>

Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi,
On 17/10/17 15:28, Eyal Weingart wrote:

Thanks Sergey for the quick response.

1. Regarding the customization option, one example i can think of 
(and it relates to issue#2 below) is that we want to use multiple 
DocTarget.RESPONSE in order to display multiple error codes and since 
the generic code does not support it then this logic could have been 
applied in the customization class.


Well, there are so many possible customization points that one can 
think of, some parts like the docs can be easier customized than 
others, but FYI, nearly all of if not all of methods in WADLGenerator 
are protected.
Create MyWadlGenerator extending WADLGenerator, override whatever is 
needed, and register MyWadlGenerator as a jaxrs:provider


3. Sorry, but did not understand the answer regarding generating 1 
WADL per 1 Rest API class.
Each Rest API class is a different service so don't you think it 
should have the option to have its own WADL file?


It depends. They can be part of the composite service, and quite 
often, they can share the same (XML) schema types. It's not something 
WADLGenerator should be concerned about, trying to push each service 
docs into a separate file, and thinking of how to avoid the schema 
duplication.


If, in your case, each class does indeed represent a standalone 
service, then IMHO it would be better to create N jaxrs:endpoints, one 
per each class, as opposed to having 1 endpoint with N classes


Sergey



Thanks,
Eyal

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 17 October, 2017 00:06
To: users <users@cxf.apache.org>
Cc: Eyal Weingart <eyal.weing...@exlibrisgroup.com>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi
On 16/10/17 12:35, Eyal Weingart wrote:

Hi,



Not sure to whom i need to send my Questions so hopefully one of you 
can help me.



Forwarding to the CXF users list

I want to use the maven plugin cxf-java2wadl-plugin in order to 
generate WADL from Java rest APIs in build time but i found few 
issues with that:




1.  Is there a way to custom the generator class so i can apply 
some business code during the build? (is it the 
org.apache.cxf.jaxrs.model.wadl.WadlGenerator that generates it?)


What do you need to customize in the generated WADL ?




2.  When i use multiple DocTarget.RESPONSE in the rest API 
annotations then it generates only the first one it finds



Right, because WADLGenerator only creates a single wadl:response per a
given operation


3.  If i define more than 1 classResourceNames in the 
configuration in the pom.xml then it generates all services under 1 
application.wadl file so if i want 1 WADL file per 1 rest API class 
then i need to define multiple  (1 execution per 1 Rest 
class) - is there a nicer way of doing it?



There's no way to auto-gen 1 wadl per 1 class resource - it would be
hard to achieve because most likely these class resources will share
the schema

Sergey





Example of how i configured it in the pom.xml:



    org.apache.cxf

    cxf-java2wadl-plugin

   3.1.4

   

   

process-classes1

process-classes

   

java2wadl

   

   



com.exlibris.primo.webservices.rest.EShelfRestApi<
/
classResourceName>



Primo

true

    

   

   

Re: cxf-java2wadl-plugin java2wadl questions

2017-10-18 Thread Sergey Beryozkin

I forgot it's really about using a Maven plugin.
Hmm...I guess we may need to support a custom class...

Sergey
On 18/10/17 07:06, Eyal Weingart wrote:

Thanks again.
Regarding: "Create MyWadlGenerator extending WADLGenerator, override whatever is 
needed, and register MyWadlGenerator as a jaxrs:provider"
Where exactly do i need to register the MyWadlGenerator as a jaxrs:provider? I 
saw it can be done in a spring file that serves cases for WADL Auto Generation 
at Runtime.
But where/how should i do it in the pom.xml for the cxf-java2wadl-plugin in 
order for it to be activated during build time


Thanks,
Eyal


-Original Message-----
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 17 October, 2017 17:48
To: Eyal Weingart <eyal.weing...@exlibrisgroup.com>; users 
<users@cxf.apache.org>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi,
On 17/10/17 15:28, Eyal Weingart wrote:

Thanks Sergey for the quick response.

1. Regarding the customization option, one example i can think of (and it 
relates to issue#2 below) is that we want to use multiple DocTarget.RESPONSE in 
order to display multiple error codes and since the generic code does not 
support it then this logic could have been applied in the customization class.


Well, there are so many possible customization points that one can think of, 
some parts like the docs can be easier customized than others, but FYI, nearly 
all of if not all of methods in WADLGenerator are protected.
Create MyWadlGenerator extending WADLGenerator, override whatever is needed, 
and register MyWadlGenerator as a jaxrs:provider


3. Sorry, but did not understand the answer regarding generating 1 WADL per 1 
Rest API class.
Each Rest API class is a different service so don't you think it should 
have the option to have its own WADL file?


It depends. They can be part of the composite service, and quite often, they 
can share the same (XML) schema types. It's not something WADLGenerator should 
be concerned about, trying to push each service docs into a separate file, and 
thinking of how to avoid the schema duplication.

If, in your case, each class does indeed represent a standalone service, then 
IMHO it would be better to create N jaxrs:endpoints, one per each class, as 
opposed to having 1 endpoint with N classes

Sergey



Thanks,
Eyal

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 17 October, 2017 00:06
To: users <users@cxf.apache.org>
Cc: Eyal Weingart <eyal.weing...@exlibrisgroup.com>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi
On 16/10/17 12:35, Eyal Weingart wrote:

Hi,



Not sure to whom i need to send my Questions so hopefully one of you can help 
me.


Forwarding to the CXF users list


I want to use the maven plugin cxf-java2wadl-plugin in order to generate WADL 
from Java rest APIs in build time but i found few issues with that:



1.  Is there a way to custom the generator class so i can apply some 
business code during the build? (is it the 
org.apache.cxf.jaxrs.model.wadl.WadlGenerator that generates it?)


What do you need to customize in the generated WADL ?




2.  When i use multiple DocTarget.RESPONSE in the rest API annotations then 
it generates only the first one it finds


Right, because WADLGenerator only creates a single wadl:response per a
given operation


3.  If i define more than 1 classResourceNames in the configuration in the 
pom.xml then it generates all services under 1 application.wadl file so if i want 1 
WADL file per 1 rest API class then i need to define multiple  (1 
execution per 1 Rest class) - is there a nicer way of doing it?


There's no way to auto-gen 1 wadl per 1 class resource - it would be
hard to achieve because most likely these class resources will share
the schema

Sergey





Example of how i configured it in the pom.xml:



org.apache.cxf

cxf-java2wadl-plugin

   3.1.4

   

   

process-classes1

   
process-classes


   

   
java2wadl


   

   

   



   
com.exlibris.primo.webservices.rest.EShelfRestApi<

/
classResourceName>

   



   
Primo


   
true




   

   

   





Thanks in advance

Eyal




--
Sergey Beryozkin

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



Re: cxf-java2wadl-plugin java2wadl questions

2017-10-17 Thread Sergey Beryozkin

Hi,
On 17/10/17 15:28, Eyal Weingart wrote:

Thanks Sergey for the quick response.

1. Regarding the customization option, one example i can think of (and it 
relates to issue#2 below) is that we want to use multiple DocTarget.RESPONSE in 
order to display multiple error codes and since the generic code does not 
support it then this logic could have been applied in the customization class.

Well, there are so many possible customization points that one can think 
of, some parts like the docs can be easier customized than others, but 
FYI, nearly all of if not all of methods in WADLGenerator are protected.
Create MyWadlGenerator extending WADLGenerator, override whatever is 
needed, and register MyWadlGenerator as a jaxrs:provider



3. Sorry, but did not understand the answer regarding generating 1 WADL per 1 
Rest API class.
Each Rest API class is a different service so don't you think it should 
have the option to have its own WADL file?

It depends. They can be part of the composite service, and quite often, 
they can share the same (XML) schema types. It's not something 
WADLGenerator should be concerned about, trying to push each service 
docs into a separate file, and thinking of how to avoid the schema 
duplication.


If, in your case, each class does indeed represent a standalone service, 
then IMHO it would be better to create N jaxrs:endpoints, one per each 
class, as opposed to having 1 endpoint with N classes


Sergey



Thanks,
Eyal

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: 17 October, 2017 00:06
To: users <users@cxf.apache.org>
Cc: Eyal Weingart <eyal.weing...@exlibrisgroup.com>
Subject: Re: cxf-java2wadl-plugin java2wadl questions

Hi
On 16/10/17 12:35, Eyal Weingart wrote:

Hi,



Not sure to whom i need to send my Questions so hopefully one of you can help 
me.


Forwarding to the CXF users list


I want to use the maven plugin cxf-java2wadl-plugin in order to generate WADL 
from Java rest APIs in build time but i found few issues with that:



1.  Is there a way to custom the generator class so i can apply some 
business code during the build? (is it the 
org.apache.cxf.jaxrs.model.wadl.WadlGenerator that generates it?)


What do you need to customize in the generated WADL ?




2.  When i use multiple DocTarget.RESPONSE in the rest API annotations then 
it generates only the first one it finds


Right, because WADLGenerator only creates a single wadl:response per a given 
operation


3.  If i define more than 1 classResourceNames in the configuration in the 
pom.xml then it generates all services under 1 application.wadl file so if i want 1 
WADL file per 1 rest API class then i need to define multiple  (1 
execution per 1 Rest class) - is there a nicer way of doing it?


There's no way to auto-gen 1 wadl per 1 class resource - it would be hard to 
achieve because most likely these class resources will share the schema

Sergey





Example of how i configured it in the pom.xml:



   org.apache.cxf

   cxf-java2wadl-plugin

  3.1.4

  

  

process-classes1

  
process-classes


  

  
java2wadl


  

  

  

  
com.exlibris.primo.webservices.rest.EShelfRestApi
classResourceName>

  

  
Primo


  
true


   

  

  

  





Thanks in advance

Eyal




--
Sergey Beryozkin

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



Re: JAX-RS Interrupt StreamingOutput

2017-10-17 Thread Sergey Beryozkin

I've reproduced it with the Java client as well,

I guess in your case you can try to make sure ZIP has already been 
generated by the time it's requested.


Not sure how to fix that, may be close the connection somehow at the 
server side, if the exception is reported after the write started, Dan, 
what do you think ?


Sergey

On 16/10/17 14:43, MULLER, Anthony wrote:

Right, this exception is not seen at all by web browsers... The client received 
a corrupted ZIP archive. No error is pop-up :-/

That's why I'm wondering if there is any ways to indicate this case, though 
protocols.

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: lundi 16 octobre 2017 11:50
To: users@cxf.apache.org
Subject: Re: JAX-RS Interrupt StreamingOutput

Hi Anthony

And in the browser case this exception is not recognized/seen at all ?

What I'm trying to say, is that if, in the Java client case, it is
recognized then then browser should also be well capable of reporting
the error, and thus preventing the user downloading a corrupted Zip file
without having no notification something went wrong.

Sergey
On 16/10/17 10:41, MULLER, Anthony wrote:

Hi Sergey,

The server throws an exception when there is an issue during the ZIP generation.

Anthony


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: lundi 16 octobre 2017 11:15
To: users@cxf.apache.org
Subject: Re: JAX-RS Interrupt StreamingOutput

Hi,

How does the JAX-RS server code react when it sees some issue, does it
throw some exception ?

Sergey
On 16/10/17 10:05, MULLER, Anthony wrote:

Hi Sergey,

Thank you very much for your reply!

The point here is that the client isn't a Java application, but a Web browser 
for instance (like Chrome).

Best regards,
Anthony

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: lundi 16 octobre 2017 10:38
To: users@cxf.apache.org
Subject: Re: JAX-RS Interrupt StreamingOutput

Hi Anthony

AFAIK the status goes first with the 1st write, so there's really no way
to replace it with something else if there was an error later on while
writing the stream.

I don't think so the fact a client gets 200 and then, presumably,
IOException, is inconsistent, the client code reading the data directly
from the input stream always has a catch for IOException, it can be
thrown even if there were no errors on the server side when writing it...

Sergey


On 13/10/17 12:30, MULLER, Anthony wrote:

Hello,

I have a REST call which returns a generated ZIP output. But during generation, 
an issue may occurred... However, the client seems to receive a HTTP code 200 
with a corrupted ZIP.

Is it possible to do better? Is this case managed by HTTP protocol? By CXF?

Best regards,
Anthony



Re: REST request from the service itself

2017-10-17 Thread Sergey Beryozkin

I did it in this test:

https://github.com/apache/cxf/blob/master/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl.java#L55

and

https://github.com/apache/cxf/blob/master/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl.java#L112

It's injected from this context

https://github.com/apache/cxf/blob/master/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml#L29

I don't recall right now what the idea behind it was though :-)

Cheers, Sergey

On 17/10/17 11:14, Allan C. wrote:

I find this interesting. Can you share the use cases?

Regards, Allan.

Sent from Gmail mobile.

On 17 Oct 2017 17:24, "MULLER, Anthony"  wrote:


Hello,

I'm wondering if it's possible, from inside the RESTful service
implementation, to make a RESTful call to itself?

Regards,
Anthony





Re: cxf-java2wadl-plugin java2wadl questions

2017-10-16 Thread Sergey Beryozkin

Hi
On 16/10/17 12:35, Eyal Weingart wrote:

Hi,



Not sure to whom i need to send my Questions so hopefully one of you can help 
me.


Forwarding to the CXF users list


I want to use the maven plugin cxf-java2wadl-plugin in order to generate WADL 
from Java rest APIs in build time but i found few issues with that:



1.  Is there a way to custom the generator class so i can apply some 
business code during the build? (is it the 
org.apache.cxf.jaxrs.model.wadl.WadlGenerator that generates it?)


What do you need to customize in the generated WADL ?




2.  When i use multiple DocTarget.RESPONSE in the rest API annotations then 
it generates only the first one it finds

Right, because WADLGenerator only creates a single wadl:response per a 
given operation


3.  If i define more than 1 classResourceNames in the configuration in the 
pom.xml then it generates all services under 1 application.wadl file so if i want 1 
WADL file per 1 rest API class then i need to define multiple  (1 
execution per 1 Rest class) - is there a nicer way of doing it?

There's no way to auto-gen 1 wadl per 1 class resource - it would be 
hard to achieve because most likely these class resources will share the 
schema


Sergey





Example of how i configured it in the pom.xml:



  org.apache.cxf

  cxf-java2wadl-plugin

 3.1.4

 

 

process-classes1

 process-classes

 

 java2wadl

 

 

 

 
com.exlibris.primo.webservices.rest.EShelfRestApi

 

 
Primo

 true

  

 

 

 





Thanks in advance

Eyal




--
Sergey Beryozkin

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


Re: JAX-RS Interrupt StreamingOutput

2017-10-16 Thread Sergey Beryozkin

Hi Anthony

And in the browser case this exception is not recognized/seen at all ?

What I'm trying to say, is that if, in the Java client case, it is 
recognized then then browser should also be well capable of reporting 
the error, and thus preventing the user downloading a corrupted Zip file 
without having no notification something went wrong.


Sergey
On 16/10/17 10:41, MULLER, Anthony wrote:

Hi Sergey,

The server throws an exception when there is an issue during the ZIP generation.

Anthony


-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: lundi 16 octobre 2017 11:15
To: users@cxf.apache.org
Subject: Re: JAX-RS Interrupt StreamingOutput

Hi,

How does the JAX-RS server code react when it sees some issue, does it
throw some exception ?

Sergey
On 16/10/17 10:05, MULLER, Anthony wrote:

Hi Sergey,

Thank you very much for your reply!

The point here is that the client isn't a Java application, but a Web browser 
for instance (like Chrome).

Best regards,
Anthony

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: lundi 16 octobre 2017 10:38
To: users@cxf.apache.org
Subject: Re: JAX-RS Interrupt StreamingOutput

Hi Anthony

AFAIK the status goes first with the 1st write, so there's really no way
to replace it with something else if there was an error later on while
writing the stream.

I don't think so the fact a client gets 200 and then, presumably,
IOException, is inconsistent, the client code reading the data directly
from the input stream always has a catch for IOException, it can be
thrown even if there were no errors on the server side when writing it...

Sergey


On 13/10/17 12:30, MULLER, Anthony wrote:

Hello,

I have a REST call which returns a generated ZIP output. But during generation, 
an issue may occurred... However, the client seems to receive a HTTP code 200 
with a corrupted ZIP.

Is it possible to do better? Is this case managed by HTTP protocol? By CXF?

Best regards,
Anthony



Re: JAX-RS Interrupt StreamingOutput

2017-10-16 Thread Sergey Beryozkin

Hi,

How does the JAX-RS server code react when it sees some issue, does it 
throw some exception ?


Sergey
On 16/10/17 10:05, MULLER, Anthony wrote:

Hi Sergey,

Thank you very much for your reply!

The point here is that the client isn't a Java application, but a Web browser 
for instance (like Chrome).

Best regards,
Anthony

-Original Message-
From: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Sent: lundi 16 octobre 2017 10:38
To: users@cxf.apache.org
Subject: Re: JAX-RS Interrupt StreamingOutput

Hi Anthony

AFAIK the status goes first with the 1st write, so there's really no way
to replace it with something else if there was an error later on while
writing the stream.

I don't think so the fact a client gets 200 and then, presumably,
IOException, is inconsistent, the client code reading the data directly
from the input stream always has a catch for IOException, it can be
thrown even if there were no errors on the server side when writing it...

Sergey


On 13/10/17 12:30, MULLER, Anthony wrote:

Hello,

I have a REST call which returns a generated ZIP output. But during generation, 
an issue may occurred... However, the client seems to receive a HTTP code 200 
with a corrupted ZIP.

Is it possible to do better? Is this case managed by HTTP protocol? By CXF?

Best regards,
Anthony



Re: JAX-RS Interrupt StreamingOutput

2017-10-16 Thread Sergey Beryozkin

Hi Anthony

AFAIK the status goes first with the 1st write, so there's really no way 
to replace it with something else if there was an error later on while 
writing the stream.


I don't think so the fact a client gets 200 and then, presumably, 
IOException, is inconsistent, the client code reading the data directly 
from the input stream always has a catch for IOException, it can be 
thrown even if there were no errors on the server side when writing it...


Sergey


On 13/10/17 12:30, MULLER, Anthony wrote:

Hello,

I have a REST call which returns a generated ZIP output. But during generation, 
an issue may occurred... However, the client seems to receive a HTTP code 200 
with a corrupted ZIP.

Is it possible to do better? Is this case managed by HTTP protocol? By CXF?

Best regards,
Anthony



Re: FIQL: escape comma

2017-10-12 Thread Sergey Beryozkin

Hi Francesco

You are very kind, very often I've no idea (at least at the start) what 
is going on with the code I did :-)


Thanks, Sergey
On 12/10/17 14:51, Francesco Chicchiriccò wrote:

On 12/10/2017 11:23, Sergey Beryozkin wrote:

Hi Francesco

Sorry I did not help, checked your emails this morning only...


No worries Sergey, you've been precious - and I'm sure you'll be in the 
future - so many times!


Cheers.


On 12/10/17 10:14, Francesco Chicchiriccò wrote:
It turned out that the problem below was originated by the following 
statement:


https://github.com/apache/syncope/blob/2_0_X/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/search/SearchCondVisitor.java#L74 



in the custom SearchConditionVisitor, which does not expect a value 
to be URL-decoded.


Regards.

On 12/10/2017 10:09, Francesco Chicchiriccò wrote:

Further test: with

fiql=ctype%3D%3Dou%3Dsample%252Co%3Disp

(rather than fiql=ctype%3D%3Dou%3Dsample,o%3Disp  as below)

no exceptions are raised,  but the FIQL string received on server 
side is


ctype==ou=sample%2Co=isp

and then parsed by [1] as

ou=sample\%2Co=isp

Any idea of what I am doing wrong here? Thanks.

Regards.

On 11/10/2017 17:51, Francesco Chicchiriccò wrote:

How to correctly escape the following FIQL expression?

ctype==ou=sample,o=isp

?

I have set the jaxrs:properties

  
  
  

but the request URL

 http://localhost:9080/syncope/rest/users?fiql=ctype%3D%3Dou%3Dsample,o%3Disp 



fails with

17:47:19.129 ERROR 
org.apache.syncope.core.rest.cxf.service.AbstractServiceImpl - 
Invalid FIQL expression: ctype==ou=sample,o=isp
org.apache.cxf.jaxrs.ext.search.SearchParseException: Not a 
comparison expression: o=isp
    at 
org.apache.syncope.common.lib.search.SyncopeFiqlParser.parseComparison(SyncopeFiqlParser.java:90) 
~[syncope-common-lib-2.0.7-SNAPSHOT.jar:2.0.7-SNAPSHOT]
    at 
org.apache.cxf.jaxrs.ext.search.fiql.FiqlParser.parseAndsOrsBrackets(FiqlParser.java:230) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]
    at 
org.apache.cxf.jaxrs.ext.search.fiql.FiqlParser.parse(FiqlParser.java:167) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]
    at 
org.apache.cxf.jaxrs.ext.search.SearchContextImpl.getCondition(SearchContextImpl.java:101) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]
    at 
org.apache.cxf.jaxrs.ext.search.SearchContextImpl.getCondition(SearchContextImpl.java:82) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]
    at 
org.apache.cxf.jaxrs.ext.search.SearchContextImpl.getCondition(SearchContextImpl.java:76) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]


As you can see from the stacktrace, I am using my own parser [1].

TIA
Regards.


[1] 
https://github.com/apache/syncope/blob/2_0_X/common/lib/src/main/java/org/apache/syncope/common/lib/search/SyncopeFiqlParser.java 





Re: Swagger2feature / 3.1.12 (DOSGI)

2017-10-12 Thread Sergey Beryozkin
Hmm... I may've been wrong with some of the assumptions about what 
Swagger2Feature does.


Can you please do a breakpoint at

https://github.com/apache/cxf/blob/cxf-3.1.12/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/AbstractSwaggerFeature.java#L103

and see what happens, without even doing setHost().

I won't have time for a while to investigate it. But I'll take care of 
adding a test for checking that setHost() works later on


Cheers, Sergey

On 12/10/17 13:42, nino martinez wael wrote:

Sure, I've made the changes to the cxf spring boot sample:

https://github.com/nmwael/cxf/commit/86630259982786f013faad658e84bd27bca368b7


The resulting swagger.json does not honor the host property, host 
remains the same no matter what:


"host":"0.0.0.0:9000 <http://0.0.0.0:9000>"







On Thu, Oct 12, 2017 at 1:32 PM, Sergey Beryozkin <sberyoz...@gmail.com 
<mailto:sberyoz...@gmail.com>> wrote:


Hi

CXF does not contribute itself to the generation of 'host' within
the Swagger JSON. For example, try a jaxrs/spring-boot demo, or some
of other swagger2 demos...

If you'd like you can get the CXF source, and step through the CXF
Swagger2Feature

Sergey

On 12/10/17 11:06, nino martinez wael wrote:

Hi Sergey,

I've tried this:

Swagger2Feature swagger =new Swagger2Feature();

swagger.setHost("127.0.0.1:9090 <http://127.0.0.1:9090>
<http://127.0.0.1:9090>");

swagger.setUsePathBasedConfig(true);


BUT the swagger json still states:


0.0.0.0:9090 <http://0.0.0.0:9090> <http://0.0.0.0:9090>


As far as I can see it is something CXF generates.. I cant
really pinpoint where CXF grabs the configuration from, but if I
change

swagger.setLicense("Commercial DOES THIS APPLY?");


It does apply in the swagger json and I am able to change that
part, it is as CXF ignores the swagger.getHOST method...



On Thu, Oct 12, 2017 at 11:25 AM, Sergey Beryozkin
<sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>> wrote:

     In this case it is really somewhere in the Swagger code

     Sergey
     On 11/10/17 18:29, nino martinez wael wrote:

         No problem, I tried both configurations but no matter
what I do,
         the host remains the same 0.0.0.0:9090
<http://0.0.0.0:9090> <http://0.0.0.0:9090>
         <http://0.0.0.0:9090>

         On 11 Oct 2017 15:51, "Sergey Beryozkin"
<sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
         <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>> <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>
         <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>>>> wrote:

              Sorry, I accidentally moved it from the users list,


              On 11/10/17 14:42, nino martinez wael wrote:

                  Sure, in my example you can see that host
0.0.0.0:9090 <http://0.0.0.0:9090>
         <http://0.0.0.0:9090>
                  <http://0.0.0.0:9090> <http://0.0.0.0:9090>
have been
                  generated.. However calling

http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns
<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>>>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>>>>



                  Will never

Re: Swagger2feature / 3.1.12 (DOSGI)

2017-10-12 Thread Sergey Beryozkin

Hi

CXF does not contribute itself to the generation of 'host' within the 
Swagger JSON. For example, try a jaxrs/spring-boot demo, or some of 
other swagger2 demos...


If you'd like you can get the CXF source, and step through the CXF 
Swagger2Feature


Sergey

On 12/10/17 11:06, nino martinez wael wrote:

Hi Sergey,

I've tried this:

Swagger2Feature swagger =new Swagger2Feature();

swagger.setHost("127.0.0.1:9090 <http://127.0.0.1:9090>");

swagger.setUsePathBasedConfig(true);


BUT the swagger json still states:


0.0.0.0:9090 <http://0.0.0.0:9090>


As far as I can see it is something CXF generates.. I cant really pinpoint 
where CXF grabs the configuration from, but if I change

swagger.setLicense("Commercial DOES THIS APPLY?");


It does apply in the swagger json and I am able to change that part, it is as 
CXF ignores the swagger.getHOST method...



On Thu, Oct 12, 2017 at 11:25 AM, Sergey Beryozkin <sberyoz...@gmail.com 
<mailto:sberyoz...@gmail.com>> wrote:


In this case it is really somewhere in the Swagger code

Sergey
On 11/10/17 18:29, nino martinez wael wrote:

No problem, I tried both configurations but no matter what I do,
the host remains the same 0.0.0.0:9090 <http://0.0.0.0:9090>
<http://0.0.0.0:9090>

On 11 Oct 2017 15:51, "Sergey Beryozkin" <sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com> <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>>> wrote:

     Sorry, I accidentally moved it from the users list,


     On 11/10/17 14:42, nino martinez wael wrote:

         Sure, in my example you can see that host 0.0.0.0:9090
<http://0.0.0.0:9090>
         <http://0.0.0.0:9090> <http://0.0.0.0:9090> have been
         generated.. However calling

http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns
<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>>>



         Will never work.. It has to be an IP or dns name..
0.0.0.0 is
         not valid..


     CXF Swagger2Feature is definitely not involved into
generating a
     host value, but it has a 'host' property which if set is
passed to
     Swagger.

     May be alternative option is to set a 'usePathBasedConfig'
    property
     - I think this may actually work better

     HTH, SErgey



         On Wed, Oct 11, 2017 at 3:19 PM, Sergey Beryozkin
         <sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>
         <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com> <mailto:sberyoz...@gmail.com
<mailto:sberyoz...@gmail.com>>>> wrote:

              Can you please explain what is wrong with the returned
         fragment ?

              Sergey

              On 11/10/17 14:12, nino martinez wael wrote:

                  Im not sure if I have explained myself
correctly.. The
         problem
                  is this:

http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/
<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/>

<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/

<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/>>

<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/

<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/>

<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/

<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/>>>

                  {
                      "swagger" : "2.0",
                      "info" : {
                        "description" : "Osgi Dialer Webservice",
                        "version" : "1.26.0.SNAPSHOT",
                        "title" : "Osgi Dialer Webservice",
                        "

Re: Swagger2feature / 3.1.12 (DOSGI)

2017-10-12 Thread Sergey Beryozkin

In this case it is really somewhere in the Swagger code

Sergey
On 11/10/17 18:29, nino martinez wael wrote:
No problem, I tried both configurations but no matter what I do, the 
host remains the same 0.0.0.0:9090 <http://0.0.0.0:9090>


On 11 Oct 2017 15:51, "Sergey Beryozkin" <sberyoz...@gmail.com 
<mailto:sberyoz...@gmail.com>> wrote:


Sorry, I accidentally moved it from the users list,


On 11/10/17 14:42, nino martinez wael wrote:

Sure, in my example you can see that host 0.0.0.0:9090
<http://0.0.0.0:9090> <http://0.0.0.0:9090> have been
generated.. However calling

http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns
<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>
<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns
<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>>



Will never work.. It has to be an IP or dns name.. 0.0.0.0 is
not valid..


CXF Swagger2Feature is definitely not involved into generating a
host value, but it has a 'host' property which if set is passed to
Swagger.

May be alternative option is to set a 'usePathBasedConfig' property
- I think this may actually work better

    HTH, SErgey



On Wed, Oct 11, 2017 at 3:19 PM, Sergey Beryozkin
<sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>
<mailto:sberyoz...@gmail.com <mailto:sberyoz...@gmail.com>>> wrote:

     Can you please explain what is wrong with the returned
fragment ?

     Sergey

     On 11/10/17 14:12, nino martinez wael wrote:

         Im not sure if I have explained myself correctly.. The
problem
         is this:

http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/
<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/>

<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/

<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/>>

         {
             "swagger" : "2.0",
             "info" : {
               "description" : "Osgi Dialer Webservice",
               "version" : "1.26.0.SNAPSHOT",
               "title" : "Osgi Dialer Webservice",
               "contact" : {
                 "name" : "developm...@tdcnetdesign.dk
<mailto:developm...@tdcnetdesign.dk>
         <mailto:developm...@tdcnetdesign.dk
<mailto:developm...@tdcnetdesign.dk>>"

               },
               "license" : {
                 "name" : "Commercial",
                 "url" :
"http://www.apache.org/licenses/LICENSE-2.0.html
<http://www.apache.org/licenses/LICENSE-2.0.html>
         <http://www.apache.org/licenses/LICENSE-2.0.html
<http://www.apache.org/licenses/LICENSE-2.0.html>>"
               }
             },  "host" : "0.0.0.0:9090 <http://0.0.0.0:9090>
<http://0.0.0.0:9090>",

             "basePath" : "/tdc/dialer/webservices/v1",
             "tags" : [ {
               "name" : "api-docs"
             }


         Swagger UI then generates requests like this:

http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns
<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns

<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>>


         Which obviously fails.. How can I change this behaviour?


         On Tue, Oct 10, 2017 at 3:31 PM, nino martinez wael <
nino.martinez.w...@gmail.com <mailto:nino.martinez.w...@gmail.com>
         <mailto:nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>>> wrote:

             Hi

             I am running a dedicated CXF JAX RS on 0.0.0.0:9090
<http://0.0.0.0:9090>
             <http://0.0.0.0:9090>


             the issue are that my swagger.json states that the
host are
0.0.0.0:9090 <http://0.0.0.0:9090> <http://0.0.0.0:9090>


             I've tried to overwrite it using:

             Swagger2Feature swagger = new Swagger2Feature();
             swagger.setHost("127.0.0.1:9000
<http://127.0.0.1:9000> <http://127.0.0.1:9000>");


             But swagger.json remains unchanged. What am I missing?


             --
             Best regards / Med venlig hilsen
             Nino Martinez







-- 
Best regards / Med venlig hilsen

Nino Martinez




Re: FIQL: escape comma

2017-10-12 Thread Sergey Beryozkin

Hi Francesco

Sorry I did not help, checked your emails this morning only...

Sergey
On 12/10/17 10:14, Francesco Chicchiriccò wrote:
It turned out that the problem below was originated by the following 
statement:


https://github.com/apache/syncope/blob/2_0_X/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/search/SearchCondVisitor.java#L74 



in the custom SearchConditionVisitor, which does not expect a value to 
be URL-decoded.


Regards.

On 12/10/2017 10:09, Francesco Chicchiriccò wrote:

Further test: with

fiql=ctype%3D%3Dou%3Dsample%252Co%3Disp

(rather than fiql=ctype%3D%3Dou%3Dsample,o%3Disp  as below)

no exceptions are raised,  but the FIQL string received on server side is

ctype==ou=sample%2Co=isp

and then parsed by [1] as

ou=sample\%2Co=isp

Any idea of what I am doing wrong here? Thanks.

Regards.

On 11/10/2017 17:51, Francesco Chicchiriccò wrote:

How to correctly escape the following FIQL expression?

ctype==ou=sample,o=isp

?

I have set the jaxrs:properties

  
  
  

but the request URL

 http://localhost:9080/syncope/rest/users?fiql=ctype%3D%3Dou%3Dsample,o%3Disp 



fails with

17:47:19.129 ERROR 
org.apache.syncope.core.rest.cxf.service.AbstractServiceImpl - 
Invalid FIQL expression: ctype==ou=sample,o=isp
org.apache.cxf.jaxrs.ext.search.SearchParseException: Not a 
comparison expression: o=isp
    at 
org.apache.syncope.common.lib.search.SyncopeFiqlParser.parseComparison(SyncopeFiqlParser.java:90) 
~[syncope-common-lib-2.0.7-SNAPSHOT.jar:2.0.7-SNAPSHOT]
    at 
org.apache.cxf.jaxrs.ext.search.fiql.FiqlParser.parseAndsOrsBrackets(FiqlParser.java:230) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]
    at 
org.apache.cxf.jaxrs.ext.search.fiql.FiqlParser.parse(FiqlParser.java:167) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]
    at 
org.apache.cxf.jaxrs.ext.search.SearchContextImpl.getCondition(SearchContextImpl.java:101) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]
    at 
org.apache.cxf.jaxrs.ext.search.SearchContextImpl.getCondition(SearchContextImpl.java:82) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]
    at 
org.apache.cxf.jaxrs.ext.search.SearchContextImpl.getCondition(SearchContextImpl.java:76) 
~[cxf-rt-rs-extension-search-3.1.13.jar:3.1.13]


As you can see from the stacktrace, I am using my own parser [1].

TIA
Regards.


[1] 
https://github.com/apache/syncope/blob/2_0_X/common/lib/src/main/java/org/apache/syncope/common/lib/search/SyncopeFiqlParser.java 






--
Sergey Beryozkin

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


Re: Swagger2feature / 3.1.12 (DOSGI)

2017-10-11 Thread Sergey Beryozkin

Sorry, I accidentally moved it from the users list,


On 11/10/17 14:42, nino martinez wael wrote:
Sure, in my example you can see that host 0.0.0.0:9090 
<http://0.0.0.0:9090> have been generated.. However calling


http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns 
<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>



Will never work.. It has to be an IP or dns name.. 0.0.0.0 is not valid..


CXF Swagger2Feature is definitely not involved into generating a host 
value, but it has a 'host' property which if set is passed to Swagger.


May be alternative option is to set a 'usePathBasedConfig' property - I 
think this may actually work better


HTH, SErgey




On Wed, Oct 11, 2017 at 3:19 PM, Sergey Beryozkin <sberyoz...@gmail.com 
<mailto:sberyoz...@gmail.com>> wrote:


Can you please explain what is wrong with the returned fragment ?

Sergey

On 11/10/17 14:12, nino martinez wael wrote:

Im not sure if I have explained myself correctly.. The problem
is this:

http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/
<http://localhost:9090/tdc/dialer/webservices/v1/swagger.json#/>

{
    "swagger" : "2.0",
    "info" : {
      "description" : "Osgi Dialer Webservice",
      "version" : "1.26.0.SNAPSHOT",
      "title" : "Osgi Dialer Webservice",
      "contact" : {
        "name" : "developm...@tdcnetdesign.dk
<mailto:developm...@tdcnetdesign.dk>"
      },
      "license" : {
        "name" : "Commercial",
        "url" : "http://www.apache.org/licenses/LICENSE-2.0.html
<http://www.apache.org/licenses/LICENSE-2.0.html>"
      }
    },  "host" : "0.0.0.0:9090 <http://0.0.0.0:9090>",
    "basePath" : "/tdc/dialer/webservices/v1",
    "tags" : [ {
      "name" : "api-docs"
    }


Swagger UI then generates requests like this:

http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns
<http://0.0.0.0:9090/tdc/dialer/webservices/v1/fullcampaigns>


Which obviously fails.. How can I change this behaviour?


On Tue, Oct 10, 2017 at 3:31 PM, nino martinez wael <
nino.martinez.w...@gmail.com
<mailto:nino.martinez.w...@gmail.com>> wrote:

Hi

I am running a dedicated CXF JAX RS on 0.0.0.0:9090
<http://0.0.0.0:9090>

the issue are that my swagger.json states that the host are
0.0.0.0:9090 <http://0.0.0.0:9090>

I've tried to overwrite it using:

Swagger2Feature swagger = new Swagger2Feature();
swagger.setHost("127.0.0.1:9000 <http://127.0.0.1:9000>");

But swagger.json remains unchanged. What am I missing?


--
Best regards / Med venlig hilsen
Nino Martinez







--
Best regards / Med venlig hilsen
Nino Martinez


Re: External App appears incompatible with CXF. What can I do?

2017-10-10 Thread Sergey Beryozkin

Hi

Try to experiment with the CXF TransformationFeature

http://cxf.apache.org/docs/transformationfeature.html

Sergey
On 06/10/17 20:51, Erwin Hogeweg wrote:

Hi,

I have a CXF SOAP web service that generates the (partial) response below. This 
works perfectly with SoapUI and DOSGi.

We are using another application with this web service though that doesn’t seem to 
understand the response past the  tag. Nothing is parsed after that.

http://schemas.xmlsoap.org/soap/envelope/;>
   
  http://service.my.com/;>
 
http://vo.model.my.com;>
   1235
   601 Some Address - 1201
   Hogeweg Erwin HQ
   
…

I am have no idea what is happening since I don’t have access to the source 
code of that app. I am speculating though that the app chokes on the ns2 
definition. So here comes my question:

Is there any way to control that with CXF-3.1.1 and DOSGi-1.7.0, and stick to 
the same ns1 namespace (if that is even allowed by the specification) so I can 
test my hypothesis?

FWIW, the service properties are defined in an OSGi component definition as 
follows:

@Component(immediate = true,
name = "com.my.service",
configurationPolicy=ConfigurationPolicy.REQUIRE,
property = {
"type=internal",
"service.exported.interfaces=*",
"service.exported.configs=org.apache.cxf.ws",
"org.apache.cxf.ws.address=/MyService",
}


Any suggestion is greatly appreciated.

Thanks for reading.

Erwin

Erwin Hogeweg
CTO
3690 Airport Road
Boca Raton, FL 33431
P. +1 (954) 556-6565
M. +1 (561) 306-7395
F. +1 (561) 948-2730
[Seecago]<http://www.seecago.com>




--
Sergey Beryozkin

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


Re: CXF - Content-Type: multipart/related start attribute support missing

2017-10-04 Thread Sergey Beryozkin

Hi

sorry for a delay,

Can you please check
https://issues.apache.org/jira/browse/CXF-6431

Is it relevant to the problem you are seeing ?

Cheers, Sergey
On 21/09/17 10:53, RayD wrote:

Hi Sergey,

confirmed as not working with 3.1.13.

Looking at the code, I cannot see any checks in the
org.apache.cxf.attachment.AttachmentDeserializer class to ensure that the
start attribute is handled correctly.

I can see some tests within the AttachmentDeserializerTest class that use
the start attribute, but none that look to replicate where the root is not
the first body part.

looks like a bug..?



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html



Re: org.apache.cxf.osgi.cfg redirect

2017-09-26 Thread Sergey Beryozkin

On 26/09/17 12:54, smunro wrote:

Thanks for the quick reply.

I tried your pre match filter suggestion and found it worked only if I put
the full URL in. If I left it as http://localhost:8181 the filter wasn't
hit. I suspect this is because of the root context I've specified in the cxf
properties.


well, I'm not sure what to do in this case, if the CXF runtime is not 
reached then it's trickier.>

I don't have any web.xml configs, it's purely annotated REST Pojos.  Just
the standard REST.xml and the osgi property for overriding the container
settings.
In this case a default CXF HTTP Transport is used supported by a 
somewhat limited Jetty server, which is not capable of supporting the 
RequestDispatcher redirects. Thus one needs to use a webbundle 
deployment if you'd like this particular CXF feature be supported - you 
can still keep the contexts, but use CXFBlueprintServlet


Sergey




--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html



Re: org.apache.cxf.osgi.cfg redirect

2017-09-26 Thread Sergey Beryozkin

Hi

I believe for this to work you'd need to have 2 CXFServlets and deployed 
a bundle as a war-bundle


https://github.com/Talend/tesb-rt-se/blob/master/examples/cxf/jaxrs-jaxws-transformations/war-bundle/src/main/resources/WEB-INF/web.xml

If you have Blueprint contexts, then try CXFBlueprintServlet:

https://github.com/apache/cxf/blob/master/systests/jaxrs/src/test/resources/jaxrs_soap_blueprint/WEB-INF/web.xml

(with the same redirect parameters)

It was awhile since I looked into it, but it can work...

Perhaps a simpler alternative is to have a JAX-RS 2.0 pre-match filter 
in front of the old endpoint redirecting to the new endpoint bby 
updating the request URI...


HTH, Sergey
On 25/09/17 22:00, smunro wrote:

Hello,

I'm a little new to using cxf with osgi, so I may be over complicating this
somewhat..

Basically, I have a org.apache.cxf.osgi.cfg file with
org.apache.cxf.servlet.context=/demo-client/api

This is fine if the user plugs in http://localhost:8181/demo-client/api,
however, I also need to be able to redirect http://localhost:8181 to
http://localhost:8181/demo-client/api.

Is there an easy way to do this via the config or blueprint file? ive tried
using the redirectList param, but I've not managed to get it to work.

Any ideas would be welcome.

Thanks,
Stephen



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html



Re: SpringBoot and JAX-RS Service Auto Discovery...

2017-09-20 Thread Sergey Beryozkin
Yeah, start Eureka app first, next - the server app, give it few secs 
for Eureka to pick the registrations, run the client...


Sergey
On 20/09/17 07:07, Dennis Kieselhorst wrote:

Is there an example project that includes this feature?
I must be missing something. What dependency does it
need for the eureka stuff to kick in?


Try this one:
https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/spring_boot_scan

Dennis



Re: SpringBoot and JAX-RS Service Auto Discovery...

2017-09-19 Thread Sergey Beryozkin

Hi James,

Which CXF version is it ?

I'm pretty sure I run the spring_boot_scan/client few weeks back, with 
3.2.0, and it worked fine, WebClient and Proxy are used there...


Cheers, Sergey

On 19/09/17 19:47, James Carman wrote:

I am trying to figure out how to get auto discovery working for generated
JAX-RS proxies.  I looked at the example referenced in the docs, but I keep
getting:

org.springframework.beans.factory.BeanCreationException: Error creating
bean with name
'org.apache.cxf.jaxrs.client.spring.JaxRsProxyClientConfiguration':
Injection of autowired dependencies failed; nested exception is
java.lang.IllegalArgumentException: Could not resolve placeholder
'cxf.jaxrs.client.address' in value "${cxf.jaxrs.client.address}"

Any ideas?  Are there any examples I can run that show how to automatically
discover and client load balance between multiple endpoints for another
service?




--
Sergey Beryozkin

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


Re: CXF - Content-Type: multipart/related start attribute support missing

2017-09-19 Thread Sergey Beryozkin

On 19/09/17 13:28, RayD wrote:

Question relating to the use of the start attribute on the Content-Type
Header which appears to have been dropped from CXF somewhere along the way.

According to  https://tools.ietf.org/html/rfc2387
  ,  start is an optional attribute and
I would have expected it to be supported for multipart/related content
types.

3.2.  The Start Parameter

The start parameter, if given, is the content-ID of the compound
object's "root".  If not present the "root" is the first body part in
the Multipart/Related entity.  The "root" is the element the
applications processes first.

I also found this link which suggests that it was dropped from the
specification as was considered redundant (however this was for
multipart/mixed which would make sense and not multipart/related).
https://issues.apache.org/jira/browse/CXF-4348

Yes, this changes related to that issue were about making the 'start' 
not needed for non multipart/related multipart types...




Anyone know why this is no longer supported for multipart/related ?
FYI am using CXF version 3.1.7.
Are you seeing 'start' being not available for multipart/related with 
JAX-RS or JAX-WS ? Can you try 3.1.13 ?


Sergey






--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html



Re: Does SSE + CDI work?

2017-09-18 Thread Sergey Beryozkin

Ok, I added
@Provider(value = Type.Feature, scope = Scope.Server)

Andriy, will CXF CDI auto-discover it now or will it have to be updated 
a bit to have CXF features/interceptors picked up, same way we can do it 
for Spring ?


Thanks, Sergey
On 18/09/17 11:27, Sergey Beryozkin wrote:

On 18/09/17 11:14, John D. Ament wrote:

I'm assuming you mean
https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/sse_cdi/src/main/java/demo/jaxrs/sse/StatsApplication.java#L39 


?
That looks manually registered.

It should not be there,

we need to add a CXF @Provider(type=Feature) to

https://github.com/apache/cxf/blob/master/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/SseFeature.java 





For my #1 its a CDI 2.0 feature.  I think it'll work with this approach
though.

Any thoughts on the instability?
Well, it's a totally new feature. I know Andriy found some issues while 
working on the integration with Atmosphere, my understanding there were 
many timing related test issues, but what is more important is how it 
works once the server is up an running, for a regular application, is 
not stable in your case ?


Sergey


John

On Mon, Sep 18, 2017 at 5:09 AM Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Have a look at the sse cdi demo Andriy added to the distribution,
the feature (the one dealing with SSE) is expected to be 
auto-registered.


Re the transport id, by default CXF assumes it is 'plain' HTTP, so it
needs a hint.

What did you mean with 1) ?

Sergey

On 18/09/17 00:57, John D. Ament wrote:

Ok, i was able to work a bit deeper into this.

1. the integration works, but firing async events doesn't work.  I'm 
not
sure it should, since you're just appending to the request; but I 
want to

play with async requests a bit.

2. The integration seems flakey I'm afraid.  I'll run a test, almost

always

it passes, but then every off test run will cause SSE to not get
activated.  I have no reproducer for this.

When it does fail, all I get on the log is

Sep 17, 2017 7:50:33 PM

org.apache.cxf.transport.servlet.ServletController

invoke
WARNING: Can't find the request for http://my-hostname:4403/rest's

Observer


However, I see none of the atmosphere bootstrap occurring when this
happens.  Here's full logs for both failure and success:
https://paste.apache.org/rWwj

3. I had to manually install the feature.  Does CXF have any notion of
automatically registering features?

4. I also had to customize the transport id.  It would be good if this

was

automatic.

John

On Sun, Sep 17, 2017 at 4:21 PM John D. Ament <johndam...@apache.org>

wrote:


I'm trying to create a very basic example of using SSE + CDI 
events.  To
do that, I created a basic endpoint based on a CXF systest that I 
found,

but tried to adapt it to work with CDI.

@Path("/sse")
@RequestScoped
public class SseEventEndpoint {
  @Inject
  private Event event;
  @Context
  private Sse sse;
  @GET
  @Path("{connectionId}")
  @Produces(MediaType.SERVER_SENT_EVENTS)
  public void onEvent(@Context SseEventSink sink,
@PathParam("connectionId") final String id) {
  System.out.println("Received request "+sse);
  event.fireAsync(new SseEvent(sink, sse, id));
  }
}

However, no matter what I do, the Sse object is null.  Is there

something

I need to do to enable Sse integration?  This is what my dependencies

look

like

  
  org.apache.cxf
  cxf-integration-cdi
  
  
  org.apache.cxf
  cxf-rt-rs-client
  
  
  org.apache.cxf
  cxf-rt-rs-sse
  
  
  org.apache.cxf
      cxf-rt-transports-http
  






--
Sergey Beryozkin

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






--
Sergey Beryozkin

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


Re: Does SSE + CDI work?

2017-09-18 Thread Sergey Beryozkin

On 18/09/17 11:14, John D. Ament wrote:

I'm assuming you mean
https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/sse_cdi/src/main/java/demo/jaxrs/sse/StatsApplication.java#L39
?
That looks manually registered.

It should not be there,

we need to add a CXF @Provider(type=Feature) to

https://github.com/apache/cxf/blob/master/rt/rs/sse/src/main/java/org/apache/cxf/jaxrs/sse/SseFeature.java



For my #1 its a CDI 2.0 feature.  I think it'll work with this approach
though.

Any thoughts on the instability?
Well, it's a totally new feature. I know Andriy found some issues while 
working on the integration with Atmosphere, my understanding there were 
many timing related test issues, but what is more important is how it 
works once the server is up an running, for a regular application, is 
not stable in your case ?


Sergey


John

On Mon, Sep 18, 2017 at 5:09 AM Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Have a look at the sse cdi demo Andriy added to the distribution,
the feature (the one dealing with SSE) is expected to be auto-registered.

Re the transport id, by default CXF assumes it is 'plain' HTTP, so it
needs a hint.

What did you mean with 1) ?

Sergey

On 18/09/17 00:57, John D. Ament wrote:

Ok, i was able to work a bit deeper into this.

1. the integration works, but firing async events doesn't work.  I'm not
sure it should, since you're just appending to the request; but I want to
play with async requests a bit.

2. The integration seems flakey I'm afraid.  I'll run a test, almost

always

it passes, but then every off test run will cause SSE to not get
activated.  I have no reproducer for this.

When it does fail, all I get on the log is

Sep 17, 2017 7:50:33 PM

org.apache.cxf.transport.servlet.ServletController

invoke
WARNING: Can't find the request for http://my-hostname:4403/rest's

Observer


However, I see none of the atmosphere bootstrap occurring when this
happens.  Here's full logs for both failure and success:
https://paste.apache.org/rWwj

3. I had to manually install the feature.  Does CXF have any notion of
automatically registering features?

4. I also had to customize the transport id.  It would be good if this

was

automatic.

John

On Sun, Sep 17, 2017 at 4:21 PM John D. Ament <johndam...@apache.org>

wrote:



I'm trying to create a very basic example of using SSE + CDI events.  To
do that, I created a basic endpoint based on a CXF systest that I found,
but tried to adapt it to work with CDI.

@Path("/sse")
@RequestScoped
public class SseEventEndpoint {
  @Inject
  private Event event;
  @Context
  private Sse sse;
  @GET
  @Path("{connectionId}")
  @Produces(MediaType.SERVER_SENT_EVENTS)
  public void onEvent(@Context SseEventSink sink,
@PathParam("connectionId") final String id) {
  System.out.println("Received request "+sse);
  event.fireAsync(new SseEvent(sink, sse, id));
  }
}

However, no matter what I do, the Sse object is null.  Is there

something

I need to do to enable Sse integration?  This is what my dependencies

look

like

  
  org.apache.cxf
  cxf-integration-cdi
  
  
  org.apache.cxf
  cxf-rt-rs-client
  
  
  org.apache.cxf
  cxf-rt-rs-sse
  
  
  org.apache.cxf
      cxf-rt-transports-http
  






--
Sergey Beryozkin

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





Re: CDI & Class Metadata Parsing

2017-09-18 Thread Sergey Beryozkin
For it to be part of the CXF CDI module ? Sure, if it can help to 
improve it then yes, I'm not sure if activating it by default will work 
for Romain, but please create PR and let Andriy and Romain comment


Thanks, Sergey


On 18/09/17 11:08, John D. Ament wrote:

Would you be in favor of having one checked in and used by default if
you're using CDI integration?

On Mon, Sep 18, 2017 at 4:41 AM Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


My understanding ClassUnwrapper callback was added to support these
scenarios, Romain may've used it.

Sergey
On 17/09/17 23:27, John D. Ament wrote:

On Sun, Sep 17, 2017 at 5:09 PM Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Hi
On 17/09/17 15:37, John D. Ament wrote:

Hey

So I just ran into an issue where ExceptionMappers weren't being

processed

in CXF when they had a CDI normal scope.  Switching to a pseudo scope
(@Dependent) fixes it.  A similar issue to what I saw recently with

Weld

and Generic Type being lost, except this was happening for both OWB and
Weld.

While I was able to dig into the prior issue with generic type

arguments,

that was a Weld specific issue.  I couldn't figure out why CXF wasn't
reading the metadata of the actual bean class.  I'm wondering if for

CDI

use cases, if it makes sense for CXF to look at the actual class's
metadata, separate from the CDI instance that's being passed in (which

is

just a proxy).


I think this is what is done for ex in the Spring case, is it not the
case in the CXF CDI flow ? When JAXRSServerFactoryBean.createFromBeans,
etc, is called then ClassResourceInfo would be initialized with the
'resource' class which may be the proxy, and the 'service' class which
is the actual class.
ClassHelper is used to find the actual 'service' class.
May be CXF CDI needs to use ClassHelper ?



Ok, so that answers a lot of questions (and I have a prototype fix!).

So,

yes, CDI does in fact use ClassHelper to get the class in use.  However,

it

doesn't work for CDI.  The methods in ClassHelper are based on Proxy,

which

OWB and Weld do not use.  LIkewise, the SpringAopClassHelper is based on
Spring specific proxies.

Funny thing is, I think my first question on this list was about
SpringAopClassHelper.  I like how this has come full circle.

So now the prototype.  Weld and OWB use a classname suffix to indicate
their proxies.  Using that suffix, I can unwrap the parent class and get
things to work properly.

Now the question is - should this be in the core ClassHelper, or should I
use ClassUnwrapper which is mentioned in the getRealClass(Bus,Object)
method?  I see that there's no implementations of ClassUnwrapper on the
classpath, so maybe its a dead code path?

I will caution you - I suspect that changing this may cause some existing
apps using CXF + CDI to behave a little differently, but I suspect I may

be

the first one to run into these.




Sergey


John









--
Sergey Beryozkin

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





Re: Does SSE + CDI work?

2017-09-18 Thread Sergey Beryozkin

Have a look at the sse cdi demo Andriy added to the distribution,
the feature (the one dealing with SSE) is expected to be auto-registered.

Re the transport id, by default CXF assumes it is 'plain' HTTP, so it 
needs a hint.


What did you mean with 1) ?

Sergey

On 18/09/17 00:57, John D. Ament wrote:

Ok, i was able to work a bit deeper into this.

1. the integration works, but firing async events doesn't work.  I'm not
sure it should, since you're just appending to the request; but I want to
play with async requests a bit.

2. The integration seems flakey I'm afraid.  I'll run a test, almost always
it passes, but then every off test run will cause SSE to not get
activated.  I have no reproducer for this.

When it does fail, all I get on the log is

Sep 17, 2017 7:50:33 PM org.apache.cxf.transport.servlet.ServletController
invoke
WARNING: Can't find the request for http://my-hostname:4403/rest's Observer

However, I see none of the atmosphere bootstrap occurring when this
happens.  Here's full logs for both failure and success:
https://paste.apache.org/rWwj

3. I had to manually install the feature.  Does CXF have any notion of
automatically registering features?

4. I also had to customize the transport id.  It would be good if this was
automatic.

John

On Sun, Sep 17, 2017 at 4:21 PM John D. Ament <johndam...@apache.org> wrote:


I'm trying to create a very basic example of using SSE + CDI events.  To
do that, I created a basic endpoint based on a CXF systest that I found,
but tried to adapt it to work with CDI.

@Path("/sse")
@RequestScoped
public class SseEventEndpoint {
 @Inject
 private Event event;
 @Context
 private Sse sse;
 @GET
 @Path("{connectionId}")
 @Produces(MediaType.SERVER_SENT_EVENTS)
 public void onEvent(@Context SseEventSink sink,
@PathParam("connectionId") final String id) {
 System.out.println("Received request "+sse);
 event.fireAsync(new SseEvent(sink, sse, id));
 }
}

However, no matter what I do, the Sse object is null.  Is there something
I need to do to enable Sse integration?  This is what my dependencies look
like

 
 org.apache.cxf
 cxf-integration-cdi
 
 
 org.apache.cxf
 cxf-rt-rs-client
 
 
 org.apache.cxf
 cxf-rt-rs-sse
 
 
 org.apache.cxf
 cxf-rt-transports-http
 






--
Sergey Beryozkin

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


Re: CDI & Class Metadata Parsing

2017-09-18 Thread Sergey Beryozkin
My understanding ClassUnwrapper callback was added to support these 
scenarios, Romain may've used it.


Sergey
On 17/09/17 23:27, John D. Ament wrote:

On Sun, Sep 17, 2017 at 5:09 PM Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Hi
On 17/09/17 15:37, John D. Ament wrote:

Hey

So I just ran into an issue where ExceptionMappers weren't being

processed

in CXF when they had a CDI normal scope.  Switching to a pseudo scope
(@Dependent) fixes it.  A similar issue to what I saw recently with Weld
and Generic Type being lost, except this was happening for both OWB and
Weld.

While I was able to dig into the prior issue with generic type arguments,
that was a Weld specific issue.  I couldn't figure out why CXF wasn't
reading the metadata of the actual bean class.  I'm wondering if for CDI
use cases, if it makes sense for CXF to look at the actual class's
metadata, separate from the CDI instance that's being passed in (which is
just a proxy).


I think this is what is done for ex in the Spring case, is it not the
case in the CXF CDI flow ? When JAXRSServerFactoryBean.createFromBeans,
etc, is called then ClassResourceInfo would be initialized with the
'resource' class which may be the proxy, and the 'service' class which
is the actual class.
ClassHelper is used to find the actual 'service' class.
May be CXF CDI needs to use ClassHelper ?



Ok, so that answers a lot of questions (and I have a prototype fix!).  So,
yes, CDI does in fact use ClassHelper to get the class in use.  However, it
doesn't work for CDI.  The methods in ClassHelper are based on Proxy, which
OWB and Weld do not use.  LIkewise, the SpringAopClassHelper is based on
Spring specific proxies.

Funny thing is, I think my first question on this list was about
SpringAopClassHelper.  I like how this has come full circle.

So now the prototype.  Weld and OWB use a classname suffix to indicate
their proxies.  Using that suffix, I can unwrap the parent class and get
things to work properly.

Now the question is - should this be in the core ClassHelper, or should I
use ClassUnwrapper which is mentioned in the getRealClass(Bus,Object)
method?  I see that there's no implementations of ClassUnwrapper on the
classpath, so maybe its a dead code path?

I will caution you - I suspect that changing this may cause some existing
apps using CXF + CDI to behave a little differently, but I suspect I may be
the first one to run into these.




Sergey


John









--
Sergey Beryozkin

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


Re: CDI & Class Metadata Parsing

2017-09-17 Thread Sergey Beryozkin

Hi
On 17/09/17 15:37, John D. Ament wrote:

Hey

So I just ran into an issue where ExceptionMappers weren't being processed
in CXF when they had a CDI normal scope.  Switching to a pseudo scope
(@Dependent) fixes it.  A similar issue to what I saw recently with Weld
and Generic Type being lost, except this was happening for both OWB and
Weld.

While I was able to dig into the prior issue with generic type arguments,
that was a Weld specific issue.  I couldn't figure out why CXF wasn't
reading the metadata of the actual bean class.  I'm wondering if for CDI
use cases, if it makes sense for CXF to look at the actual class's
metadata, separate from the CDI instance that's being passed in (which is
just a proxy).

I think this is what is done for ex in the Spring case, is it not the 
case in the CXF CDI flow ? When JAXRSServerFactoryBean.createFromBeans, 
etc, is called then ClassResourceInfo would be initialized with the 
'resource' class which may be the proxy, and the 'service' class which 
is the actual class.

ClassHelper is used to find the actual 'service' class.
May be CXF CDI needs to use ClassHelper ?

Sergey


John





Re: providing basic auth via wadl2java?

2017-09-14 Thread Sergey Beryozkin

Thanks, should we rename 'authorization' to 'authentication' ?

First I named it 'nameAndPassword', then thought, well, too specific, 
renamed it to 'authorization' (prob because of Http Authorization 
header). May be we will leave it as is...


Sergey
On 14/09/17 18:52, Shan Syed wrote:

yes, it's communicating fine and processing the remote WADL :)

thanks!

On Thu, Sep 14, 2017 at 12:07 PM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Can you please try 3.1.14-SNAPSHOT now ?

Sergey

On 13/09/17 18:34, Shan Syed wrote:


ok, thanks, looking forward to it!

On Wednesday, September 13, 2017, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:

For some reasons I thought it was about retrieving the internal references

only, so more work is needed then in 3.1.14-SNAPSHOT

On 13/09/17 16:19, Shan Syed wrote:

So I just got the 3.1.14-SNAPSHOT working (sorry, was a silly issue), and

still getting 401 from it.


On Wed, Sep 13, 2017 at 11:12 AM, Shan Syed <shan...@gmail.com> wrote:

So outside of my snapshot issues, I updated my local jaxrs-toolspec.xml,


locally here:
.m2\repository\org\apache\cxf\cxf-tools-wadlto-jaxrs\3.1.13

I updated the option section for authorization, so all the items match

   
   
   Specifies a colon separated user name and
password
for
retrieving the
   remote WADL content from the servers requiring
Basic
authentication
   
   
   authorization
   
   authorization
   
In my POM:



https://whatever/api/somemodel?_wadl
true
com.whatever

-authorization
apiuser:apiuser




I'm still getting a 401

java.io.IOException: Server returned HTTP response code: 401 for URL:
https://... snip -> [Help 1]



On Wed, Sep 13, 2017 at 10:25 AM, Shan Syed <shan...@gmail.com> wrote:

Unfortunately, I can't seem to build off of the snapshots; I have this
in


my POM:



apache-snapshot-repo
http://repository.apache.org/snapshots

true




..SNIP..

org.apache.cxf
cxf-wadl2java-plugin
3.1.14-SNAPSHOT

..SNIP..

Getting this error:

"[ERROR] Plugin org.apache.cxf:cxf-wadl2java-plugin:3.1.14-SNAPSHOT
or
one of its dependencies could not be resolved: Could not find artifact
org.apache.cxf:cxf-wadl2java-plugin:jar
:3.1.14-SNAPSHOT -> [Help 1]"

Any ideas? I looked around in the repo, nothing seems off at a first
glance, I can't see why it's not being found.



On Tue, Sep 12, 2017 at 6:09 AM, Sergey Beryozkin <
sberyoz...@gmail.com



wrote:


I've deployed a cxf-tools-wadlto-jaxrs/3.1.14-SNAPSHOT with the fix,


can you try it ?
If it works then may be you can just update the jaxrs-toolspec.xml in
the 3.1.13 version in the .m2 repository and use till 3.1.14 is out

Sergey

On 11/09/17 22:17, Sergey Beryozkin wrote:

Yes, I did it few days before the release,



https://github.com/apache/cxf/blob/cxf-3.2.0/tools/wadlto/ja
xrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-to
olspec.xml#L262

I changed the 'id', but did not changed the switch...That's why it's
always useful to test the snapshot...

The fix will be avail in 3.1.14/3.2.1

Sergey
On 11/09/17 22:12, Shan Syed wrote:

Also, I just managed to grab the 3.2.0 release (congrats!)



I noticed that wadl2java has this option now: -namePassword

though in your commits, it looks like this was later renamed to
"authorization"

I tried both via the bat file, and "authorization" is an unknown
option

there are no complaints when I supply the namePassword though, like
this:
\apache-cxf-3.2.0\bin>wadl2java -namePassword apiuser:apiuser
https://whatever:8000/api/rest/somemodel?_wadl

I still get:  Server returned HTTP response code: 401

Looks like the auth pair didn't seem to affect the connection?




On Mon, Sep 11, 2017 at 3:39 PM, Shan Syed <shan...@gmail.com>
wrote:

Hi, I I tried this on 3.0.15 just now, and it doesn't seem like the

"authorization" is available as an option for me. In my POM:



https://whatever8000/api/rest/somemodel?_wadl
true
apiuser:apiuser
com.whatever


"Cannot find 'authorization' in class
org.apache.cxf.maven_plugin.wa
dlto.WadlOption"

Does the option go somewhere else? Thanks!





On Fri, Sep 8, 2017 at 12:23 PM, Shan Syed <shan...@gmail.com>
wrote:

Great, I will try it when it's available!



On Wed, Sep 6, 2017 at 11:39 AM, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

Np. hope that code I added will work from the 1st attempt :-), I
did

not

want to introduce a strong dep on the CXF JAX-RS client code, so
resorted
to writing some HttpUrlConnection code which is tricky to do
right...

Cheers, Sergey

On 06/09/17 16:32, Shan Syed wrote:

amazing, thank you



On Friday, September 1, 2017, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

I've created this issue:


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


but will likely have no t

Re: providing basic auth via wadl2java?

2017-09-14 Thread Sergey Beryozkin

Can you please try 3.1.14-SNAPSHOT now ?

Sergey
On 13/09/17 18:34, Shan Syed wrote:

ok, thanks, looking forward to it!

On Wednesday, September 13, 2017, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


For some reasons I thought it was about retrieving the internal references
only, so more work is needed then in 3.1.14-SNAPSHOT

On 13/09/17 16:19, Shan Syed wrote:


So I just got the 3.1.14-SNAPSHOT working (sorry, was a silly issue), and
still getting 401 from it.


On Wed, Sep 13, 2017 at 11:12 AM, Shan Syed <shan...@gmail.com> wrote:

So outside of my snapshot issues, I updated my local jaxrs-toolspec.xml,

locally here:
.m2\repository\org\apache\cxf\cxf-tools-wadlto-jaxrs\3.1.13

I updated the option section for authorization, so all the items match

  
  
  Specifies a colon separated user name and password
for
retrieving the
  remote WADL content from the servers requiring Basic
authentication
  
  
  authorization
  
  authorization
  
In my POM:



https://whatever/api/somemodel?_wadl
true
com.whatever

-authorization
apiuser:apiuser




I'm still getting a 401

java.io.IOException: Server returned HTTP response code: 401 for URL:
https://... snip -> [Help 1]



On Wed, Sep 13, 2017 at 10:25 AM, Shan Syed <shan...@gmail.com> wrote:

Unfortunately, I can't seem to build off of the snapshots; I have this in

my POM:



apache-snapshot-repo
http://repository.apache.org/snapshots

true




..SNIP..

org.apache.cxf
cxf-wadl2java-plugin
3.1.14-SNAPSHOT

..SNIP..

Getting this error:

"[ERROR] Plugin org.apache.cxf:cxf-wadl2java-plugin:3.1.14-SNAPSHOT or
one of its dependencies could not be resolved: Could not find artifact
org.apache.cxf:cxf-wadl2java-plugin:jar
:3.1.14-SNAPSHOT -> [Help 1]"

Any ideas? I looked around in the repo, nothing seems off at a first
glance, I can't see why it's not being found.



On Tue, Sep 12, 2017 at 6:09 AM, Sergey Beryozkin <sberyoz...@gmail.com



wrote:

I've deployed a cxf-tools-wadlto-jaxrs/3.1.14-SNAPSHOT with the fix,

can you try it ?
If it works then may be you can just update the jaxrs-toolspec.xml in
the 3.1.13 version in the .m2 repository and use till 3.1.14 is out

Sergey

On 11/09/17 22:17, Sergey Beryozkin wrote:

Yes, I did it few days before the release,


https://github.com/apache/cxf/blob/cxf-3.2.0/tools/wadlto/ja
xrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-to
olspec.xml#L262

I changed the 'id', but did not changed the switch...That's why it's
always useful to test the snapshot...

The fix will be avail in 3.1.14/3.2.1

Sergey
On 11/09/17 22:12, Shan Syed wrote:

Also, I just managed to grab the 3.2.0 release (congrats!)


I noticed that wadl2java has this option now: -namePassword

though in your commits, it looks like this was later renamed to
"authorization"

I tried both via the bat file, and "authorization" is an unknown
option

there are no complaints when I supply the namePassword though, like
this:
\apache-cxf-3.2.0\bin>wadl2java -namePassword apiuser:apiuser
https://whatever:8000/api/rest/somemodel?_wadl

I still get:  Server returned HTTP response code: 401

Looks like the auth pair didn't seem to affect the connection?




On Mon, Sep 11, 2017 at 3:39 PM, Shan Syed <shan...@gmail.com>
wrote:

Hi, I I tried this on 3.0.15 just now, and it doesn't seem like the


"authorization" is available as an option for me. In my POM:


https://whatever8000/api/rest/somemodel?_wadl
true
apiuser:apiuser
com.whatever


"Cannot find 'authorization' in class org.apache.cxf.maven_plugin.wa
dlto.WadlOption"

Does the option go somewhere else? Thanks!





On Fri, Sep 8, 2017 at 12:23 PM, Shan Syed <shan...@gmail.com>
wrote:

Great, I will try it when it's available!



On Wed, Sep 6, 2017 at 11:39 AM, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

Np. hope that code I added will work from the 1st attempt :-), I
did


not
want to introduce a strong dep on the CXF JAX-RS client code, so
resorted
to writing some HttpUrlConnection code which is tricky to do
right...

Cheers, Sergey

On 06/09/17 16:32, Shan Syed wrote:

amazing, thank you



On Friday, September 1, 2017, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

I've created this issue:



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

but will likely have no time to complete it early next week,

but at least it will be tracked

Cheers, Sergey
On 25/08/17 15:14, Sergey Beryozkin wrote:

I see, makes sense to add a new switch



Sergey
On 25/08/17 14:52, Shan Syed wrote:

I don't have explicit access to the header via the command line

wadl2java,

nor the maven plugin



On Fri, Aug 25, 2017 at 6:24 AM, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

Hi


Why can't they be sent as the header ? Otherwise I guess on

Re: providing basic auth via wadl2java?

2017-09-13 Thread Sergey Beryozkin
For some reasons I thought it was about retrieving the internal 
references only, so more work is needed then in 3.1.14-SNAPSHOT


On 13/09/17 16:19, Shan Syed wrote:

So I just got the 3.1.14-SNAPSHOT working (sorry, was a silly issue), and
still getting 401 from it.


On Wed, Sep 13, 2017 at 11:12 AM, Shan Syed <shan...@gmail.com> wrote:


So outside of my snapshot issues, I updated my local jaxrs-toolspec.xml,
locally here:
.m2\repository\org\apache\cxf\cxf-tools-wadlto-jaxrs\3.1.13

I updated the option section for authorization, so all the items match

 
 
 Specifies a colon separated user name and password for
retrieving the
 remote WADL content from the servers requiring Basic
authentication
 
 
 authorization
 
 authorization
 
In my POM:



https://whatever/api/somemodel?_wadl
true
com.whatever

-authorization
apiuser:apiuser




I'm still getting a 401

java.io.IOException: Server returned HTTP response code: 401 for URL:
https://... snip -> [Help 1]



On Wed, Sep 13, 2017 at 10:25 AM, Shan Syed <shan...@gmail.com> wrote:


Unfortunately, I can't seem to build off of the snapshots; I have this in
my POM:



apache-snapshot-repo
http://repository.apache.org/snapshots

true




..SNIP..

org.apache.cxf
cxf-wadl2java-plugin
3.1.14-SNAPSHOT

..SNIP..

Getting this error:

"[ERROR] Plugin org.apache.cxf:cxf-wadl2java-plugin:3.1.14-SNAPSHOT or
one of its dependencies could not be resolved: Could not find artifact
org.apache.cxf:cxf-wadl2java-plugin:jar
:3.1.14-SNAPSHOT -> [Help 1]"

Any ideas? I looked around in the repo, nothing seems off at a first
glance, I can't see why it's not being found.



On Tue, Sep 12, 2017 at 6:09 AM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


I've deployed a cxf-tools-wadlto-jaxrs/3.1.14-SNAPSHOT with the fix,
can you try it ?
If it works then may be you can just update the jaxrs-toolspec.xml in
the 3.1.13 version in the .m2 repository and use till 3.1.14 is out

Sergey

On 11/09/17 22:17, Sergey Beryozkin wrote:


Yes, I did it few days before the release,

https://github.com/apache/cxf/blob/cxf-3.2.0/tools/wadlto/ja
xrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-to
olspec.xml#L262

I changed the 'id', but did not changed the switch...That's why it's
always useful to test the snapshot...

The fix will be avail in 3.1.14/3.2.1

Sergey
On 11/09/17 22:12, Shan Syed wrote:


Also, I just managed to grab the 3.2.0 release (congrats!)

I noticed that wadl2java has this option now: -namePassword

though in your commits, it looks like this was later renamed to
"authorization"

I tried both via the bat file, and "authorization" is an unknown option

there are no complaints when I supply the namePassword though, like
this:
\apache-cxf-3.2.0\bin>wadl2java -namePassword apiuser:apiuser
https://whatever:8000/api/rest/somemodel?_wadl

I still get:  Server returned HTTP response code: 401

Looks like the auth pair didn't seem to affect the connection?




On Mon, Sep 11, 2017 at 3:39 PM, Shan Syed <shan...@gmail.com> wrote:

Hi, I I tried this on 3.0.15 just now, and it doesn't seem like the

"authorization" is available as an option for me. In my POM:


https://whatever8000/api/rest/somemodel?_wadl
true
apiuser:apiuser
com.whatever


"Cannot find 'authorization' in class org.apache.cxf.maven_plugin.wa
dlto.WadlOption"

Does the option go somewhere else? Thanks!





On Fri, Sep 8, 2017 at 12:23 PM, Shan Syed <shan...@gmail.com> wrote:

Great, I will try it when it's available!


On Wed, Sep 6, 2017 at 11:39 AM, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

Np. hope that code I added will work from the 1st attempt :-), I did

not
want to introduce a strong dep on the CXF JAX-RS client code, so
resorted
to writing some HttpUrlConnection code which is tricky to do
right...

Cheers, Sergey

On 06/09/17 16:32, Shan Syed wrote:

amazing, thank you


On Friday, September 1, 2017, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

I've created this issue:



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

but will likely have no time to complete it early next week,

but at least it will be tracked

Cheers, Sergey
On 25/08/17 15:14, Sergey Beryozkin wrote:

I see, makes sense to add a new switch



Sergey
On 25/08/17 14:52, Shan Syed wrote:

I don't have explicit access to the header via the command line


wadl2java,
nor the maven plugin



On Fri, Aug 25, 2017 at 6:24 AM, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

Hi



Why can't they be sent as the header ? Otherwise I guess one
needs
to
configure the HTTP container somehow for the name and password
be
extracted
out of URI and matched against the BasicAuth module...

Sergey

On 25/08/17 01:10, Shan Syed wrote:

Hey there,



I need to 

Re: providing basic auth via wadl2java?

2017-09-12 Thread Sergey Beryozkin
I've deployed a cxf-tools-wadlto-jaxrs/3.1.14-SNAPSHOT with the fix, can 
you try it ?
If it works then may be you can just update the jaxrs-toolspec.xml in 
the 3.1.13 version in the .m2 repository and use till 3.1.14 is out


Sergey
On 11/09/17 22:17, Sergey Beryozkin wrote:

Yes, I did it few days before the release,

https://github.com/apache/cxf/blob/cxf-3.2.0/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml#L262 



I changed the 'id', but did not changed the switch...That's why it's 
always useful to test the snapshot...


The fix will be avail in 3.1.14/3.2.1

Sergey
On 11/09/17 22:12, Shan Syed wrote:

Also, I just managed to grab the 3.2.0 release (congrats!)

I noticed that wadl2java has this option now: -namePassword 


though in your commits, it looks like this was later renamed to
"authorization"

I tried both via the bat file, and "authorization" is an unknown option

there are no complaints when I supply the namePassword though, like this:
\apache-cxf-3.2.0\bin>wadl2java -namePassword apiuser:apiuser
https://whatever:8000/api/rest/somemodel?_wadl

I still get:  Server returned HTTP response code: 401

Looks like the auth pair didn't seem to affect the connection?




On Mon, Sep 11, 2017 at 3:39 PM, Shan Syed <shan...@gmail.com> wrote:


Hi, I I tried this on 3.0.15 just now, and it doesn't seem like the
"authorization" is available as an option for me. In my POM:


https://whatever8000/api/rest/somemodel?_wadl
true
apiuser:apiuser
com.whatever


"Cannot find 'authorization' in class org.apache.cxf.maven_plugin.wa
dlto.WadlOption"

Does the option go somewhere else? Thanks!





On Fri, Sep 8, 2017 at 12:23 PM, Shan Syed <shan...@gmail.com> wrote:


Great, I will try it when it's available!

On Wed, Sep 6, 2017 at 11:39 AM, Sergey Beryozkin 
<sberyoz...@gmail.com>

wrote:

Np. hope that code I added will work from the 1st attempt :-), I 
did not
want to introduce a strong dep on the CXF JAX-RS client code, so 
resorted

to writing some HttpUrlConnection code which is tricky to do right...

Cheers, Sergey

On 06/09/17 16:32, Shan Syed wrote:


amazing, thank you

On Friday, September 1, 2017, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:

I've created this issue:


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

but will likely have no time to complete it early next week,

but at least it will be tracked

Cheers, Sergey
On 25/08/17 15:14, Sergey Beryozkin wrote:

I see, makes sense to add a new switch


Sergey
On 25/08/17 14:52, Shan Syed wrote:

I don't have explicit access to the header via the command line

wadl2java,
nor the maven plugin



On Fri, Aug 25, 2017 at 6:24 AM, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

Hi



Why can't they be sent as the header ? Otherwise I guess one 
needs

to
configure the HTTP container somehow for the name and password be
extracted
out of URI and matched against the BasicAuth module...

Sergey

On 25/08/17 01:10, Shan Syed wrote:

Hey there,



I need to generate client code for a WADL, hosted on a remote
server I
don't control.
The WADL has very deep includes, that reference other xml files
hosted
on
the same server.
Downloading them all isn't practical, because it's a very deep
hierarchy.

The WADL is also served off of a webserver that asserts basic 
auth.


I'm trying both the cxf wadl2java download, and the maven 
plugin;

neither
seem to work when I provide basic auth details like this:

https://whateverusernamer:somepassw...@whatever.com?wadl

A 401 error is returned, and the basic auth parameters aren't 
sent

to
the
server this way.

Is there a way to specify user/password for basic auth on a 
remote

WADL?

Thanks







--
Sergey Beryozkin

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












Re: providing basic auth via wadl2java?

2017-09-11 Thread Sergey Beryozkin

Yes, I did it few days before the release,

https://github.com/apache/cxf/blob/cxf-3.2.0/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/jaxrs-toolspec.xml#L262

I changed the 'id', but did not changed the switch...That's why it's 
always useful to test the snapshot...


The fix will be avail in 3.1.14/3.2.1

Sergey
On 11/09/17 22:12, Shan Syed wrote:

Also, I just managed to grab the 3.2.0 release (congrats!)

I noticed that wadl2java has this option now: -namePassword 
though in your commits, it looks like this was later renamed to
"authorization"

I tried both via the bat file, and "authorization" is an unknown option

there are no complaints when I supply the namePassword though, like this:
\apache-cxf-3.2.0\bin>wadl2java -namePassword apiuser:apiuser
https://whatever:8000/api/rest/somemodel?_wadl

I still get:  Server returned HTTP response code: 401

Looks like the auth pair didn't seem to affect the connection?




On Mon, Sep 11, 2017 at 3:39 PM, Shan Syed <shan...@gmail.com> wrote:


Hi, I I tried this on 3.0.15 just now, and it doesn't seem like the
"authorization" is available as an option for me. In my POM:


https://whatever8000/api/rest/somemodel?_wadl
true
apiuser:apiuser
com.whatever


"Cannot find 'authorization' in class org.apache.cxf.maven_plugin.wa
dlto.WadlOption"

Does the option go somewhere else? Thanks!





On Fri, Sep 8, 2017 at 12:23 PM, Shan Syed <shan...@gmail.com> wrote:


Great, I will try it when it's available!

On Wed, Sep 6, 2017 at 11:39 AM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Np. hope that code I added will work from the 1st attempt :-), I did not
want to introduce a strong dep on the CXF JAX-RS client code, so resorted
to writing some HttpUrlConnection code which is tricky to do right...

Cheers, Sergey

On 06/09/17 16:32, Shan Syed wrote:


amazing, thank you

On Friday, September 1, 2017, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:

I've created this issue:


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

but will likely have no time to complete it early next week,

but at least it will be tracked

Cheers, Sergey
On 25/08/17 15:14, Sergey Beryozkin wrote:

I see, makes sense to add a new switch


Sergey
On 25/08/17 14:52, Shan Syed wrote:

I don't have explicit access to the header via the command line

wadl2java,
nor the maven plugin



On Fri, Aug 25, 2017 at 6:24 AM, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

Hi



Why can't they be sent as the header ? Otherwise I guess one needs
to
configure the HTTP container somehow for the name and password be
extracted
out of URI and matched against the BasicAuth module...

Sergey

On 25/08/17 01:10, Shan Syed wrote:

Hey there,



I need to generate client code for a WADL, hosted on a remote
server I
don't control.
The WADL has very deep includes, that reference other xml files
hosted
on
the same server.
Downloading them all isn't practical, because it's a very deep
hierarchy.

The WADL is also served off of a webserver that asserts basic auth.

I'm trying both the cxf wadl2java download, and the maven plugin;
neither
seem to work when I provide basic auth details like this:

https://whateverusernamer:somepassw...@whatever.com?wadl

A 401 error is returned, and the basic auth parameters aren't sent
to
the
server this way.

Is there a way to specify user/password for basic auth on a remote
WADL?

Thanks







--
Sergey Beryozkin

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












Re: providing basic auth via wadl2java?

2017-09-11 Thread Sergey Beryozkin
It's not available as a typed Maven plugin option yet, I think you need 
to use the extra args option to provide it...


Sergey
On 11/09/17 20:39, Shan Syed wrote:

Hi, I I tried this on 3.0.15 just now, and it doesn't seem like the
"authorization" is available as an option for me. In my POM:


https://whatever8000/api/rest/somemodel?_wadl
true
apiuser:apiuser
com.whatever


"Cannot find 'authorization' in class org.apache.cxf.maven_plugin.
wadlto.WadlOption"

Does the option go somewhere else? Thanks!





On Fri, Sep 8, 2017 at 12:23 PM, Shan Syed <shan...@gmail.com> wrote:


Great, I will try it when it's available!

On Wed, Sep 6, 2017 at 11:39 AM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Np. hope that code I added will work from the 1st attempt :-), I did not
want to introduce a strong dep on the CXF JAX-RS client code, so resorted
to writing some HttpUrlConnection code which is tricky to do right...

Cheers, Sergey

On 06/09/17 16:32, Shan Syed wrote:


amazing, thank you

On Friday, September 1, 2017, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:

I've created this issue:


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

but will likely have no time to complete it early next week,

but at least it will be tracked

Cheers, Sergey
On 25/08/17 15:14, Sergey Beryozkin wrote:

I see, makes sense to add a new switch


Sergey
On 25/08/17 14:52, Shan Syed wrote:

I don't have explicit access to the header via the command line

wadl2java,
nor the maven plugin



On Fri, Aug 25, 2017 at 6:24 AM, Sergey Beryozkin <
sberyoz...@gmail.com>
wrote:

Hi



Why can't they be sent as the header ? Otherwise I guess one needs to
configure the HTTP container somehow for the name and password be
extracted
out of URI and matched against the BasicAuth module...

Sergey

On 25/08/17 01:10, Shan Syed wrote:

Hey there,



I need to generate client code for a WADL, hosted on a remote
server I
don't control.
The WADL has very deep includes, that reference other xml files
hosted
on
the same server.
Downloading them all isn't practical, because it's a very deep
hierarchy.

The WADL is also served off of a webserver that asserts basic auth.

I'm trying both the cxf wadl2java download, and the maven plugin;
neither
seem to work when I provide basic auth details like this:

https://whateverusernamer:somepassw...@whatever.com?wadl

A 401 error is returned, and the basic auth parameters aren't sent
to
the
server this way.

Is there a way to specify user/password for basic auth on a remote
WADL?

Thanks







--
Sergey Beryozkin

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










Re: ResponseBuilder interfering with true return type : Impacts Swagger

2017-09-11 Thread Sergey Beryozkin

For some reason I'm finding these messages in the spam folder...

Sorry. I don't  understand what you mean below.
If you prefer to return JAX-RS Response then there must be a way to tell 
Swagger what the entity type is and this is why Swagger annotations have 
to be used in such cases.


Sergey
On 07/09/17 05:13, arjun dhar wrote:

Hmmm thats what I feared, but thank you.

Out of technical curiosity. There is something pristine about method
signature, and should not CXF allow to preserve that sugar and provide its
annotation(s) to allow the response be wrapped in a ResponseBuilder for the
other classes down the layer to implemented.

For example Spring does this beautifully using `@Cache` etc. To alter a
signature based on trivial things like cache or no cache seems a bit ugly to
me. Not a big deal .. but just trying to understand.

If this is discussed, would love if I can be pointed to any discussion
existing around it.

thank you for your response.



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html



Re: [CXF 2.7.16] UriInfo.getAbsolutePathBuilder()

2017-09-07 Thread Sergey Beryozkin

Hi Anthony

Good to hear from you,

There's only one way to find out, try for ex CXF 3.1.12
2.7.16 might have some buggy code in determining the host name if it is 
not currently available...


Cheers, Sergey

On 07/09/17 12:03, MULLER, Anthony wrote:

Hello,

We are facing a very weird issue: in some cases (unidentified for now), 
getAbsolutePathBuilder() generates an URL with “null” for hostname.


Like: http://null/path/...

Is it a known issue? Has it been fixed into more recent releases?

Thank you and best regards,

Anthony



Re: providing basic auth via wadl2java?

2017-09-06 Thread Sergey Beryozkin
Np. hope that code I added will work from the 1st attempt :-), I did not 
want to introduce a strong dep on the CXF JAX-RS client code, so 
resorted to writing some HttpUrlConnection code which is tricky to do 
right...


Cheers, Sergey
On 06/09/17 16:32, Shan Syed wrote:

amazing, thank you

On Friday, September 1, 2017, Sergey Beryozkin <sberyoz...@gmail.com> wrote:


I've created this issue:

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

but will likely have no time to complete it early next week,

but at least it will be tracked

Cheers, Sergey
On 25/08/17 15:14, Sergey Beryozkin wrote:


I see, makes sense to add a new switch

Sergey
On 25/08/17 14:52, Shan Syed wrote:


I don't have explicit access to the header via the command line
wadl2java,
nor the maven plugin



On Fri, Aug 25, 2017 at 6:24 AM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:

Hi


Why can't they be sent as the header ? Otherwise I guess one needs to
configure the HTTP container somehow for the name and password be
extracted
out of URI and matched against the BasicAuth module...

Sergey

On 25/08/17 01:10, Shan Syed wrote:

Hey there,


I need to generate client code for a WADL, hosted on a remote server I
don't control.
The WADL has very deep includes, that reference other xml files hosted
on
the same server.
Downloading them all isn't practical, because it's a very deep
hierarchy.

The WADL is also served off of a webserver that asserts basic auth.

I'm trying both the cxf wadl2java download, and the maven plugin;
neither
seem to work when I provide basic auth details like this:

https://whateverusernamer:somepassw...@whatever.com?wadl

A 401 error is returned, and the basic auth parameters aren't sent to
the
server this way.

Is there a way to specify user/password for basic auth on a remote
WADL?

Thanks







--
Sergey Beryozkin

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





Re: ResponseBuilder interfering with true return type : Impacts Swagger

2017-09-06 Thread Sergey Beryozkin

Hi

In this case I believe you need to use Swagger annotations, see this 
example:


https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/description_swagger2/src/main/java/demo/jaxrs/swagger/server/Sample.java#L61

Sergey

On 06/09/17 06:41, arjun dhar wrote:

Hi,

I am using Swagger for documentation. Tough, that aside I do not wish my
method return type to be a "Response" type; rather the true type so its
legible to document and see.

However I do want Cache control on some end points. All documentation Ive
seen points to be using a ResponseBuilder, as there no
annotation/declarative way of handling this more cleanly?

thanks,
Arjun



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html




--
Sergey Beryozkin

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


Re: providing basic auth via wadl2java?

2017-09-01 Thread Sergey Beryozkin

I've created this issue:

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

but will likely have no time to complete it early next week,

but at least it will be tracked

Cheers, Sergey
On 25/08/17 15:14, Sergey Beryozkin wrote:

I see, makes sense to add a new switch

Sergey
On 25/08/17 14:52, Shan Syed wrote:
I don't have explicit access to the header via the command line 
wadl2java,

nor the maven plugin



On Fri, Aug 25, 2017 at 6:24 AM, Sergey Beryozkin <sberyoz...@gmail.com>
wrote:


Hi

Why can't they be sent as the header ? Otherwise I guess one needs to
configure the HTTP container somehow for the name and password be 
extracted

out of URI and matched against the BasicAuth module...

Sergey

On 25/08/17 01:10, Shan Syed wrote:


Hey there,

I need to generate client code for a WADL, hosted on a remote server I
don't control.
The WADL has very deep includes, that reference other xml files 
hosted on

the same server.
Downloading them all isn't practical, because it's a very deep 
hierarchy.


The WADL is also served off of a webserver that asserts basic auth.

I'm trying both the cxf wadl2java download, and the maven plugin; 
neither

seem to work when I provide basic auth details like this:

https://whateverusernamer:somepassw...@whatever.com?wadl

A 401 error is returned, and the basic auth parameters aren't sent 
to the

server this way.

Is there a way to specify user/password for basic auth on a remote 
WADL?


Thanks







--
Sergey Beryozkin

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


Re: Handling vnd (vendor) content type

2017-09-01 Thread Sergey Beryozkin

Hi

the easiest option is to register an instance of JAXBElementProvider as 
a custom jaxrs:provider, with its 'marshallerProperties' set as needed, 
example, "jaxb.fragment":true.


Or you can set them dynamically from a CXF jaxrs:outInterceptor (sitting 
on the phase earlier than MARSHALL) on the current message, ex, 
outMessage.set("jaxb.fragment", true);


HTH, Sergey
On 31/08/17 18:14, NicholaiX wrote:

Hi Sergey,
I did find one additional issue. Given my prototype:

@POST
@Consumes(Constants.MY_TYPE)
@Produces( Constants.MY_TYPE)
public MyDocument HandleMyPost(String cmds) { return new MyDocument(); //...
}

I see that it is adding an XML prologue to the response. I need to be able

to turn off this prologue, since the vendor implementation of this xml
document is getting confused.

I tried to dump the XML before response:

private final XmlMapper mapper = new XmlMapper();
Response resp =
Response.status(200).entity(response).encoding(Constants.MY_TYPE).build();
LOG.info(mapper.writeValueAsString(resp));

and this doesn't contain the prologue.


What is the proper way to suppress the XML prologue?





--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html




--
Sergey Beryozkin

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


Re: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxrs]

2017-09-01 Thread Sergey Beryozkin

Hi

Thanks for this query. And sorry I don't know what to recommend.
I've definitely seen this issue before, with simple bundles, without any 
inter-dependencies, and the only thing I recall it was always something 
to do with SpringDM not helping for whatever reasons.


One thing I recall that if the bundle is started as a web-bundle, then 
CXFServlet will need to have a SpringDM activated with a servlet context 
parameter.


If it's started with a default CXF transport (deployed as a regular 
bundle) then I guess it can be the ordering issue, etc...I don't have 
any specific recipe for fixing it though...


May be you can start from a single simple bundle first and see if 
jaxrs:server is loaded and then move step by step to match your current 
bundle structure which might help narrow down the problem


Cheers, Sergey

On 31/08/17 14:51, Raffaele Gambelli wrote:

Hi all,

I've asked same question in OSGI mailing-list, but I was bounced here, so I 
hope you may help me.

I'm running on OSGI Equinox environment and when I start Equinox I receive the 
following exception:

Offending resource: class path resource [application-context.xml]; nested 
exception is 
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema 
namespace [http://cxf.apache.org/jaxrs]

My env is composede by:

One web-application, say A, having only one embedded dependency which is 
located in WEB-INF/lib, say B
B is a jar containing a spring configuration file with some bean definitions
All the dependencies of A and B exist as OSGI bundles, cxf-rt-frontend-jaxrs 
exists and it is in resolved status
So, why am I receiving that exception in your opinion?

Thanks, best regards


Raffaele Gambelli




Re: Handling vnd (vendor) content type

2017-08-31 Thread Sergey Beryozkin

On 31/08/17 06:54, NicholaiX wrote:

I need to handle a vendor XML type, e.g. "application/vnd.com.something+xml"
in a REST service.

This is actually a compliant XML document, so I'd like to have CXF treat it
as an XML document during serialization and deserialization. The only
exception would be that I do not want the XML prolog (but IIRC I don't think
it generates that anyway).

I have a service with a POST method defined to Consume and Produce this
type. Question is, how do I tell CXF this is actually just a plain XML, and
to treat it as such, and just change the Content-Type on the response?
Preferably in code (I'd like to stay away from XML).

Currently it seems to be deserializing my document, but it's not serializing
the response back to the client, it is responding with an empty body and the
correct content-type. That's what brought me here. How do I do this the
right way?
Can you type the resource method signature here, return type and input 
types ? If JAX-RS Response is returned, what is the type of the entity ?





And for my general knowledge, how are these vendor types handled, is there
any guessing going on? (e.g. since it's +xml, will CXF assume it's an XML
document during marshaling and unmarshaling?


*+xml payloads are handled by default by CXF JAXBElementProvider


What if it's something totally
different, like "application/vnd.com.my+protobuf")?

If JAX-RS MessageBodyWriter or Reader provider's supported media types 
can be configured (they can be for most of the providers shipped with 
CXF) then you can set custom produces/consumes media types on the given 
provider's instance.


Sergey
















--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html



  1   2   3   4   5   6   7   8   9   10   >