我想在NetBeans 7.0.1中的應用程序中添加一個Web服務引用。 Metro web服務使用SSL進行保護,並託管在我想運行客戶端的同一臺計算機上。我現在用的是「新的Web服務客戶端」嚮導,但是當我提交SSL保護的WSDL,我收到以下錯誤信息:NetBeans:如何創建使用SSL保護的Metro服務的Web服務客戶端?
Problem with downloading wsdl or schema file.
Check the URL, proxy settings, or whether the server is running.
Metro用戶指南 - 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
同樣的,如果我在不同的機器上運行客戶端和服務應用。我正在使用默認的開發證書。 Retriever輸出:
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嗎?如果我想在包含Web服務的相同Web應用程序中使用此服務引用,該怎麼辦?
我懷疑服務器證書不在客戶端信任存儲區,並且ssl握手失敗。 – Zaki
@ Zaki'第一次訪問此服務時,請在提示時接受證書(s1as)。「這不會發生,我收到錯誤消息。我在.NET中創建了一個工作的客戶端,並且在嚮導中輸入WSDL URL後它確實提示。 –