Comments (8)
@bnazare
for point 1 I have already fix it on my current work to move build time config to runtime.
So I have cherry picked the commits to master
for point 2 & 3, I have to analyzed it. Anyway, I prefer to succeed to move build time config to runtime.
cf #61 because it change many many things.
from quarkus-cxf.
hmmm.
About header, I think you can add it by injecting client.
@Inject
MyWebService service;
// and in init function of bean do:
AuthSoapHeader authHeader = new AuthSoapHeader();
authHeader.setStrUserName(username);
authHeader.setStrPassword(password);
Header soapHdr = new Header(AUTH_HEADER_NAME, authHeader, new JAXBDataBinding(AuthSoapHeader.class));
ClientProxy.getClient(service).getRequestContext().put(Header.HEADER_LIST, List.of(soapHdr));
Indeed we have many functions missing in client:
http://cxf.apache.org/docs/jax-ws-configuration.html
setFeatures
setInInterceptors
setInFaultInterceptors
setOutInterceptors
setOutFaultInterceptors
setHandlers
setLoadHandlers
setClientFactoryBean - quarkus one is used so not planned.
setWsdlLocation
setConduitSelector
setTransportId
setServiceFactory
setBus - custom bus. not sure if usefull
setProperties
setDataBinding - jaxbdatabinding is default
setBindingConfig
2 solution:
- implement a system for all
- implement an handler system to customize JaxWsProxyFactoryBean
design idea:
from quarkus-cxf.
-
add in config element with list of class to load by reflection for :
setFeatures
setInInterceptors
setInFaultInterceptors
setOutInterceptors
setOutFaultInterceptors
setHandlers
setLoadHandlers -
add customize handler method that is called inside client producer and add it to config or with a dedicated annotation. => it mean that we enable handlers but no granularity to declare one or remove one... but it add that we give full access to it so it can been fully customized.
-
add a injection point for it in producer classes and use annotation: issue it make it only available at buildtime not runtime...=> wrong idea.
from quarkus-cxf.
@jimbogithub can you test with annotation:
https://cxf.apache.org/docs/interceptors.html
basicly :
@org.apache.cxf.feature.Features (features = {"org.apache.cxf.feature.LoggingFeature"})
@WebService
public class MyWebService
from quarkus-cxf.
I have added config for that.
1 solutions currently:
- annotation
- add config
quarkus.cxf.endpoint."/greeting".features=org.apache.cxf.feature.LoggingFeature
quarkus.cxf.endpoint."/greeting".in-interceptors=com.example.MyInterceptor
quarkus.cxf.endpoint."/greeting".out-interceptors=com.example.MyInterceptor
quarkus.cxf.endpoint."/greeting".in-fault-interceptors=com.example.MyInterceptor
quarkus.cxf.endpoint."/greeting".out-fault-interceptors=com.example.MyInterceptor
from quarkus-cxf.
hmmm.
About header, I think you can add it by injecting client.@Inject MyWebService service; // and in init function of bean do: AuthSoapHeader authHeader = new AuthSoapHeader(); authHeader.setStrUserName(username); authHeader.setStrPassword(password); Header soapHdr = new Header(AUTH_HEADER_NAME, authHeader, new JAXBDataBinding(AuthSoapHeader.class)); ClientProxy.getClient(service).getRequestContext().put(Header.HEADER_LIST, List.of(soapHdr));
hi @dufoli
I'm not really trying to use this approach but I feel like I should warn you that calls to ClientProxy.getClient(service)
with injected services never work. Or at least, they never have in my environment. Instead, I always get this exception:
java.lang.IllegalArgumentException: not a proxy instance
at java.base/java.lang.reflect.Proxy.getInvocationHandler(Proxy.java:1103)
at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:127)
The reasoning here, I believe, is that at this point service
is actually a CDI/Arc proxy and not a CXF-created proxy like the method expects.
At some point I actually had a variation of this working but it required a reflective call to arc_contextualInstance()
soooo ... quite the hack.
from quarkus-cxf.
I have added config for that.
1 solutions currently:* annotation * add config quarkus.cxf.endpoint."/greeting".features=org.apache.cxf.feature.LoggingFeature quarkus.cxf.endpoint."/greeting".in-interceptors=com.example.MyInterceptor quarkus.cxf.endpoint."/greeting".out-interceptors=com.example.MyInterceptor quarkus.cxf.endpoint."/greeting".in-fault-interceptors=com.example.MyInterceptor quarkus.cxf.endpoint."/greeting".out-fault-interceptors=com.example.MyInterceptor
You might want to re-open this issue as I think I found at least 3 bugs in the configuration-based approach.
- Only the "features" config is being checked for its presence and if present the code attempts to use all the other configs which causes an exception if one of those is empty (see here).
- The lists of features and interceptors never reach
CXFClientInfo
which in turn means thatCxfClientProducer
can only see empty lists and thus no feature or interceptor is applied. - Even after fixing 2., if the feature/interceptor is not available as an injectable bean an exception will be raised instead of a new instance being created. This is because the call to
CDI.current().select(cls).get()
(here) throws anUnsatisfiedResolutionException
instead of returning null as the code seems to expect.
from quarkus-cxf.
@dufoli
I confirm point 1 was fixed as you said and #61 fixed point 2 afterwards. This leaves point 3 as the only sticking point. If you're not refactoring that particular piece of code then it is a fairly trivial fix. You can either:
- Add
UnsatisfiedResolutionException
to the catch block and ignore the exception - Check the result of
isResolvable()
before you callget()
on the CDI instance
from quarkus-cxf.
Related Issues (20)
- [CXF 4.0.4+] Remove workaround for CXF-8983 HOT 1
- Load keystores and truststores also from the filesystem as documented HOT 1
- Move tests passing on a FIPS system from ws-security-policy to ws-security-policy-fips
- [CI] - `quarkus-main` branch build failure HOT 70
- `MutualTlsTest.mTls()` fails on Quarkus Platform
- Ban CXF artifacts we do not support
- CxfClient with ComplexTypes fails on subsequent re-runs of quarkus test. HOT 3
- XmlSchemaValidationTest fails on the different language settings
- wsdl2Java code generation fails due to a missing SPI implementation HOT 2
- Could not load keystore in @QuarkusTest HOT 3
- Ws-security tests: fails in fips because of missing <sp:CustomAlgorithmSuite/>
- Several tests from WS-Trust and Santuario XML Security are failing on FIPS machine
- Document the new `@CXFEndpoint` annotation
- wsdl2Java: support code generation from remote WSDL URLs
- Interceptors set through `@InInterceptors` and similar annotations are not looked up the CDI container HOT 3
- Schema validation is not working properly HOT 4
- Test integration with `@io.opentelemetry.instrumentation.annotations.WithSpan`
- Parametrize links in docs to point at the correct branch HOT 1
- Opentelemetry tested against external jaeger/opentelemetry
- Ban `javax.cache:cache-api`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quarkus-cxf.