0
votes

I'm currently using apache cxf client to interact with some web-services. One of my request failed and I wanted to extract the targeted URL programmatically from the client in order to manually debug the request using curl / postman. (the request has a lot of query parameters)

I've try to convert my client to org.apache.cxf.jaxrs.client and then use

org.apache.cxf.jaxrs.client#getCurrentURI() 

to

get the current URI this Client is working with

according to https://cxf.apache.org/javadoc/latest/org/apache/cxf/jaxrs/client/Client.html#getCurrentURI--

however the method seem to only return the base url of the web-service not the one targeted when calling my method.

Does someone have an idea? I will try to enable client logging to view all targeted urls if this is possible, or even enable server side logging. But accessing url from cxf client would be better for me

Thank in advance

1

1 Answers

0
votes

After some research I have found how to enable client side logging:

WebClient.getConfig(myClient).getOutInterceptors().add(new LoggingOutInterceptor())

And now I can view the fully request with all query parameters from the logs.