473,795 Members | 3,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Consuming Webservice via https

Hi and sorry for the heavy crossposting (fu2 mpdf)!

As you might have gotten out of the subject line, my application tries to
consume a webservice that's being connected to via https. This works fine
when I use a windows forms app. Trying the same from within an asp.net app
fails. As far as I can tell this is due to the lack of an installed client
certificate for the ASPNET windows user account. The certificate I use is
available as X.509 (.cer) and as PKCS #7 (.p7b). On MSDN I read an article
that tells how to install an PKCS #12 certificate (.pfx) into the machines
certificate store.

My question is now: How can I connect to the webservice using the
certificate I got?

Any answer is appreciated.

Regards!
Dec 4 '06 #1
1 11764
You can use something like this:

// Load the client certificate from a file.
X509Certificate x509 = X509Certificate .CreateFromCert File(@"c:\user. cer");

// Add the client certificate to the ClientCertifica tes property of the
proxy class.
webservice.Clie ntCertificates. Add(x509);
Regards,
Catalin
"Jens Mander" wrote:
Hi and sorry for the heavy crossposting (fu2 mpdf)!

As you might have gotten out of the subject line, my application tries to
consume a webservice that's being connected to via https. This works fine
when I use a windows forms app. Trying the same from within an asp.net app
fails. As far as I can tell this is due to the lack of an installed client
certificate for the ASPNET windows user account. The certificate I use is
available as X.509 (.cer) and as PKCS #7 (.p7b). On MSDN I read an article
that tells how to install an PKCS #12 certificate (.pfx) into the machines
certificate store.

My question is now: How can I connect to the webservice using the
certificate I got?

Any answer is appreciated.

Regards!
Dec 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5225
by: mzam | last post by:
Hi everyone, I have a vbscript which is consuming WebMethods from a WebService. Whenever the WebMethod returns a string or integer then no problem but when the WebMethod returns a DataSet then the following error appears: Error: Attachment:Maximum retry on the connection exceeded. HRESULT=0x80004005: Unspecified error - Client:An unanticipated error occurred during the processing of this
0
2887
by: Jessard | last post by:
Hi all, I am trying to consuming a .NET web service from a standard (classic) ASP page. I have come across a few articles which describe that it can be done as follows (after installing the Soap Toolkit 2.0): <html> <head> <title>Calling a webservice from classic ASP, using the SOAP Toolkit</title> <body>
0
1167
by: Srinivas Kotta | last post by:
Hi, I am Trying to get the Array of claases from Webservice which returns an array of classes. that webservice is returned in Java and i am consumin g that webservice in ASP.Net. my problem is i am able to get the data from that webservice but it is limited to 1024 Classes..
0
1307
by: Matthew B. Lehrman | last post by:
I've googled all over the place trying to get answer to this question and some things have come close, but nothing quite. Asp.NET 1.1, Visual Studio 2003 I am writing Visual Basic apps. I can create a windows form that can consume and use the webservice. I can also access the webservice through my browser. But when I create an Asp.NET Web Application and try to consume the webservice, I am able to add the web reference, but when I call any...
7
1804
by: Robbert van Geldrop | last post by:
Hello, I have a problem in a C# client that consumes a webservice which is wrapped by WSE 2.0 sp3: The WebService works fine but very rarely my client comes in a state where every call to the webservice results in a timeout exception. Meanwhile all my other internet traffic passes normally so the problem implicitly exists between my client and the WebService.
2
9186
by: David G | last post by:
My company has a Webservice that is currently running in production. It is secured using SSL and clients are authenticated using X509 certificates. I am able to consume the Webservice methods in a Framework 2.0 c# Forms based application where I instantiate the X509 Certificate by pointing to the certificate file and passing the password: //==================== X509Certificate cert = new X509Certificate(this.tbCertFilePath.Text,...
4
5997
by: Boni | last post by:
I want consuming a webserivce trough a proxy. I use this code. myService s = new myService (); System.Net.WebProxy proxyObject = new System.Net.WebProxy("http://proxyhost:8080"); s.Proxy = proxyObject; It doesn't works, it returns a error HTTP 407: Proxy Authentication Required ( Access is denied. ). But my proxy don't need a user Authentication.
2
2166
by: Jens Mander | last post by:
Hi and sorry for the heavy crossposting (fu2 mpdf)! As you might have gotten out of the subject line, my application tries to consume a webservice that's being connected to via https. This works fine when I use a windows forms app. Trying the same from within an asp.net app fails. As far as I can tell this is due to the lack of an installed client certificate for the ASPNET windows user account. The certificate I use is available as...
3
3274
by: bharadwajrv | last post by:
i'm consuming a Webservice (created in java) in .Net 2003 (in C#)... whenever i invoke the webmethod, i'm getting below error message "Additional information: Client found response content type of 'text/html; charset=ISO-8859-1', but expected 'text/xml'." but when the same webservice is called from SOAPUI (an open source application from www.soapui.org) or XMLSpy - it just works fine... so i'm confused about this, any suggestions??
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10435
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.