.NET Framework Bookmark and Share   
 index > ASMX Web Services and XML Serialization > Add SSL WebService Reference to VS.NET Project
 

Add SSL WebService Reference to VS.NET Project

When i try add web reference to ssl webservice.

the error 403 appear . How can i add reference to SSL webservice ?

the error print screen attached .

Igor Grozman
I'm having the same problem. Did you ever fine a solution?
MCM14
It means you don't have access to that URL. You either need to give it credentials to use or the site itself is blocking your IP.
Peter Ritchie
You are write, I found out the site requires certain parameters to be passed in both the header and as an XML payload. I have since worked around the problem by writing my own proxy classes. But for future reference, is there any way to have VS pass parameters to the service in order to auto-create the proxy class?
MCM14

maxmoore14 wrote:
You are write, I found out the site requires certain parameters to be passed in both the header and as an XML payload. I have since worked around the problem by writing my own proxy classes. But for future reference, is there any way to have VS pass parameters to the service in order to auto-create the proxy class?
It depends on the service; but, if the service adds SOAP header extensions, the generated SoapHttpClientProtocol-based class usually adds a property to enable population of the data for that extension.

For example, if the SOAP header has an extension element of type "headerExtensionType", the generated SoapHttpClientProtocol class should have a property of type "headerExtensionType"--whereheaderExtensionType is a new type in the same namespace/file.

If this is a publicly available service and you post the URL, I can give you details specific to its WSDL...

Peter Ritchie

This problem is Microsoft Known BUG in VS-2003.

but you can used the workaround.

You must download the WSE 2.0 SP1, if you haven’t already (http://www.microsoft.com/downloads/ThankYou.aspx?familyId=dab3ad9f-be8f-42e1-95fe-9aae41a487f3&displayLang=en), and add a reference to Microsoft.Web.Services2 in your project.

and you need change your code by adding mannualy the certificate to Instance of Webservice object, this is a sample code:

using WseX509 = Microsoft.Web.Services2.Security.X509;
 
[...]
 
// Create web service proxy
 Service1.Service1 myProxy = new WSSTest.Service1.Service1();
 
// Open the current user's certificate store
 WseX509.X509CertificateStore store = WseX509.X509CertificateStore.CurrentUserStore(WseX509.X509CertificateStore.MyStore);
 bool open = store.OpenRead();
 
// Find a certificate for the current user
 WseX509.X509CertificateCollection certs = store.FindCertificateBySubjectString("Email@address");
 WseX509.X509Certificate cert = ((WseX509.X509Certificate) certs[0]);
 
// Tell the proxy to send the user's certificate over when calling the web service
 myProxy.ClientCertificates.Add(cert);
 
// Call the web service
 string s = myProxy.HelloWorld();
 MessageBox.Show(s);
 
Igor Grozman

This problem isknown BUG in VS-2003.

but you can used the workaround.

1. On the website change security configuration to to not require certificate.

2. add webreference to your project and change the security configuration on website again to require certificate.

3. You must download the WSE 2.0 SP1, if you haven’t already (http://www.microsoft.com/downloads/ThankYou.aspx?familyId=dab3ad9f-be8f-42e1-95fe-9aae41a487f3&displayLang=en), and add a reference to Microsoft.Web.Services2 in your project.

and you need change your code by adding mannualy the certificate to Instance of Webservice object, this is a sample code:

using WseX509 = Microsoft.Web.Services2.Security.X509;
 
[...]
 
// Create web service proxy
 Service1.Service1 myProxy = new WSSTest.Service1.Service1();
 
// Open the current user's certificate store
 WseX509.X509CertificateStore store = WseX509.X509CertificateStore.CurrentUserStore(WseX509.X509CertificateStore.MyStore);
 bool open = store.OpenRead();
 
// Find a certificate for the current user
 WseX509.X509CertificateCollection certs = store.FindCertificateBySubjectString("Email@address");
 WseX509.X509Certificate cert = ((WseX509.X509Certificate) certs[0]);
 
// Tell the proxy to send the user's certificate over when calling the web service
 myProxy.ClientCertificates.Add(cert);
 
// Call the web service
 string s = myProxy.HelloWorld();
 MessageBox.Show(s);
 
Igor Grozman

This problem isknown BUG in VS-2003.

but you can used the workaround.

1. On the website change security configuration to to not require certificate.

2. add webreference to your project and change the security configuration on website again to require certificate.

3. You must download the WSE 2.0 SP1, if you haven’t already (http://www.microsoft.com/downloads/ThankYou.aspx?familyId=dab3ad9f-be8f-42e1-95fe-9aae41a487f3&displayLang=en), and add a reference to Microsoft.Web.Services2 in your project.

and you need change your code by adding mannualy the certificate to Instance of Webservice object, this is a sample code:

using WseX509 = Microsoft.Web.Services2.Security.X509;
 
[...]
 
// Create web service proxy
 Service1.Service1 myProxy = new WSSTest.Service1.Service1();
 
// Open the current user's certificate store
 WseX509.X509CertificateStore store = WseX509.X509CertificateStore.CurrentUserStore(WseX509.X509CertificateStore.MyStore);
 bool open = store.OpenRead();
 
// Find a certificate for the current user
 WseX509.X509CertificateCollection certs = store.FindCertificateBySubjectString("Email@address");
 WseX509.X509Certificate cert = ((WseX509.X509Certificate) certs[0]);
 
// Tell the proxy to send the user's certificate over when calling the web service
 myProxy.ClientCertificates.Add(cert);
 
// Call the web service
 string s = myProxy.HelloWorld();
 MessageBox.Show(s);
 
Igor Grozman

This problem isknown BUG in VS-2003.

but you can used the workaround.

1. On the website change security configuration to to not require certificate.

2. add webreference to your project and change the security configuration on website again to require certificate.

3. You must download the WSE 2.0 SP1, if you haven’t already (http://www.microsoft.com/downloads/ThankYou.aspx?familyId=dab3ad9f-be8f-42e1-95fe-9aae41a487f3&displayLang=en), and add a reference to Microsoft.Web.Services2 in your project.

and you need change your code by adding mannualy the certificate to Instance of Webservice object, this is a sample code:

using WseX509 = Microsoft.Web.Services2.Security.X509;
 
[...]
 
// Create web service proxy
 Service1.Service1 myProxy = new WSSTest.Service1.Service1();
 
// Open the current user's certificate store
 WseX509.X509CertificateStore store = WseX509.X509CertificateStore.CurrentUserStore(WseX509.X509CertificateStore.MyStore);
 bool open = store.OpenRead();
 
// Find a certificate for the current user
 WseX509.X509CertificateCollection certs = store.FindCertificateBySubjectString("Email@address");
 WseX509.X509Certificate cert = ((WseX509.X509Certificate) certs[0]);
 
// Tell the proxy to send the user's certificate over when calling the web service
 myProxy.ClientCertificates.Add(cert);
 
// Call the web service
 string s = myProxy.HelloWorld();
 MessageBox.Show(s);
 
Igor Grozman

You can use google to search for other answers

Custom Search

More Threads

• PreAuthenticate, 401's, Integrated windows authentication
• MsiExec giving error 1601 - Failed to connect to server 0x80070005 .
• XML Web Service for Windows Authentication
• USB and Webservice.
• Interview Question
• The remote name could not be resolved - .net 2.0 client and http web service
• OnLoad or some initialization for webservices
• Problem Making Requests to a non-.NET Web Service
• Duplicate xsi:type with XmlAnyAttribute
• Web Service and XML produced