public class WSFMessage extends Object
| Modifier and Type | Field and Description |
|---|---|
private String |
actionString
This is the action that the message is intended to perform
|
protected static org.opensaml.core.xml.XMLObjectBuilderFactory |
builderFactory
XMLObject builder factory.
|
private static boolean |
debugJustSOAPBody
If true, only the SOAP body is printed during a logger debug session
|
private boolean |
endpointUpdated
When an EndpointUpdate header is received and processed, this is set to true
|
private org.opensaml.soap.soap11.Envelope |
envelope
SOAP Request
|
protected static Logger |
log |
protected static org.opensaml.core.xml.io.MarshallerFactory |
marshallerFactory
XMLObject marshaller factory.
|
protected static net.shibboleth.utilities.java.support.xml.BasicParserPool |
parser
Parser manager used to parse XML.
|
private RedirectRequest |
redirectRequest
If the SOAP Response contains a Fault with a RedirectRequest element, it is stored here.
|
private String |
response
Response String
|
private org.opensaml.soap.soap11.Envelope |
responseEnvelope
SOAP Response
|
private BaseServiceClient |
serviceClient
This is the Service Client that is invoking a particular WSFMessage.
|
private List<String> |
signatureIds
Holds the reference IDs of the elements to be included in any signature
|
protected static org.opensaml.core.xml.io.UnmarshallerFactory |
unmarshallerFactory
XMLObject marshaller factory.
|
| Modifier | Constructor and Description |
|---|---|
private |
WSFMessage(BaseServiceClient serviceClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSOAP11Attributes(org.opensaml.core.xml.AttributeExtensibleXMLObject obj,
boolean mustUnderstand) |
void |
addWSUIdAttribute(org.opensaml.core.xml.AttributeExtensibleXMLObject obj,
String id)
This method adds an id to an AttributeExtensibleXMLObject and
then places that Id in signatureIds for signing
|
static org.opensaml.soap.soap11.Envelope |
buildSOAPEnvelope()
This method creates the Basic SOAP Envelope
|
static WSFMessage |
createWSFMessage(BaseServiceClient serviceClient,
String actionString)
Factory method to create a WSFMessage from an EPR.
|
static boolean |
getDebugJustSOAPBody() |
org.opensaml.soap.soap11.Envelope |
getRequestEnvelope() |
org.opensaml.soap.soap11.Envelope |
getResponseEnvelope() |
String |
getResponseString() |
protected BaseServiceClient |
getServiceClient() |
List<String> |
getSignatureIds()
Holds the reference ids of the SOAP Body element (the element itself), the security token associated
with the signature, and all headers in the message that have been defined in the Liberty SOAP Bindings specification,
including both required and optional header blocks.
|
private void |
handleEndpointUpdatedState()
After an EndpointUpdate, the original message is invoked again, with a
different EPR
|
private boolean |
handleInappropriateCredentials()
Handles the InappropriateCredentials Fault.
|
private void |
handleRedirectRequestState()
If the WSC resends its request it MUST set the value of the wsa:RelatesTo SOAP Header to the same value of the
wsa:MessageID SOAP Header of the SOAP Fault that carried the <RedirectRequest> element.
|
boolean |
hasRedirectRequestBeenIssued()
The RedirectRequest element instructs the WSC to redirect the user to the WSP.
|
boolean |
hasUpdatedEndpointReference()
This boolean indicates that there is an updated endpoint reference that needs to be processed
by the service client.
|
private void |
initializeRequestEnvelope()
The WSFMessage class contains a global Envelope that is used for making a request,
this method initializes the global request envelope including adding the security
token from the message EPR
|
void |
invoke()
Invoke the WSFMessage sending the SOAP requestEvelope and placing the response in the responseEnvelope.
|
static String |
prettyPrintRequestMessage(WSFMessage message)
Prints a nice looking output of the request message
|
static String |
prettyPrintResponseMessage(WSFMessage message)
Prints a nice looking output of the response message
|
private boolean |
processEndpointUpdated()
This method handles the creation of a new
EndpointReference from an EndpointUpdate element. |
private void |
processResponse(String responseString)
This method will take care of all of the responsibilities required of a WSC when receiving
a response from a WSP.
|
static void |
setDebugJustSOAPBody(boolean _debugJustSOAPBody) |
void |
setHeaderProcessingContext(ProcessingContext processingContext)
Adds this ProcessingContext to the header or replaces an
existing ProcessingContext with this one
|
void |
setRequestEnvelope(org.opensaml.soap.soap11.Envelope envelope) |
void |
setResponseEnvelope(org.opensaml.soap.soap11.Envelope envelope) |
protected void |
setServiceClient(BaseServiceClient serviceClient) |
protected static Logger log
protected static net.shibboleth.utilities.java.support.xml.BasicParserPool parser
protected static org.opensaml.core.xml.io.MarshallerFactory marshallerFactory
protected static org.opensaml.core.xml.io.UnmarshallerFactory unmarshallerFactory
protected static org.opensaml.core.xml.XMLObjectBuilderFactory builderFactory
private BaseServiceClient serviceClient
private org.opensaml.soap.soap11.Envelope envelope
private String response
private org.opensaml.soap.soap11.Envelope responseEnvelope
private String actionString
private List<String> signatureIds
private RedirectRequest redirectRequest
private boolean endpointUpdated
private static boolean debugJustSOAPBody
private WSFMessage(BaseServiceClient serviceClient)
public void addWSUIdAttribute(org.opensaml.core.xml.AttributeExtensibleXMLObject obj,
String id)
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
<xsd:attribute name="Id" type="xsd:ID">
<xsd:annotation>
<xsd:documentation>
This global attribute supports annotating arbitrary elements with an ID.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
public void addSOAP11Attributes(org.opensaml.core.xml.AttributeExtensibleXMLObject obj,
boolean mustUnderstand)
public static WSFMessage createWSFMessage(BaseServiceClient serviceClient, String actionString) throws net.shibboleth.utilities.java.support.xml.XMLParserException, org.opensaml.core.xml.io.UnmarshallingException
org.opensaml.core.xml.io.UnmarshallingExceptionnet.shibboleth.utilities.java.support.xml.XMLParserExceptionpublic static void setDebugJustSOAPBody(boolean _debugJustSOAPBody)
public static boolean getDebugJustSOAPBody()
private void initializeRequestEnvelope()
throws net.shibboleth.utilities.java.support.xml.XMLParserException,
org.opensaml.core.xml.io.UnmarshallingException
net.shibboleth.utilities.java.support.xml.XMLParserExceptionorg.opensaml.core.xml.io.UnmarshallingExceptionpublic List<String> getSignatureIds()
protected BaseServiceClient getServiceClient()
protected void setServiceClient(BaseServiceClient serviceClient)
public void setHeaderProcessingContext(ProcessingContext processingContext)
processingContext - public void invoke()
throws IOException,
org.opensaml.core.xml.io.MarshallingException,
net.shibboleth.utilities.java.support.xml.XMLParserException,
org.opensaml.core.xml.io.UnmarshallingException,
WSCException,
GeneralSecurityException
IOExceptionorg.opensaml.core.xml.io.MarshallingExceptionnet.shibboleth.utilities.java.support.xml.XMLParserExceptionorg.opensaml.core.xml.io.UnmarshallingExceptionWSCExceptionGeneralSecurityExceptionprivate void processResponse(String responseString) throws net.shibboleth.utilities.java.support.xml.XMLParserException, org.opensaml.core.xml.io.UnmarshallingException, WSCException, IOException, org.opensaml.core.xml.io.MarshallingException, GeneralSecurityException
e.g. Fault:
<se:Fault xmlns:sb-ext="urn:liberty:sb:2004-04">
<faultcode>se:Client</faultcode>
<faultstring>soap fault</faultstring>
<detail namespace="urn:liberty:sb:2003-08">
<lu:Status xmlns:lu="urn:liberty:util:2006-08" code="IDStarMsgNotUnderstood"/>
</detail>
</se:Fault>
responseString - net.shibboleth.utilities.java.support.xml.XMLParserExceptionorg.opensaml.core.xml.io.UnmarshallingExceptionWSCExceptionorg.opensaml.core.xml.io.MarshallingExceptionIOExceptionGeneralSecurityExceptionprivate boolean handleInappropriateCredentials()
In the case of a Fault with a Status code "InappropriateCredentials" this method examines the CredentialsContext header and attempts to renegotiate with the DS for a more appropriate SecurityMechanism or reauthenticate with the AS in the case of a RequestedAuthnContext element being present in the CredentialsContext header.
private boolean processEndpointUpdated()
EndpointReference from an EndpointUpdate element.
For a COMPLETE Update:
If updateType is not present or has the value urn:liberty:sb:2006-08:EndpointUpdate:Complete, the <wsa:EndpointUpdate> is a completely specified endpoint reference.
For a PARTIAL Update:
1. Take the <wsa:Address> from the <wsa:EndpointUpdate>. If the value is urn:liberty:sb:2006-08:EndpointUpdate:NoChange, then take the <wsa:Address> from the original endpoint reference.
2. Take the <wsa:ReferenceParameters> from the <wsa:EndpointUpdate>, if present. Then, if <wsa:ReferenceParameters> is present in the orginal endpoint reference, take each direct child from that element that does not match an element already taken from the update (comparing the namespace qualified names of the elements).
3. Take the <wsa:Metadata> from the <wsa:EndpointUpdate>, if present. Then, if <wsa:Metadata> is present in the orginal endpoint reference, take each direct child from that element that does not match an element already taken from the update (comparing the namespace qualified names of the elements).
4. Take any extension elements from the <wsa:EndpointUpdate>, if present. Then, if any extension elements are present in the orginal endpoint reference, take each one that does not match * @return
private void handleEndpointUpdatedState()
throws net.shibboleth.utilities.java.support.xml.XMLParserException,
org.opensaml.core.xml.io.UnmarshallingException
org.opensaml.core.xml.io.UnmarshallingExceptionnet.shibboleth.utilities.java.support.xml.XMLParserExceptionprivate void handleRedirectRequestState()
throws net.shibboleth.utilities.java.support.xml.XMLParserException,
org.opensaml.core.xml.io.UnmarshallingException
(From Section 7 [LibertySOAPBinding] document http://www.projectliberty.org/specs )
org.opensaml.core.xml.io.UnmarshallingExceptionnet.shibboleth.utilities.java.support.xml.XMLParserExceptionpublic static String prettyPrintRequestMessage(WSFMessage message)
message - public static String prettyPrintResponseMessage(WSFMessage message)
message - public static org.opensaml.soap.soap11.Envelope buildSOAPEnvelope()
throws net.shibboleth.utilities.java.support.xml.XMLParserException,
org.opensaml.core.xml.io.UnmarshallingException
Read in a SOAP Envelope and unmarshall it Currently being built by reading in SOAP template file (is) This may ultimately be built from scratch to improve performance
is - net.shibboleth.utilities.java.support.xml.XMLParserExceptionorg.opensaml.core.xml.io.UnmarshallingExceptionpublic org.opensaml.soap.soap11.Envelope getRequestEnvelope()
public void setRequestEnvelope(org.opensaml.soap.soap11.Envelope envelope)
public org.opensaml.soap.soap11.Envelope getResponseEnvelope()
public void setResponseEnvelope(org.opensaml.soap.soap11.Envelope envelope)
public String getResponseString()
public boolean hasRedirectRequestBeenIssued()
public boolean hasUpdatedEndpointReference()
Copyright © 1999–2015. All rights reserved.