* @param soapMessage soap message from which object will be deserialized
*/
public final void serialize(RMSerializable object, RMProvider provider, SOAPMessage soapMessage)
throws RMException
{
RMSequenceFault o = (RMSequenceFault)object;
try
{
SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
boolean isSoap11 = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(soapEnvelope.getElementQName().getNamespaceURI());
if (false == isSoap11)
{
throw new NotImplementedException("TODO: implement SOAP 12 serialization");
}
RMConstants wsrmConstants = provider.getConstants();
// Add xmlns:wsrm declaration
soapEnvelope.addNamespaceDeclaration(wsrmConstants.getPrefix(), wsrmConstants.getNamespaceURI());
// write required wsrm:SequenceFault element
QName sequenceFaultQName = wsrmConstants.getSequenceFaultQName();
SOAPElement sequenceFaultElement = soapEnvelope.getHeader().addChildElement(sequenceFaultQName);
// write required wsrm:FaultCode element
RMFault rmFault = (RMFault)o.getDetail();
QName faultCodeQName = wsrmConstants.getFaultCodeQName();
String subcode = wsrmConstants.getPrefix() + ":" + rmFault.getFaultCode().getSubcode().getValue();
sequenceFaultElement.addChildElement(faultCodeQName).setValue(subcode);
Map<String, Object> details = rmFault.getDetails();