You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Christian Schneider (JIRA)" <ji...@apache.org> on 2011/01/16 09:01:05 UTC
[jira] Created: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
-------------------------------------------------------------------------------------------------------------
Key: CXF-3249
URL: https://issues.apache.org/jira/browse/CXF-3249
Project: CXF
Issue Type: Bug
Components: Transports
Affects Versions: 2.3.1
Reporter: Christian Schneider
Assignee: Christian Schneider
Fix For: 2.3.2
I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
401 Authentication required. But it returns the following exception:
WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
java.lang.RuntimeException: Can't find input stream in message
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
at $Proxy30.getCustomersByName(Unknown Source)
at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984308#action_12984308 ]
CXF User commented on CXF-3249:
-------------------------------
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with JBoss 6 GA release "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I alos find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfullyinvoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator" I can access that remote web service with CXF stack?
Thanks a lot for your help.
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984308#action_12984308 ]
CXF User edited comment on CXF-3249 at 1/20/11 1:04 PM:
--------------------------------------------------------
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with "JBoss 6.0 GA" release the "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I also find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfully invoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator", I can access that remote web service with CXF stack in the same way?
Thanks a lot for your help.
was (Author: cxfuser71):
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with "JBoss 6.0 GA" release the "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I also find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfully invoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator" I can access that remote web service with CXF stack?
Thanks a lot for your help.
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983957#action_12983957 ]
CXF User edited comment on CXF-3249 at 1/19/11 7:42 PM:
--------------------------------------------------------
Hi Christian,
In my case I do pass the credential - but still I get the same exception as shown below.
I am accessing a remote webservice (i.e. deployed in different m/c).
I am using JBoss 6.x which comes with CXF stack (version 2.3.1) - can you pls. suggest where need to look up further?
The remote webservice's WSDL isproperly accessible thru browser.
For passing the credential I use following code in my WS-client.
The sever side implementation (to expose the web service) has been done using .NET - so my question is do I need to keep any "cxf.xml" as part of my ws-client ?
If yes, then what should be the ideal place to keep such "cxf.xml" file?
My ws-client class is inside a jar and is deployed as part of EAR/lib in Jboss (not part of WAR module).
===========================================================
class MyAuthenticator extends Authenticator {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(login, password.toCharArray());
}
}
Authenticator.setDefault(new MyAuthenticator());
=============================================================
19:08:20,449 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {http://www.towersoft.com/schema/webservice/trim2/}Engine from WSDL: http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL
19:08:22,424 WARN [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {http://www.towersoft.com/schema/webservice/trim2/}Engine#{http://www.towersoft.com/
schema/webservice/trim2/}ListProperties has thrown exception, unwinding now: java.lang.RuntimeException: Can't find input stream in message
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116) [:2.3.1]
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
Hope I will get some pointer to look for.
Thanks,
- Kuntal
was (Author: cxfuser71):
Hi Christian,
In my case I do pass the credential - but still I get the same exception as shown below.
I am accessing a remote webservice (i.e. deployed in different m/c).
I am using JBoss 6.x which comes with CXF stack (version 2.3.1) - can you pls. suggest where need to look up further?
The remote webservice's WSDL isproperly accessible thru browser.
For passing the credential I use following code in my WS-client.
The sever side implementation (to expose the web service) has been done using .NET - so my question is do I need to keep any "cxf.xml" as part of my ws-client ?
If yes, then what should be the ideal place to keep such "cxf.xml" file?
My ws-client class is inside a jar and is deployed as part of EAR/lib in Jboss (not part of WAR module).
===========================================================
class MyAuthenticator extends Authenticator {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(login, password.toCharArray());
}
}
Authenticator.setDefault(new MyAuthenticator());
=============================================================
19:08:20,449 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {http://www.towersoft.com/schema/webservice/trim2/}Engine from WSDL: http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL
19:08:22,424 WARN [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {http://www.towersoft.com/schema/webservice/trim2/}Engine#{http://www.towersoft.com/
schema/webservice/trim2/}ListProperties has thrown exception, unwinding now: java.lang.RuntimeException: Can't find input stream in message
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116) [:2.3.1]
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982603#action_12982603 ]
Sergey Beryozkin commented on CXF-3249:
---------------------------------------
Hi Christian
One minor comment is that having a 500 status does not guarantee that it is a valid SOAP fault response, but this probably indicates the server is in a pretty bad state.
The other comment is that you may still want to wrap a CXF specific HTTP exception into a javax one you spotted on Friday somewhere at the JAX-WS level (in-fault interceptor comes to mind), this would make the JAX-WS client code portable and it will also let us experiment going forward with different approaches.
For example, the reason the JAX-RS client runtime 'disables' the exceptions at the HTTPConduit level is that noisy log messages are being generated and if we have a client code catching (JAX-RS) WebApplicationExceptions or checking explicit (JAX-RS) Responses and doing some logging of it own then the logging becomes too visible... Disabling logging at the transport level is not possible because we may have some genuine IO exceptions like timeout, etc, but choosing to deal with 400+ statuses at the higher level is a possibility
thanks, Sergey
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984618#action_12984618 ]
Christian Schneider commented on CXF-3249:
------------------------------------------
We have an implementation of Authenticator in CXF so it should work but I have never used it.
To log the messages you should try:
Client client = ClientProxy.getClient(serviceProxy);
client.getOutInterceptors().add(new LoggingOutInterceptor());
client.getInInterceptors().add(new LoggingInInterceptor());
also see: http://cxf.apache.org/docs/debugging-and-logging.html
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Schneider resolved CXF-3249.
--------------------------------------
Resolution: Fixed
Committed patch
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984308#action_12984308 ]
CXF User edited comment on CXF-3249 at 1/20/11 1:09 PM:
--------------------------------------------------------
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with "JBoss 6.0 GA" release the "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I also find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfully invoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator", I can access that remote web service with CXF stack in the same way?
Also, if I use "BindingProvider" I get following error in ws-client console.
In the WSDl I could not find any <HEAD> or <META> tag - so it is part of the response, being parsed by the library.
Is there a way to dump the response received from server side?
================================================================================
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93) [:2.3.1]
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:207) [:2.3.1]
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150) [:2.3.1]
... 93 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.
at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:235) [:2.3.1]
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186) [:2.3.1]
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91) [:2.3.1]
... 95 more
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.
at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]
at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:630) [:3.2.6]
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3256) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3198) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2830) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019) [:3.2.6]
at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:998) [:2.3.1]
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:849) [:2.3.1]
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226) [:2.3.1]
... 97 more
===================================================================================
Thanks a lot for your help.
was (Author: cxfuser71):
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with "JBoss 6.0 GA" release the "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I also find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfully invoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator", I can access that remote web service with CXF stack in the same way?
Thanks a lot for your help.
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984308#action_12984308 ]
CXF User edited comment on CXF-3249 at 1/20/11 1:02 PM:
--------------------------------------------------------
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with "JBoss 6.0 GA" release the "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I also find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfullyinvoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator" I can access that remote web service with CXF stack?
Thanks a lot for your help.
was (Author: cxfuser71):
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with JBoss 6 GA release "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I alos find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfullyinvoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator" I can access that remote web service with CXF stack?
Thanks a lot for your help.
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983957#action_12983957 ]
CXF User edited comment on CXF-3249 at 1/19/11 7:43 PM:
--------------------------------------------------------
Hi Christian,
In my case I do pass the credential - but still I get the same exception as shown below.
I am accessing a remote webservice (i.e. deployed in different m/c).
I am using JBoss 6.x which comes with CXF stack (version 2.3.1) - can you pls. suggest where need to look up further?
The remote webservice's WSDL is properly accessible thru browser.
For passing the credential I have following code in my WS-client.
The sever side implementation (to expose the web service) has been done using .NET - so my question is do I need to keep any "cxf.xml" as part of my ws-client ?
If yes, then what should be the ideal place to keep such "cxf.xml" file?
My ws-client class is inside a jar and is deployed as part of EAR/lib in Jboss (not part of WAR module).
===========================================================
class MyAuthenticator extends Authenticator {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(login, password.toCharArray());
}
}
Authenticator.setDefault(new MyAuthenticator());
=============================================================
19:08:20,449 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {http://www.towersoft.com/schema/webservice/trim2/}Engine from WSDL: http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL
19:08:22,424 WARN [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {http://www.towersoft.com/schema/webservice/trim2/}Engine#{http://www.towersoft.com/
schema/webservice/trim2/}ListProperties has thrown exception, unwinding now: java.lang.RuntimeException: Can't find input stream in message
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116) [:2.3.1]
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
Hope I will get some pointer to look for.
Thanks,
-Kuntal
was (Author: cxfuser71):
Hi Christian,
In my case I do pass the credential - but still I get the same exception as shown below.
I am accessing a remote webservice (i.e. deployed in different m/c).
I am using JBoss 6.x which comes with CXF stack (version 2.3.1) - can you pls. suggest where need to look up further?
The remote webservice's WSDL isproperly accessible thru browser.
For passing the credential I use following code in my WS-client.
The sever side implementation (to expose the web service) has been done using .NET - so my question is do I need to keep any "cxf.xml" as part of my ws-client ?
If yes, then what should be the ideal place to keep such "cxf.xml" file?
My ws-client class is inside a jar and is deployed as part of EAR/lib in Jboss (not part of WAR module).
===========================================================
class MyAuthenticator extends Authenticator {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(login, password.toCharArray());
}
}
Authenticator.setDefault(new MyAuthenticator());
=============================================================
19:08:20,449 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {http://www.towersoft.com/schema/webservice/trim2/}Engine from WSDL: http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL
19:08:22,424 WARN [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {http://www.towersoft.com/schema/webservice/trim2/}Engine#{http://www.towersoft.com/
schema/webservice/trim2/}ListProperties has thrown exception, unwinding now: java.lang.RuntimeException: Can't find input stream in message
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116) [:2.3.1]
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
Hope I will get some pointer to look for.
Thanks,
- Kuntal
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983957#action_12983957 ]
CXF User commented on CXF-3249:
-------------------------------
Hi Christian,
In my case I do pass the credential - but still I get the same exception as shown below.
I am accessing a remote webservice (i.e. deployed in different m/c).
I am using JBoss 6.x which comes with CXF stack (version 2.3.1) - can you pls. suggest where need to look up further?
The remote webservice's WSDL isproperly accessible thru browser.
For passing the credential I use following code in my WS-client.
The sever side implementation (to expose the web service) has been done using .NET - so my question is do I need to keep any "cxf.xml" as part of my ws-client ?
If yes, then what should be the ideal place to keep such "cxf.xml" file?
My ws-client class is inside a jar and is deployed as part of EAR/lib in Jboss (not part of WAR module).
===========================================================
class MyAuthenticator extends Authenticator {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(login, password.toCharArray());
}
}
Authenticator.setDefault(new MyAuthenticator());
=============================================================
19:08:20,449 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {http://www.towersoft.com/schema/webservice/trim2/}Engine from WSDL: http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL
19:08:22,424 WARN [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {http://www.towersoft.com/schema/webservice/trim2/}Engine#{http://www.towersoft.com/
schema/webservice/trim2/}ListProperties has thrown exception, unwinding now: java.lang.RuntimeException: Can't find input stream in message
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116) [:2.3.1]
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984308#action_12984308 ]
CXF User edited comment on CXF-3249 at 1/20/11 1:03 PM:
--------------------------------------------------------
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with "JBoss 6.0 GA" release the "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I also find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfully invoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator" I can access that remote web service with CXF stack?
Thanks a lot for your help.
was (Author: cxfuser71):
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with "JBoss 6.0 GA" release the "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I also find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfullyinvoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator" I can access that remote web service with CXF stack?
Thanks a lot for your help.
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984308#action_12984308 ]
CXF User edited comment on CXF-3249 at 1/20/11 1:19 PM:
--------------------------------------------------------
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with "JBoss 6.0 GA" release the "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I also find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfully invoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator", I can access that remote web service with CXF stack in the same way?
Also, if I use "BindingProvider" I get following error in ws-client console.
In the WSDL I could not find any <HEAD> or <META> tag - so it is part of the response, being parsed by the library.
Is there a way to dump the response received from server side?
================================================================================
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93) [:2.3.1]
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:207) [:2.3.1]
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150) [:2.3.1]
... 93 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.
at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:235) [:2.3.1]
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186) [:2.3.1]
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91) [:2.3.1]
... 95 more
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.
at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]
at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:630) [:3.2.6]
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3256) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3198) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2830) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019) [:3.2.6]
at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:998) [:2.3.1]
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:849) [:2.3.1]
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226) [:2.3.1]
... 97 more
===================================================================================
Thanks a lot for your help.
was (Author: cxfuser71):
Hi Christian,
I do not have access in the server side implementation - I am the web service consumer.
What I have is the WSDL file and a jar file containing all related artifacts.
Can you tell me if "BindingProvider" is the only option to pass username/password on the request context?
Previous version of JBoss would support "Metro WS stack" and we could use "java.net.Authenticator" instead of BindingProvider and could access the remote web service successfully.
But with "JBoss 6.0 GA" release the "Metro WS stack" has been discontinued and we have to use "CXF WS stack".
I also find that if I use "JAXWS RI" implementation that comes with JDK 6, I can still use the "java.net.Authenticator" and can successfully invoke the remote web service.
Is there any way I can tweak my ws-client side code so that by using "java.net.Authenticator", I can access that remote web service with CXF stack in the same way?
Also, if I use "BindingProvider" I get following error in ws-client console.
In the WSDl I could not find any <HEAD> or <META> tag - so it is part of the response, being parsed by the library.
Is there a way to dump the response received from server side?
================================================================================
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93) [:2.3.1]
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:207) [:2.3.1]
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150) [:2.3.1]
... 93 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.
at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:235) [:2.3.1]
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186) [:2.3.1]
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91) [:2.3.1]
... 95 more
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.
at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]
at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:630) [:3.2.6]
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3256) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3198) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2830) [:3.2.6]
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019) [:3.2.6]
at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:998) [:2.3.1]
at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:849) [:2.3.1]
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226) [:2.3.1]
... 97 more
===================================================================================
Thanks a lot for your help.
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984968#action_12984968 ]
CXF User commented on CXF-3249:
-------------------------------
Hi Chrisitian,
I used the "Authenticator" with CXF and found it works okay.
Actually in my case the webservice was deployed on Microsoft IIS server and I "have to" use "Authenticator" - "BindingProvider" did not work for me.
It turns out that since the web service was deployed on Microsoft IIS which needs NTLM authentication, and if we use Apache CXF library for ws-client, we "must" need to setup the CXF client to turn off chunking. The reason is that the NTLM authentication requires a 3 part handshake which breaks the streaming. This was beyond my knowledge as I have very very limited knowledge about Microsoft technologies.
Surprisingly JAX-WS RI implementation or Metro-WS stack does not demand this kind requirement. Thus in my opinion it is indeed an overhead for CXF users.
The other error. i.e. "Unexpected close tag </HEAD>; expected </META>", was occurring because the server was sending an error page which was lacking an end </META> tag.
The CXF library is strict in XML parsing and instead of showing error as "401 Authentication Required", it just states about the parsing error.
AGAIN, the JAX-WS RI implementation or Metro-WS stack does properly show the correct error message (i.e. 401 authentication required.) even if the returned html page misses an end </META> tag.
Though I have found the solution but I would love to know more about NTLM authentication and how the turning the chunking off resolves the authentication failure issues with CXF stack. So if anybody can throw some light in it, will be very happy.
Cheers,
- Kuntal
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984146#action_12984146 ]
Christian Schneider commented on CXF-3249:
------------------------------------------
Have you checked that the credentials really reach the server. Could you try this:
BindingProvider bp = (BindingProvider)serviceProxy;
bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
These lines should be inserted before calling the service.
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983957#action_12983957 ]
CXF User edited comment on CXF-3249 at 1/19/11 7:44 PM:
--------------------------------------------------------
Hi Christian,
In my case I do pass the credential - but still I get the same exception as shown below.
I am accessing a remote webservice (i.e. deployed in different m/c).
I am using JBoss 6.x which comes with CXF stack (version 2.3.1) - can you pls. suggest where need to look up further?
The remote webservice's WSDL is properly accessible thru browser.
For passing the credential I have following code in my WS-client.
The sever side implementation (to expose the web service) has been done using .NET - so my question is do I need to keep any "cxf.xml" as part of my ws-client ?
If yes, then what should be the ideal place to keep such "cxf.xml" file?
My ws-client class is inside a jar and is deployed as part of EAR/lib in Jboss (i.e. ws-client is Not part of WAR module).
===========================================================
class MyAuthenticator extends Authenticator {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(login, password.toCharArray());
}
}
Authenticator.setDefault(new MyAuthenticator());
=============================================================
19:08:20,449 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {http://www.towersoft.com/schema/webservice/trim2/}Engine from WSDL: http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL
19:08:22,424 WARN [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {http://www.towersoft.com/schema/webservice/trim2/}Engine#{http://www.towersoft.com/
schema/webservice/trim2/}ListProperties has thrown exception, unwinding now: java.lang.RuntimeException: Can't find input stream in message
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116) [:2.3.1]
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
Hope I will get some pointer to look for.
Thanks,
-Kuntal
was (Author: cxfuser71):
Hi Christian,
In my case I do pass the credential - but still I get the same exception as shown below.
I am accessing a remote webservice (i.e. deployed in different m/c).
I am using JBoss 6.x which comes with CXF stack (version 2.3.1) - can you pls. suggest where need to look up further?
The remote webservice's WSDL is properly accessible thru browser.
For passing the credential I have following code in my WS-client.
The sever side implementation (to expose the web service) has been done using .NET - so my question is do I need to keep any "cxf.xml" as part of my ws-client ?
If yes, then what should be the ideal place to keep such "cxf.xml" file?
My ws-client class is inside a jar and is deployed as part of EAR/lib in Jboss (not part of WAR module).
===========================================================
class MyAuthenticator extends Authenticator {
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(login, password.toCharArray());
}
}
Authenticator.setDefault(new MyAuthenticator());
=============================================================
19:08:20,449 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {http://www.towersoft.com/schema/webservice/trim2/}Engine from WSDL: http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL
19:08:22,424 WARN [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {http://www.towersoft.com/schema/webservice/trim2/}Engine#{http://www.towersoft.com/
schema/webservice/trim2/}ListProperties has thrown exception, unwinding now: java.lang.RuntimeException: Can't find input stream in message
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116) [:2.3.1]
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) [:2.3.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
Hope I will get some pointer to look for.
Thanks,
-Kuntal
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984968#action_12984968 ]
CXF User edited comment on CXF-3249 at 1/21/11 5:21 PM:
--------------------------------------------------------
Hi Chrisitian,
I used the "Authenticator" with CXF and found it works okay.
Actually in my case the webservice was deployed on Microsoft IIS server and I "have to" use "Authenticator" - "BindingProvider" did not work for me.
It turns out that since the web service was deployed on Microsoft IIS which needs NTLM authentication, and if we use Apache CXF library for ws-client, we "must" need to setup the CXF client to turn off chunking. The reason is that the NTLM authentication requires a 3 part handshake which breaks the streaming. This was beyond my knowledge as I have very very limited knowledge about Microsoft technologies.
Surprisingly JAX-WS RI implementation or Metro-WS stack does not demand this kind requirement. Thus in my opinion it is indeed an overhead for CXF users.
The other error. i.e. "Unexpected close tag </HEAD>; expected </META>", was occurring because the server was sending an error page which was lacking an end </META> tag.
The CXF library is strict in XML parsing and instead of showing error as "401 Authentication Required", it just states about the parsing error.
AGAIN, the JAX-WS RI implementation or Metro-WS stack does properly show the correct error message (i.e. 401 authentication required.) even if the returned html page misses an end </META> tag.
Also can you tell me what is the side effect of "turning off chunking"? Will my ws-request take more time to retrieve the complete result set from server?
Do I need to "turn ON" chunking once the authentication completes successfully? If yes then how can I do that?
Though I have found the solution but I would love to know more about NTLM authentication and how the turning the chunking off resolves the authentication failure issues with CXF stack. So if anybody can throw some light in it, will be very happy.
Cheers,
- Kuntal
was (Author: cxfuser71):
Hi Chrisitian,
I used the "Authenticator" with CXF and found it works okay.
Actually in my case the webservice was deployed on Microsoft IIS server and I "have to" use "Authenticator" - "BindingProvider" did not work for me.
It turns out that since the web service was deployed on Microsoft IIS which needs NTLM authentication, and if we use Apache CXF library for ws-client, we "must" need to setup the CXF client to turn off chunking. The reason is that the NTLM authentication requires a 3 part handshake which breaks the streaming. This was beyond my knowledge as I have very very limited knowledge about Microsoft technologies.
Surprisingly JAX-WS RI implementation or Metro-WS stack does not demand this kind requirement. Thus in my opinion it is indeed an overhead for CXF users.
The other error. i.e. "Unexpected close tag </HEAD>; expected </META>", was occurring because the server was sending an error page which was lacking an end </META> tag.
The CXF library is strict in XML parsing and instead of showing error as "401 Authentication Required", it just states about the parsing error.
AGAIN, the JAX-WS RI implementation or Metro-WS stack does properly show the correct error message (i.e. 401 authentication required.) even if the returned html page misses an end </META> tag.
Though I have found the solution but I would love to know more about NTLM authentication and how the turning the chunking off resolves the authentication failure issues with CXF stack. So if anybody can throw some light in it, will be very happy.
Cheers,
- Kuntal
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982236#action_12982236 ]
Christian Schneider commented on CXF-3249:
------------------------------------------
It seems this happens because the message has no inputstream in this case. I added an empty inputstream for these cases.
Additionally I added throwing an http exception for all reponse codes >= 400 and != 500. I hope this is correct. All tests passed.
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CXF-3249) When accessing a service that requires
auth CXF returns: RuntimeException: Can't find input stream in message
Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982239#action_12982239 ]
Christian Schneider commented on CXF-3249:
------------------------------------------
The exception now looks like the following. I also tried to avoid the could not send message but the code of cxf depends on this at some places. Perhaps we can do this at a later time.
WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
at $Proxy30.getCustomersByName(Unknown Source)
at client.JaxWsClient.main(JaxWsClient.java:24)
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '401: Full authentication is required to access this resource' when communicating with http://localhost:9090/CustomerServicePort
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1502)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1448)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1356)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:614)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 8 more
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (CXF-3249) When accessing a service
that requires auth CXF returns: RuntimeException: Can't find input stream
in message
Posted by "CXF User (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984968#action_12984968 ]
CXF User edited comment on CXF-3249 at 1/21/11 5:24 PM:
--------------------------------------------------------
Hi Chrisitian,
I have used the "Authenticator" with CXF and found it works okay.
Actually in my case the webservice was deployed on Microsoft IIS server and I "have to" use "Authenticator" - "BindingProvider" does not work for me.
It turns out that since the web service was deployed on Microsoft IIS which needs NTLM authentication, and if we use Apache CXF library for ws-client, we "must" need to setup the CXF client to turn off chunking. The reason is that the NTLM authentication requires a 3 part handshake which breaks the streaming. This was beyond my knowledge as I have very very limited knowledge about Microsoft technologies.
Surprisingly JAX-WS RI implementation or Metro-WS stack does not demand this kind requirement. Thus in my opinion it is indeed an overhead for CXF users.
The other error. i.e. "Unexpected close tag </HEAD>; expected </META>", was occurring because the server was sending an error page which was lacking an end </META> tag.
The CXF library is strict in XML parsing and instead of showing error as "401 Authentication Required", it just states about the parsing error.
AGAIN, the JAX-WS RI implementation or Metro-WS stack does properly show the correct error message (i.e. 401 authentication required.) even if the returned html page misses an end </META> tag.
Also can you tell me what is the side effect of "turning off chunking"? Will my ws-request take more time to retrieve the complete result set from server?
Do I need to "turn ON" chunking once the authentication completes successfully? If yes then how can I do that?
Though I have found the solution but I would love to know more about NTLM authentication and how the turning the chunking off resolves the authentication failure issues with CXF stack. So if anybody can throw some light in it, will be very happy.
Cheers,
- Kuntal
was (Author: cxfuser71):
Hi Chrisitian,
I used the "Authenticator" with CXF and found it works okay.
Actually in my case the webservice was deployed on Microsoft IIS server and I "have to" use "Authenticator" - "BindingProvider" did not work for me.
It turns out that since the web service was deployed on Microsoft IIS which needs NTLM authentication, and if we use Apache CXF library for ws-client, we "must" need to setup the CXF client to turn off chunking. The reason is that the NTLM authentication requires a 3 part handshake which breaks the streaming. This was beyond my knowledge as I have very very limited knowledge about Microsoft technologies.
Surprisingly JAX-WS RI implementation or Metro-WS stack does not demand this kind requirement. Thus in my opinion it is indeed an overhead for CXF users.
The other error. i.e. "Unexpected close tag </HEAD>; expected </META>", was occurring because the server was sending an error page which was lacking an end </META> tag.
The CXF library is strict in XML parsing and instead of showing error as "401 Authentication Required", it just states about the parsing error.
AGAIN, the JAX-WS RI implementation or Metro-WS stack does properly show the correct error message (i.e. 401 authentication required.) even if the returned html page misses an end </META> tag.
Also can you tell me what is the side effect of "turning off chunking"? Will my ws-request take more time to retrieve the complete result set from server?
Do I need to "turn ON" chunking once the authentication completes successfully? If yes then how can I do that?
Though I have found the solution but I would love to know more about NTLM authentication and how the turning the chunking off resolves the authentication failure issues with CXF stack. So if anybody can throw some light in it, will be very happy.
Cheers,
- Kuntal
> When accessing a service that requires auth CXF returns: RuntimeException: Can't find input stream in message
> -------------------------------------------------------------------------------------------------------------
>
> Key: CXF-3249
> URL: https://issues.apache.org/jira/browse/CXF-3249
> Project: CXF
> Issue Type: Bug
> Components: Transports
> Affects Versions: 2.3.1
> Reporter: Christian Schneider
> Assignee: Christian Schneider
> Fix For: 2.3.2
>
>
> I try to access a service that requires basic auth. My request does not include credentials. I would expect CXF to return something like
> 401 Authentication required. But it returns the following exception:
> WARNUNG: Interceptor for {http://customerservice.example.com/}CustomerServiceService#{http://customerservice.example.com/}getCustomersByName has thrown exception, unwinding now
> java.lang.RuntimeException: Can't find input stream in message
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> at $Proxy30.getCustomersByName(Unknown Source)
> at client.JaxWsClient.main(JaxWsClient.java:24)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.