WSDL SOAP在VB.NET应用程序中使用SSL [英] WSDL SOAP using SSL in VB.NET application

查看:150
本文介绍了WSDL SOAP在VB.NET应用程序中使用SSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在vb.net应用程序中使用SSL的WSDL SOAP新手,无法集成。



我尝试过:



我是WSDL和soap的新手,我需要集成一个设备,我们提供了一个WSDL文件和一个.jks文件,我认为它是SSL证书。我已成功引用了WSDL,但之后我不知道该怎么做,特别是在哪里放置设备的IP地址和端口等等。如何使用SSL发送?



任何帮助都将非常感谢。



谢谢

new to WSDL SOAP using SSL in vb.net Application, having trouble integrating.

What I have tried:

Hi, I am new to WSDL and soap, I need to integrate a device, we were provided a WSDL file and a .jks file which I think is for SSL certificate. I have successfully referenced the WSDL, but after that I don't have any idea what to do especially like where do I put the IP address and port of the device and all. How do I send it using SSL?

Any help would be very much appreciated.

Thanks

推荐答案

首先......我不认为.NET可以将jks文件作为证书来源处理......你需要pfx文件......

请在此处查看一个选项如何在两者之间进行转换或将设备供应商连接到一个... 从JKS / JAVA密钥库创建PKCS12(.pfx / .p12) [ ^ ]



至于WSDL ......当你引用 [ ^ ] VS使用您分配给引用的名称创建了一个包装类...

使用该类名称可以创建一个对象t并调用Web服务器的所有公开方法...

First of all...I do not think .NET can handle jks files as source of certificate... you need pfx files...
See here one options how to convert between the two or connect the device vendor for one... Create a PKCS12 (.pfx / .p12) from a JKS / JAVA keystore[^]

As for the WSDL...The moment you referenced[^] VS created a wrapper class using the name you assigned to the reference...
Using that class name you can create an object and call all the exposed methods of the web server...
WebReference service = new WebReference();

X509Certificate2 cert = new X509Certificate2();
cert.Import("client_cert.pfx", "[the password]", DefaultKeySet);

service.Url = "[the actual server address]";

service.ClientCertificates.Add(cert);

service.Method();





(对不起。刚刚意识到你要求VB.NET ..区别仅在于语言语法......)





根据你的意见...

您可以通过两种方式引用WSDL:Web引用(较旧)和服务引用(较新)...在每种情况下,有不同的方法来设置目标地址...

对于Web引用:



(Sorry. Just realized you asked for VB.NET... The difference is only in the language syntax...)


According to your comments...
You can reference a WSDL in two ways: Web Reference (older) and Service Reference (newer)... In each case there are different ways to set the target address...
For Web Reference:

WebReference.OSAccessService oA = new WebReference.OSAccessService( );
oA.Url = "address-goes-here";



服务参考:


For Service Reference:

ServiceReference.OSAccessClient oB = new ServiceReference.OSAccessClient( );
oB.Endpoint.Address = new System.ServiceModel.EndpointAddress( "address-goes-here" );


这篇关于WSDL SOAP在VB.NET应用程序中使用SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆