使用基本身份验证的JAXWS调用期间出错

时间:2015-05-24 17:36:04

标签: java web-services soap cxf

我在调用位于远程jbods服务器上的远程方法时遇到此错误堆栈 当我第二次调用位于不同wsdl上的方法时,问题是apear 似乎服务器拒绝了我的请求,未经授权的http响应401, 当我用其他java客户端正确地计算方法时,它可以正常工作

Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150)
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:65)
at javax.xml.ws.Service.<init>(Service.java:77)
at com.alpha_eng.ws.cloudupdate.LdapCloudUpdateWSImplService.<init>(LdapCloudUpdateWSImplService.java:43)
at com.alpha_eng.ws.tools.CommunicationCloudUpdate.getCloudUpdateport(CommunicationCloudUpdate.java:41)
at com.alpha_eng.cloudupdate.ChangerPassword.ModifierPassword(ChangerPassword.java:22)
at com.alpha_eng.ldapcloud.MajInfosClient.main(MajInfosClient.java:63)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:  Failed to create service.
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init> (WSDLServiceFactory.java:93)
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:205)
at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:148)
... 6 more
Caused by: javax.wsdl.WSDLException: WSDLException:  faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxParsingException: Unexpected    close tag </body>; expected </HR>.
at [row,col,system-id]:   [1,1096,"https://omcr/ldapWS/services/ldapCloudUpdate?wsdl"]
at     org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
... 8 more
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </body>; expected </HR>.
at [row,col,system-id]: [1,1096,"https://omcr/ldapWS/services/ldapCloudUpdate?wsdl"]
at com.ctc

1 个答案:

答案 0 :(得分:0)

“401未授权”表示您未向服务发送正确的用户名/密码。检查要发送的请求中的安全标头,并将其与来自有效的Java客户端的请求进行比较。如果您在身份验证详细信息正确的情况下获得401,我会感到惊讶。