private MessagePartInfo getFaultMessagePart(QName qname, OperationInfo op) { for (FaultInfo faultInfo : op.getFaults()) { for (MessagePartInfo mpi : faultInfo.getMessageParts()) { String ns = null; if (mpi.isElement()) { ns = mpi.getElementQName().getNamespaceURI(); } else { ns = mpi.getTypeQName().getNamespaceURI(); } if (qname.getLocalPart().equals(mpi.getConcreteName().getLocalPart()) && qname.getNamespaceURI().equals(ns)) { return mpi; } } } return null; }
private void validateFaultDetail(Element detail, Schema schema, BindingOperationInfo bop) throws Exception { if (detail != null) { Element el = DOMUtils.getFirstElement(detail); while (el != null) { QName qn = DOMUtils.getElementQName(el); for (BindingFaultInfo bfi : bop.getFaults()) { if (bfi.getFaultInfo().getMessagePartByIndex(0).getConcreteName().equals(qn)) { //Found a fault with the correct QName, we can validate it schema.newValidator().validate(new DOMSource(DOMUtils.getDomElement(el))); } } el = DOMUtils.getNextElement(el); } } } private void validateFault(SoapMessage message, SOAPFault fault, BindingOperationInfo bop) {
String partName = mpi.getConcreteName().getLocalPart(); String ct = (String) mpi.getProperty(Message.CONTENT_TYPE);
String partName = mpi.getConcreteName().getLocalPart();
public static QName getElementName(MessagePartInfo part) { return part == null ? null : part.getConcreteName(); }
MessagePartInfo mpi = null; for (MessagePartInfo mpi2 : wrappedMessageInfo.getMessageParts()) { if (mpi2.getConcreteName().equals(part.getConcreteName())) { mpi = mpi2;
public static String getPartType(MessagePartInfo part) { return part.getConcreteName().getLocalPart(); }
public static String resolvePartNamespace(MessagePartInfo part) { return part.getConcreteName().getNamespaceURI(); }
av0.visit("name", name); if (Boolean.TRUE.equals(factory.isWrapperPartQualified(mpi))) { av0.visit("namespace", mpi.getConcreteName().getNamespaceURI());
@Override public String toString() { return new StringBuilder().append("[MessagePartInfo name=") .append(getName()) .append(", ConcreteName=") .append(getConcreteName()).toString(); }
@Override public String toString() { return new StringBuilder().append("[MessagePartInfo name=") .append(getName()) .append(", ConcreteName=") .append(getConcreteName()).toString(); }
private Header findHeader(SoapMessage message, MessagePartInfo mpi) { return message.getHeader(mpi.getConcreteName()); } }
@Override public String toString() { return new StringBuilder().append("[MessagePartInfo name=") .append(getName()) .append(", ConcreteName=") .append(getConcreteName()).toString(); }
@Override public String toString() { return new StringBuilder().append("[MessagePartInfo name=") .append(getName()) .append(", ConcreteName=") .append(getConcreteName()).toString(); }
private Header findHeader(SoapMessage message, MessagePartInfo mpi) { return message.getHeader(mpi.getConcreteName()); } }
private static boolean matchFault(Throwable t, FaultInfo fi) { //REVISIT not sure if this class-based comparison works in general as the fault class defined // in the service interface has no direct relationship to the message body's type. MessagePartInfo fmpi = fi.getFirstMessagePart(); Class<?> fiTypeClass = fmpi.getTypeClass(); if (fiTypeClass != null && t.getClass().isAssignableFrom(fiTypeClass)) { return true; } // CXF-6575 QName fiName = fmpi.getConcreteName(); WebFault wf = t.getClass().getAnnotation(WebFault.class); return wf != null && fiName != null && wf.targetNamespace() != null && wf.targetNamespace().equals(fiName.getNamespaceURI()) && wf.name() != null && wf.name().equals(fiName.getLocalPart()); }
private static boolean matchFault(Throwable t, FaultInfo fi) { //REVISIT not sure if this class-based comparison works in general as the fault class defined // in the service interface has no direct relationship to the message body's type. MessagePartInfo fmpi = fi.getFirstMessagePart(); Class<?> fiTypeClass = fmpi.getTypeClass(); if (fiTypeClass != null && t.getClass().isAssignableFrom(fiTypeClass)) { return true; } // CXF-6575 QName fiName = fmpi.getConcreteName(); WebFault wf = t.getClass().getAnnotation(WebFault.class); return wf != null && fiName != null && wf.targetNamespace() != null && wf.targetNamespace().equals(fiName.getNamespaceURI()) && wf.name() != null && wf.name().equals(fiName.getLocalPart()); }
private void validateFaultDetail(Element detail, Schema schema, BindingOperationInfo bop) throws Exception { if (detail != null) { Element el = DOMUtils.getFirstElement(detail); while (el != null) { QName qn = DOMUtils.getElementQName(el); for (BindingFaultInfo bfi : bop.getFaults()) { if (bfi.getFaultInfo().getMessagePartByIndex(0).getConcreteName().equals(qn)) { //Found a fault with the correct QName, we can validate it schema.newValidator().validate(new DOMSource(DOMUtils.getDomElement(el))); } } el = DOMUtils.getNextElement(el); } } } private void validateFault(SoapMessage message, SOAPFault fault, BindingOperationInfo bop) {
public Object read(MessagePartInfo part, XMLStreamReader input) { try { AegisType type = part.getProperty("org.apache.cxf.aegis.outerType", AegisType.class); if (type == null) { type = databinding.getType(part); return reader.read(input, type); } ArrayType arrayType = (ArrayType) type; return reader.readFlatArray(input, arrayType, part.getConcreteName()); } catch (Exception e) { throw new Fault(e); } }
public Object read(MessagePartInfo part, XMLStreamReader input) { try { AegisType type = part.getProperty("org.apache.cxf.aegis.outerType", AegisType.class); if (type == null) { type = databinding.getType(part); return reader.read(input, type); } ArrayType arrayType = (ArrayType) type; return reader.readFlatArray(input, arrayType, part.getConcreteName()); } catch (Exception e) { throw new Fault(e); } }