2011-09-28 7 views
2

NetBeans 7.0.1의 응용 프로그램에 웹 서비스 참조를 추가하려고합니다. Metro 웹 서비스는 SSL로 보호되며 클라이언트를 실행하려는 동일한 컴퓨터에서 호스팅됩니다. 나는 '새 웹 서비스 클라이언트'마법사를 사용하고 있지만, 내가 SSL 보호 WSDL을 제출할 때, 나는 다음과 같은 오류 메시지가 얻을 :NetBeans : SSL로 보호되는 Metro 서비스를 사용하는 웹 서비스 클라이언트를 만드는 방법은 무엇입니까?

Problem with downloading wsdl or schema file.

Check the URL, proxy settings, or whether the server is running.

URL: https://192.168.0.200:8181/MyApp/myService?wsdl

메트로 사용자 가이드 - To Secure the Example Web Service Client Application (SSL) 상태 :

In the step where you are directed to cut and paste the URL of the web service that you want the client to consume into the WSDL URL field, type https :// fully-qualified-hostname:8181 /CalculatorApplication/CalculatorWSService?wsdl (changes indicated in bold) to indicate that this client should reference the web service using the secure port. The first time you access this service, accept the certificate (s1as) when you are prompted. This is the server certificate popping up to confirm its identity to the client.

In some cases, you might get an error dialog telling you that the URL https:// fully-qualified-hostname :8181/CalculatorApplication/CalculatorWSService?wsdl couldn't be downloaded. However, this the correct URL, and it does load when you run the service. So, when this error occurs, repeat the steps that create the Web Service Client using the secure WSDL. The second time, the web service reference is created and you can continue creating the client.

없음을 몇 번이나 시도해도 여전히 동일한 오류 메시지가 표시됩니다 (프락시가 설정되지 않고 서버가 배치 된 서비스로 실행 중입니다). WSDL은 인증서를 수락 한 후 브라우저에 표시됩니다. 기본 WSDL URL (HTTPS가없는 URL)을 입력하면 마법사가이를 받아 들여 클라이언트를 생성합니다. 이 작업을하려면 무엇을해야합니까? 내가 다른 시스템에 클라이언트 및 서비스를 실행하는 경우

UPDATE

동일하게 적용됩니다. 기본 개발 인증서를 사용하고 있습니다. 리트리버 출력 :

Error: An I/O error occured. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target`

VMargs에 keytore 및 truststore를 설정해야합니까? 웹 서비스가 포함 된 동일한 웹 응용 프로그램에서이 서비스 참조를 원한다면 어떻게해야합니까?

+0

서버 인증서가 클라이언트 트러스트 스토어에없는 것으로 의심되어 ssl 핸드 셰이크가 실패합니다. – Zaki

+0

@ Zaki'처음으로이 서비스에 액세스하면 메시지가 나타나면 인증서 (s1as)를 수락하십시오. '이런 일은 일어나지 않고 오류 메시지가 나타납니다. .NET에서 작동하는 클라이언트를 만들었고 마법사에서 WSDL URL을 입력 한 후 프롬프트를 표시했습니다. –

답변

2

답변 here을 발견

다음 옵션으로 넷빈즈를 실행해야합니다 :

<NETBEANS_HOME>/bin/netbeans.exe 
-J-Djavax.net.ssl.trustStore=<AS_HOME>/domains/domain1/config/cacerts.jks 
-J-Djavax.net.ssl.keyStore=<AS_HOME>/domains/domain1/config/keystore.jks 
-J-Djavax.net.ssl.trustStorePassword=changeit 
-J-Djavax.net.ssl.keyStorePassword=changeit 

실제로 netbeans_default_options에서 <NETBEANS_HOME>/etc/netbeans.conf 사람들을 설정합니다. 그래도 여전히 오류가 발생했습니다. SSL 보호 서비스 용 클라이언트 코드를 생성 할 수있게되었습니다. 간단한 WS 호출을 실행하면

편집 중요 중요 : 다음은 이전 JAX-WS 라이브러리를 사용하는 경우에만 발생합니다!

Exception in thread "main" javax.xml.ws.WebServiceException: Cannot find 'https://localhost:8181/myApp/myService?wsdl' wsdl. Place the resource correctly in the classpath.

이이 같은 방법으로 고객에게 DATASTOREWS_WSDL_LOCATION 속성을 설정하여 해결할 수 있습니다 간단한 자바 응용 프로그램을 위해 그것을 생성하는 경우

private static URL getURL() { 
    try { 
     return new URL("https://localhost:8181/myApp/myService?wsdl"); 
    } catch (MalformedURLException ex) { 
     Logger.getLogger(DataStoreWS_Service.class.getName()).log(Level.SEVERE, null, ex); 
     return null; 
    } 
} 

이 만 필요한 생성 된 클라이언트 코드 다르기 때문에 Java 웹 응용 프로그램 용. 또한 로컬 IP처럼 정규화 된 호스트 이름으로 작업 할 수 없습니다. 유일하게 일한 것은 localhost였습니다. 한 가지 중요한 점은 서비스 측과 동일한 메트로 라이브러리를 묶는 것을 잊지 마십시오! NB bug report.