내가 작업중인 프로젝트의 웹 서비스에 액세스하려고합니다. JAX-WS를 사용 중이며 weblogic에 배치되었습니다. 내가 WS에 액세스하려고 해요 때, 나는 다음과 같은 예외를 얻을 :javax.xml.ws.WebServiceException : WSDL에 액세스하지 못했습니다. 응답 : '401 : Unauthorized'
javax.portlet.PortletException: javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://xxx.xxxx.ro:40000/idm/ws/cup?wsdl. It failed with:
Response: '401: Unauthorized' for url: 'http://xxx.xxxx.ro:40000/idm/ws/cup?wsdl'.
at com.bea.portlet.container.PortletStub.processAction(PortletStub.java:346)
at com.bea.portlet.container.AppContainer.invokeProcessAction(AppContainer.java:678)
........
나는 문제에 관한 글을 많이 읽어와 나는 인증의 다른 유형을 시도했다. 다른 사용법에서 BindingProvider, basicHTTPAuth를 사용하려고 시도했지만 HostnameVerifier 등을 사용하지 않도록 설정했지만 결과는 여전히 남았습니다. 다음은
는, 내 코드의 조각입니다 마지막 시도 버전으로 : 링크를 교체private final static URL COMPUTEUSERPROFILEIMPLSERVICE_WSDL_LOCATION;
private final static Logger logger = Logger.getLogger(com.xxxxx.xxxxx.xx.xxxxx.cup.ComputeUserProfileImplService.class.getName());
static {
URL url = null;
try {
URL baseUrl;
baseUrl = com.xxxxx.xxxxx.xx.xxxxx.xxx.ComputeUserProfileImplService.class.getResource("");
url = new URL(baseUrl, "http://xxxx.xxxxx.ro:40000/idm/ws/cup?wsdl");
} catch (MalformedURLException e) {
logger.warning("Failed to create URL for the wsdl Location: 'xxxxxxxxxxxxxxxx', retrying as a local file");
logger.warning(e.getMessage());
}
COMPUTEUSERPROFILEIMPLSERVICE_WSDL_LOCATION = url;
}
죄송합니다,하지만 난 권한이 없습니다 해요 :
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
username,
password.toCharArray());
}
});
ComputeUserProfileImplService computeUserProfileImplService = new ComputeUserProfileImplService(
new URL(null, endpointURL, new sun.net.www.protocol.http.Handler()),
new QName("http://xxx.xx.xxxxx.xxxxx.com/",
"ComputeUserProfileImplService"));
ComputeUserProfileImpl computeUserProfile = computeUserProfileImplService
.getComputeUserProfileImplPort();
ComputeUserProfileImplService 코드의 모습 꽤 유명한 단체이기 때문에 게시하는 것이 좋습니다. 몇 가지 제안을 도와 주시면 감사하겠습니다. 나는 해결책을 찾고있다. 그러나 나는 붙어있다. 나는 그것을 이해할 수 없다. 그것은 나에게 적용되는이 weblogic 문제에 대한 해결 방법이되어야한다. 그러나 나는 그것을 찾을 수 없다. 필요한 경우 다른 스 니펫을 게시 해 드리겠습니다. 나는 이것으로 꽤 분명했기를 바랍니다.
미리 감사드립니다.