Answered by:
Web service Client

Question
-
User1374267567 posted
I have been asked to create a web service client and i am provided with WSDL link, .cert and .pfx files. I haven't done any coding using certificate.
Can you please suggest how to use the certificate and pfx file and create a client?
Monday, May 20, 2013 5:03 PM
Answers
-
User-1000095884 posted
Hi,
You can utilize the WSDL file to create a WCF service, or consume the service by inputing full path + WSDL file name in "Add Service Reference" dialog box in Visual Studio. Here are some references.
#How to use a WSDL file to create a WCF service (not make a call)
#How can I consume a WCF service using a local WSDL file?
http://stackoverflow.com/questions/1483178/how-can-i-consume-a-wcf-service-using-a-local-wsdl-file
You can refer the steps to install the certificate and use the certificate for the service in blogs below.
#Securing WCF Services with Certificates
http://www.codeproject.com/Articles/28248/Securing-WCF-Services-with-Certificates
Best Regards.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, May 22, 2013 2:31 AM -
User-1623675128 posted
Hi Shiva,
we had similar prject couple of years ago and we did it in VB.NET here piece of code that may help u out.
Dim Pcertifacate As New X509Certificate2(CertFilePath, sPwd) -- pass here certificate and password (you should get pwd from the other team who owns Service)
WS.ClientCertificates.Add(Pcertifacate ) -- Add here cert to Proxy
WS.Url = Url -- Add the web service URL
WS.Timeout = 60000
WS.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11
System.Net.ServicePointManager.CertificatePolicy = New TrustAllCertificatePolicy()
WS.Web_MethodXXX(input_ar,Par)amters xxx)
for this u need to have following namesapces to havecertifcates and seurity etc.
Imports System.Net.ServicePoint
Imports System.Security
Imports System.Security.Cryptography.X509Certificates
Imports System.Security.Cryptographye
hope this helps!
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, May 23, 2013 11:08 AM
All replies
-
User-1000095884 posted
Hi,
You can utilize the WSDL file to create a WCF service, or consume the service by inputing full path + WSDL file name in "Add Service Reference" dialog box in Visual Studio. Here are some references.
#How to use a WSDL file to create a WCF service (not make a call)
#How can I consume a WCF service using a local WSDL file?
http://stackoverflow.com/questions/1483178/how-can-i-consume-a-wcf-service-using-a-local-wsdl-file
You can refer the steps to install the certificate and use the certificate for the service in blogs below.
#Securing WCF Services with Certificates
http://www.codeproject.com/Articles/28248/Securing-WCF-Services-with-Certificates
Best Regards.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, May 22, 2013 2:31 AM -
User-1623675128 posted
Hi Shiva,
we had similar prject couple of years ago and we did it in VB.NET here piece of code that may help u out.
Dim Pcertifacate As New X509Certificate2(CertFilePath, sPwd) -- pass here certificate and password (you should get pwd from the other team who owns Service)
WS.ClientCertificates.Add(Pcertifacate ) -- Add here cert to Proxy
WS.Url = Url -- Add the web service URL
WS.Timeout = 60000
WS.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11
System.Net.ServicePointManager.CertificatePolicy = New TrustAllCertificatePolicy()
WS.Web_MethodXXX(input_ar,Par)amters xxx)
for this u need to have following namesapces to havecertifcates and seurity etc.
Imports System.Net.ServicePoint
Imports System.Security
Imports System.Security.Cryptography.X509Certificates
Imports System.Security.Cryptographye
hope this helps!
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, May 23, 2013 11:08 AM