Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] SAML assertion JAXB Error

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] SAML assertion JAXB Error


Chronological Thread 
  • From: "Stepan Hrbacek" <>
  • To:
  • Subject: Re: [OpenSAML] SAML assertion JAXB Error
  • Date: Fri, 19 Dec 2008 14:33:51 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=P8TdZjnJQxXG0qhm2ZrOCcXTltPD+nR/rm0Th7RaHzcX/5+w2cvtwG3Bd9Xttzgy2E T0NV0NTqwWmRKScIH+8umRidcY1wazG3RRTudJcbgQDHsnO+XvxUmbDpPp6IOZGdeqE3 0nBR8k++ivKcRe/8cm5T3j4a84OkVc+aBwA5U=

Hi Rick,

I don't have a direct answer to your issue (BTW it's not clear from the code sniplet where the exception occurs and a stacktrace would be helpful).

However - in our project we use OpenSAML in web services scenarios (involving WS-Security, WS-Trust) and using Metro as a SOAP/WS-Security/WS-Trust stack and have not problems at all. I am not sure what your use case is, but from your code I think it's something similar.

Following METRO pages provide you with necessary information on how to use METRO:
- https://metro.dev.java.net/
- https://metro.dev.java.net/getting-started/
- https://metro.dev.java.net/guide/

--Stepan


2008/12/19 <>
Hi,

I have been working on a research project that use SAML v2. Currently, I have created a simple SAML assertion using openSAML and try to bind the SAML assertion into a SOAP header. However, an error occured states that:

>> org.w3c.dom.Element is an interface, and JAXB can't handle interfaces.

I am using Glassfish v2 to build my web service and JAXB for XML binding. My SOAP and Marshal code is below:

//Create a SOAP Message
SOAPMessage message = smc.getMessage();
SOAPPart soapPart = message.getSOAPPart();
SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
Name wsseHeaderName = soapEnvelope.createName("Security",
                       "wsse", WS_SECURITY_NS_URI);
if (soapEnvelope.getHeader() == null) {
      soapEnvelope.addHeader();
}
SOAPHeaderElement securityElement = soapEnvelope.getHeader().addHeaderElement(wsseHeaderName);


 // marshall Assertion into SOAP Header
               MarshallerFactory marshallerFactory = Configuration.getMarshallerFactory();
               Marshaller marshaller = marshallerFactory.getMarshaller(assertion);
               Element assertionElement = marshaller.marshall(assertion);
               securityElement.appendChild(soapPart.importNode(
                       assertionElement, true));

Does anybody has an idea on how to solve this problem? Any help will be highly appreciated.

Thanks,

Rick




Archive powered by MHonArc 2.6.16.

Top of Page