[ 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.