* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage soapMessage)
throws RMException
{
RMCreateSequence o = (RMCreateSequence)object;
try
{
SOAPBody soapBody = soapMessage.getSOAPPart().getEnvelope().getBody();
RMConstants wsrmConstants = provider.getConstants();
// read required wsrm:CreateSequence element
QName createSequenceQName = wsrmConstants.getCreateSequenceQName();
SOAPElement createSequenceElement = getRequiredElement(soapBody, createSequenceQName, "soap body");
// read required wsrm:AcksTo element
QName acksToQName = wsrmConstants.getAcksToQName();
SOAPElement acksToElement = getRequiredElement(createSequenceElement, acksToQName, createSequenceQName);
QName addressQName = ADDRESSING_CONSTANTS.getAddressQName();
SOAPElement acksToAddressElement = getRequiredElement(acksToElement, addressQName, acksToQName);
String acksToAddress = getRequiredTextContent(acksToAddressElement, addressQName);
o.setAcksTo(acksToAddress);
// read optional wsrm:Expires element
QName expiresQName = wsrmConstants.getExpiresQName();
SOAPElement expiresElement = getOptionalElement(createSequenceElement, expiresQName, createSequenceQName);
if (expiresElement != null)
{
String duration = getRequiredTextContent(expiresElement, expiresQName);
o.setExpires(RMHelper.stringToDuration(duration));
}
// read optional wsrm:Offer element
QName offerQName = wsrmConstants.getOfferQName();
SOAPElement offerElement = getOptionalElement(createSequenceElement, offerQName, createSequenceQName);
if (offerElement != null)
{
RMCreateSequence.RMOffer offer = o.newOffer();
// read required wsrm:Identifier element
QName identifierQName = wsrmConstants.getIdentifierQName();
SOAPElement identifierElement = getRequiredElement(offerElement, identifierQName, offerQName);
String identifier = getRequiredTextContent(identifierElement, identifierQName);
offer.setIdentifier(identifier);
// read optional wsrm:Endpoint element
QName endpointQName = wsrmConstants.getEndpointQName();
SOAPElement endpointElement = getOptionalElement(offerElement, endpointQName, offerQName);
if (endpointElement != null)
{
SOAPElement endpointAddressElement = getRequiredElement(endpointElement, addressQName, endpointQName);
String endpointAddress = getRequiredTextContent(endpointAddressElement, addressQName);
offer.setEndpoint(endpointAddress);
}
// read optional wsrm:Expires element
SOAPElement offerExpiresElement = getOptionalElement(offerElement, expiresQName, offerQName);
if (offerExpiresElement != null)
{
String duration = getRequiredTextContent(offerExpiresElement, expiresQName);
offer.setExpires(duration);
}
// read optional wsrm:IncompleteSequenceBehavior element
QName behaviorQName = wsrmConstants.getIncompleteSequenceBehaviorQName();
SOAPElement behaviorElement = getOptionalElement(offerElement, behaviorQName, offerQName);
if (behaviorElement != null)
{
String behaviorString = getRequiredTextContent(behaviorElement, behaviorQName);
offer.setIncompleteSequenceBehavior(RMIncompleteSequenceBehavior.getValue(behaviorString));
}
// set created offer
o.setOffer(offer);
}
}
catch (SOAPException se)
{
throw new RMException("Unable to deserialize RM message", se);