Skip to Content.
Sympa Menu

mace-opensaml-users - marshalling, unmarshalling

Subject: OpenSAML user discussion

List archive

marshalling, unmarshalling


Chronological Thread 
  • From: Jay Packard <>
  • To:
  • Subject: marshalling, unmarshalling
  • Date: Thu, 05 Jun 2008 07:10:51 -0700

SHORT VERSION OF QUESTION: How can I convert from a java.lang.Object to an object that can be unmarshalled and how can I marshall a ResponseType object?

LONG VERSION OF QUESTION: I could use a little guidance on my GUMS Authz XACML service implementation.

I've got the xacml_authz_port_type.wsdl file from the xacml-alpha08 project, which has the following section: / <wsdl:portType name="XACMLAuthorizationPortType">
<wsdl:operation name="Authorize">
<wsdl:input
message="tns:XACMLAuthzDecisionQuery" />
<wsdl:output message="tns:XACMLAuthzResponse" />
<wsdl:fault name="XACMLFault"
message="tns:XACMLAuthorizationFault">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>/

I created Java stubs from the WSDL using wsdl2java, one of which is src/org/globus/www/security/XACMLAuthorization/XACMLAuthorizationPortType.java and has the following content:

/package org.globus.www.security.XACMLAuthorization;

public interface XACMLAuthorizationPortType extends java.rmi.Remote {
public protocol._0._2.SAML.tc.names.oasis.ResponseType
authorize(java.lang.Object xacmlAuthzDecisionQueryObj) throws
java.rmi.RemoteException,
org.globus.www.security.XACMLAuthorization.XACMLAuthorizationFault;
}/

I've written the implementation of this but I don't know how to convert from xacmlAuthzDecisionQueryObj to an object that can be unmarshalled or how to marshall a ResponseType object to return a protocol._0._2.SAML.tc.names.oasis.ResponseType object. Here is what I have so far:

/ import org.opensaml.xacml.ctx.ResponseType;
import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType;
import org.opensaml.xacml.profile.saml.XACMLAuthzDecisionStatementType;
...
/

/ public protocol._0._2.SAML.tc.names.oasis.ResponseType
authorize(java.lang.Object xacmlAuthzDecisionQueryObj) throws
java.rmi.RemoteException,
org.opensciencegrid.authz.xacml.stubs.XACMLAuthorizationFault {
try {
Unmarshaller queryUnmarshaller =
unMarshallerFactory.getUnmarshaller(XACMLAuthzDecisionQueryType.DEFAULT_ELEMENT_NAME_XACML20);
XACMLAuthzDecisionQueryType query =
(XACMLAuthzDecisionQueryType)queryUnmarshaller.unmarshall(/*TODO:
convert xacmlAuthzDecisionQueryObj to Element object???*/);
} catch(UnmarshallingException e) {
log.debug("Error unmarshalling query: ",e);
}

XACMLAuthzDecisionStatementType decision =
mapService.mapCredentials(query);
ResponseType response = decision.getResponse();
try {
Marshaller responseMarshaller =
marshallerFactory.getMarshaller(ResponseType.TYPE_NAME_XACML20);
Document reponseDoc = db.newDocument();
responseMarshaller.marshall(response,
responseDoc);
/*TODO: convert responseDoc to type
protocol._0._2.SAML.tc.names.oasis.ResponseType to be returned*/
} catch (MarshallingException e) {
log.debug("Error marshalling query: ",e);
}
}
/

A few variable declarations are not shown.



Archive powered by MHonArc 2.6.16.

Top of Page