简体   繁体   English

如何为本地主机上的安全Web服务创建Web服务客户端

[英]How to create a webservice client to a secure webservice at localhost

I have created a webservice and it has deployed on localhost. 我创建了一个Web服务,并将其部署在localhost上。 When I browse the WSDL using browser https://localhost:8181/Test/TestOne?wsdl it shows me the WSDL. 当我使用浏览器https://localhost:8181/Test/TestOne?wsdl浏览WSDL时,它向我显示了WSDL。

But when I try to create client program (I am using NetBeans 7.0) and give this URL for the WSDL URL, it shows me error message that wsdl Problem with downloading wsdl or schema file.... . 但是,当我尝试创建客户端程序(我正在使用NetBeans 7.0)并为WSDL URL提供此URL时,它向我显示错误消息wsdl 下载wsdl或模式文件有问题 I tried editing the proxy to use system proxy settings also but no luck. 我尝试编辑代理以也使用系统代理设置,但是没有运气。 Am I doing something wrong or is this a bug in NetBeans? 我是在做错什么,还是NetBeans中的错误?

I think your server doesn't use a certificate signed by CA. 我认为您的服务器未使用CA签署的证书。 So, you need to create a keystore with certificate and pass "-Djavax.net.ssl.trustStore=" parameter to NetBeans. 因此,您需要使用证书创建密钥库,并将“ -Djavax.net.ssl.trustStore =“参数传递给NetBeans。

Open the wizard for setting the attributes for the WebService: right mouse click on the Web Service reference in the client application, choose Edit WebService Attributes, go to Wsimport options tab, and correct the property wsdlLocation as follows: 打开用于设置WebService的属性的向导:右键单击客户端应用程序中的Web Service引用,选择“编辑WebService Attributes”,转到“ Wsimport选项”选项卡,并按如下所示更正属性wsdlLocation:

from: https://<address>:8181/<ws-url>?wsdl
to: /META-INF/wsdl/<address>_8181/<ws-url>.wsdl 

more info here 更多信息在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM