Hi,
I use the client api to invoke a webservice in the following way:
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setUsername("someuser");
factory.setPassword("somepwd");
factory.setAddress("https://someurl/Webservice"); // HTTP DIGEST
Authentication
Service someService = factory.create(Service.class);
someService.invokeOperation(someRequest);
The service that should be invoked is secured by HTTP Digest authentication.
The code above works fine until I switch from version 2.7.3 of CXF to 2.7.4 (or
any higher one). After switching to 2.7.4 this stacktrace occurs when invoking
the service operation:
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '401:
Unauthorized' when communicating with https://.../...
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1530)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1490)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1309)
at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:622)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 32 more
I use the following dependencies:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>2.7.4</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>2.7.4</version>
</dependency>
By debugging both version of cxf I found some differences in the
PhaseInterceptorChain in org.apache.cxf.endpoint.ClientImpl before invoking the
doIntercept method in "doInvoke":
2.7.3:
Chain org.apache.cxf.phase.PhaseInterceptorChain@3fd03371. Current flow:
setup [PolicyOutInterceptor]
pre-logical [HolderOutInterceptor, SwAOutInterceptor,
WrapperClassOutInterceptor, SoapHeaderOutFilterInterceptor]
post-logical [SoapPreProtocolOutInterceptor]
prepare-send [MessageSenderInterceptor]
pre-stream [AttachmentOutInterceptor, StaxOutInterceptor]
write [SoapOutInterceptor]
marshal [WrappedOutInterceptor, BareOutInterceptor]
2.7.4
Chain org.apache.cxf.phase.PhaseInterceptorChain@12883d17. Current flow:
setup [PolicyOutInterceptor]
pre-logical [HolderOutInterceptor, SwAOutInterceptor,
WrapperClassOutInterceptor, SoapHeaderOutFilterInterceptor]
post-logical [SoapPreProtocolOutInterceptor]
prepare-send [MessageSenderInterceptor]
pre-stream [AttachmentOutInterceptor, StaxOutInterceptor]
write [SoapOutInterceptor]
marshal [WrappedOutInterceptor, BareOutInterceptor]
write-ending [SoapOutEndingInterceptor]
pre-stream-ending [StaxOutEndingInterceptor]
prepare-send-ending [MessageSenderEndingInterceptor]
Maybe this can be a hint.Something in this workflow has been changed from 2.7.3
to 2.7.4.
Thanks,
Sascha