You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sascha Skorupa <sa...@rwth-aachen.de> on 2013/12/05 11:53:05 UTC
JaxWsProxyFactoryBean Error/ HTTP digest authentication since 2.7.4
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
Re: JaxWsProxyFactoryBean Error/ HTTP digest authentication since 2.7.4
Posted by Sascha Skorupa <Sa...@rwth-aachen.de>.
Hi Dan,
same problem with 2.7.8.
Sascha
Re: JaxWsProxyFactoryBean Error/ HTTP digest authentication since 2.7.4
Posted by Daniel Kulp <dk...@apache.org>.
Can you try with 2.7.8? I know there was a fix in the digest implementation for 2.7.8. (CXF-5366)
Dan
On Dec 5, 2013, at 5:53 AM, Sascha Skorupa <sa...@rwth-aachen.de> wrote:
> 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
>
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com