}
public OMElement createSoapFault(Element message, QName faultName, Operation op) throws AxisFault {
if (faultName.getNamespaceURI() == null || !faultName.getNamespaceURI().equals(_def.getTargetNamespace()))
throw new OdeFault(__msgs.msgUndefinedFault(_serviceName, _portName, op.getName(), faultName));
Fault f = op.getFault(faultName.getLocalPart());
if (f == null)
throw new OdeFault(__msgs.msgUndefinedFault(_serviceName, _portName, op.getName(), faultName));
// For faults, there will be exactly one part.
Part p = (Part)f.getMessage().getParts().values().iterator().next();
Element partEl= DOMUtils.getFirstChildElement(DOMUtils.findChildByName(message,new QName(null,p.getName())));
if (partEl == null)
throw new OdeFault(__msgs.msgOdeMessageMissingRequiredPart(p.getName()));
if (p == null)
throw new OdeFault(new IllegalStateException("fault part is non-element" + p.getName()));
Element detail = DOMUtils.findChildByName(partEl, p.getElementName());
if (detail == null)
throw new OdeFault(__msgs.msgOdeMessagePartMissingRequiredElement(_serviceName, _portName, op.getName(), p.getElementName()));
return OMUtils.toOM(detail, _soapFactory);
}