Hi all,
I'm developing an asp.net app that connect to a webservice.
- I've installed an P7k certificate in the IIS-website configuration.
When running my code, I have following error:
System.Web.Services.Protocols.SoapHeaderException:
com.sun.xml.wss.XWSSecurityException: Message does not conform to configured
policy [ SignaturePolicy(P) TimestampPolicy(S) ]: No Security Header found;
nested exception is com.sun.xml.wss.XWSSecurityException:
com.sun.xml.wss.XWSSecurityException: Message does not conform to configured
policy [ SignaturePolicy(P) TimestampPolicy(S) ]: No Security Header found
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall) at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
My guess is that I need to insert a SOAP header in my code.
After googleing for 2 days, I see a lot of answers about WSE 3.0. Other
posts are saying this is not working with VS2008...
When using the SOAPUI.org app, it all works fine:
- import certificate
- in signature configuration: insert the password from certificate, key
identifier type: binary security token, single certificate: checked and the
added 2 parts: Body and Timestamp with there namespace urls and
encode=element.
Someone with a suggestion?
Thanks a lot!
my code:
Dim ws As New TESTwebservice.Service
Dim request As New TESTwebservice.bRequest
Dim response As New TESTwebservice.bResponse
Try
Dim x509cert As X509Certificate =
X509Certificate.CreateFromCertFile("c:\cert\theCer tificate.der")
ws.ClientCertificates.Add(x509cert)
ws.Url = "URL REMOVED"
response = ws.check(request)
Label1.Text = response.Items.ToString
Catch ex As Exception
Label1.Text = ex.ToString
End Try