Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2005

Tip: Looking for answers? Try searching our database.

X509 Signing: criticism on code snippet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mr. BogoMips - 13 Oct 2005 17:22 GMT
Hello All,
  I'm attempting to execute a secured webservice over an https connection.
  I followed all the documentation provided with the WSW2.0 sp2 but
unfortunately I get a final error message related to x509 digital signing of
the message.

The Webserivce runs on BEA WebLogic Server 8.1

I would show you the process and the code I've written down to get possibly
suggestions and criticism to point me on the way.

1. I've got the .wsdl and, by wsdl.exe I've generated the proxy class
2. I've changed the superclass to WebServicesClientProtocol
3. I've write the following code:

// BEGIN C# Snippet
X509SecurityToken signatureToken = GetSecurityToken();  // OK
GetDocumentSoapService svc = new GetDocumentSoapService(); // The Proxy

// HTTPS Configuration cut off...

SoapContext requestContext = svc.RequestSoapContext;
requestContext.Security.Tokens.Add(signatureToken);
MessageSignature sig_c = new MessageSignature(signatureToken);
requestContext.Security.Elements.Add(sig_c);
requestContext.Security.Timestamp.TtlInSeconds = 60;
svc.executeTheRemoteMethod("Hello World!");
// END C# Snippet

I receive the following error message:

// BEGIN ERROR MESSAGE
An unhandled exception of type
'System.Web.Services.Protocols.SoapHeaderException' occurred in
system.web.services.dll

Additional information: Could not resolve key for signature
weblogic.xml.security.signature.Signature@4719a8
// END ERROR MESSAGE

Where I'm wrong?

Thanks in advance
Pablo Cibraro - 14 Oct 2005 16:20 GMT
Hi,
You are not specifying what elements should be signed with the signature.
(Signature references).
I recommend you to use a policy file instead of code to describe the
security requeriments for your service.

Regards,
Pablo Cibraro
http://weblogs.asp.net/cibrax

> Hello All,
>   I'm attempting to execute a secured webservice over an https connection.
[quoted text clipped - 41 lines]
>
> Thanks in advance

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.