简体   繁体   English

如何连接到Web服务(启用SSL和代理接口)

[英]How to Connect to a web service (SSL enabled and proxy interface)

There is a web service running on tomcat on a server. 服务器上的tomcat上运行着一个Web服务。 It is built on Java Servlet. 它基于Java Servlet构建。 It is listening others to call itself on a SSL enabled http port. 它正在侦听其他人在启用SSL的http端口上进行自我调用。 so its web service adreess looks like: https://172.29.12.12/axis/services/XYZClient?wsdl 因此其Web服务的地址如下: https ://172.29.12.12/axis/services/XYZClient?wsdl

On the other hand I want to connect the web service above from a windows application which is built on .NET frame work. 另一方面,我想从基于.NET框架的Windows应用程序连接上述Web服务。

Finally, when I want to connect the web service from my computer; 最后,当我想从计算机连接Web服务时; I get some specific erros; 我得到一些具体的错误;

Firstly I get; 首先我得到了; Proxy authentication error; 代理验证错误; then I added some new line to my code; 然后我在代码中添加了一些新行;

   Dim cr As System.Net.NetworkCredential = New System.Net.NetworkCredential("xname", "xsurname", "xdomainname")
        Dim myProxy As New WebProxy("http://mar.xxxyyy.com", True)
        myProxy.Credentials = cr

Secondly, after this modifications It says that bad request. 其次,经过此修改后,它表示不好的要求。 I did not get over this error. 我没有克服这个错误。

Moreover I did try to connect the web server on the same computer. 此外,我确实尝试在同一台计算机上连接Web服务器。 I copied my executable program to the computer where the web service runs. 我将可执行程序复制到运行Web服务的计算机上。 The error was like; 错误就像;

The underlying connection was closed: Could not establish trust relationship for SSL/TLS secure channel 基础连接已关闭:无法建立SSL / TLS安全通道的信任关系

PS: When I try to connect to web service by using Internet Explorer; PS:当我尝试使用Internet Explorer连接到Web服务时; I see firstly some warnings about accepting an unknown certificate and I click take me to web service an I get there clearly. 首先,我看到一些有关接受未知证书的警告,然后单击“将我带到Web服务”,然后清楚地到达了那里。

I want to know what are the basic elements to connect a web service, could you please tell me the requirements that I have to use on my windows project. 我想知道连接Web服务的基本要素是什么,能否请您告诉我我在Windows项目中必须使用的要求。

regards bk 问候bk

This page offers a simple step-by-step guide on building a web service client with C#.NET. 该页面提供了有关使用C#.NET构建Web服务客户端的简单分步指南。

Step 5 on this page shows how to add a certificate to your trusted store and Step 6 is another way to build a very simple web service client in C#.NET. 此页面上的步骤5显示了如何将证书添加到您的信任存储中,而步骤6是在C#.NET中构建非常简单的Web服务客户端的另一种方法。

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

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