Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Using ASP.NET to call a web service which requires client side certificate for authentication

$
0
0

Hi,

I have a web service which requires client end certificate authentication. I've installed the cert (pfx format) successfully. I then used IE to launch the URL and it prompted me for certificate, which once selected it can go through and the expected XML response will be shown in the browser.

However, when I use below code to submit the web service call, the response from the server shows: API client certificate not provided or not valid, which should not be the case, since it works through the browser.

Appreciate your help!

Thanks

<%@ Language="VBScript" Debug="true" %>

<%

Dim fso, Output, oHttp, strResult, strSoapReq

fso = CreateObject("Scripting.Filesystemobject")

strSoapReq = fso.OpenTextFile("D:\registration.txt").ReadAll

oHttp = CreateObject("Msxml2.ServerXMLHTTP.6.0")

oHttp.open ("POST", "<url>")

ohttp.setRequestHeader ("Content-Type", "application/json")

ohttp.setOption (3, "<certificate>")

oHttp.send (strSoapReq)

strResult = oHttp.responseText

Output = fso.OpenTextFile("D:\Output.txt", 8, 1)

Output.writeline (strResult)

Output.close

%>


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>