* @param soapMessage soap message from which object will be deserialized
*/
public final void deserialize(RMSerializable object, RMProvider provider, SOAPMessage soapMessage)
throws RMException
{
RMSequenceAcknowledgement o = (RMSequenceAcknowledgement)object;
try
{
SOAPHeader soapHeader = soapMessage.getSOAPPart().getEnvelope().getHeader();
RMConstants wsrmConstants = provider.getConstants();
// read required wsrm:SequenceAcknowledgement element
QName sequenceAckQName = wsrmConstants.getSequenceAcknowledgementQName();
SOAPElement sequenceAckElement = getRequiredElement(soapHeader, sequenceAckQName, "soap header");
// read required wsrm:Identifier element
QName identifierQName = wsrmConstants.getIdentifierQName();
SOAPElement identifierElement = getRequiredElement(sequenceAckElement, identifierQName, sequenceAckQName);
String identifier = getRequiredTextContent(identifierElement, identifierQName);
o.setIdentifier(identifier);
// read optional wsrm:Final element
QName finalQName = wsrmConstants.getFinalQName();
SOAPElement finalElement = getOptionalElement(sequenceAckElement, finalQName, sequenceAckQName);
if (finalElement != null)
{
o.setFinal();
}
// read optional wsrm:None element
QName noneQName = wsrmConstants.getNoneQName();
SOAPElement noneElement = getOptionalElement(sequenceAckElement, noneQName, sequenceAckQName);
if (noneElement != null)
{
o.setNone();
}
// read optional wsrm:Nack elements
QName nackQName = wsrmConstants.getNackQName();
List<SOAPElement> nackElements = getOptionalElements(sequenceAckElement, nackQName, sequenceAckQName);
for (SOAPElement nackElement : nackElements)
{
String messageId = getRequiredTextContent(nackElement, nackQName);
o.addNack(stringToLong(messageId, "Unable to parse Nack element text content"));
}
// read optional wsrm:AcknowledgementRange elements
QName ackRangeQName = wsrmConstants.getAcknowledgementRangeQName();
List<SOAPElement> ackRangeElements = getOptionalElements(sequenceAckElement, ackRangeQName, sequenceAckQName);
if (ackRangeElements.size() != 0)
{
QName upperQName = wsrmConstants.getUpperQName();
QName lowerQName = wsrmConstants.getLowerQName();
for (SOAPElement ackRangeElement : ackRangeElements)
{
RMSequenceAcknowledgement.RMAcknowledgementRange ackRange = o.newAcknowledgementRange();
// read required wsrm:Upper attribute
String upper = getRequiredTextContent(ackRangeElement, upperQName, ackRangeQName);
ackRange.setUpper(stringToLong(upper, "Unable to parse Upper attribute text content"));
// read required wsrm:Lower attribute
String lower = getRequiredTextContent(ackRangeElement, lowerQName, ackRangeQName);
ackRange.setLower(stringToLong(lower, "Unable to parse Lower attribute text content"));
// set created acknowledgement range
o.addAcknowledgementRange(ackRange);
}
}
}
catch (SOAPException se)
{