Refine search
public QName getMessagePartQName(String name) { return new QName(this.getOperation().getInterface().getName().getNamespaceURI(), name); }
@Override public void begin(MessagePartInfo part) { // the unwrapped parts build for wrapped operations don't have real elements. if (part.isElement() && !part.getMessageInfo().getOperation().isUnwrapped()) { try { schemaCollection.validateElementName(part.getName(), part.getElementQName()); } catch (InvalidXmlSchemaReferenceException ixsre) { complaints.append(part.getName() + " part element name " + ixsre.getMessage() + "\n"); } } else if (!part.getMessageInfo().getOperation().isUnwrapped()) { if (part.getTypeQName() == null) { complaints.append(part.getName() + " of message " + part.getMessageInfo().getName() + " part type QName null.\n"); } else { try { schemaCollection.validateTypeName(part.getName(), part.getTypeQName()); } catch (InvalidXmlSchemaReferenceException ixsre) { complaints.append(part.getName() + " part type name " + ixsre.getMessage() + "\n"); } } } } }
/** * Returns the n'th message part. * * @param n the n'th part to retrieve. * @return the message part; or <code>null</code> if not found. */ public MessagePartInfo getMessagePart(int n) { if (n == -1) { return null; } for (MessagePartInfo mpi : getMessageParts()) { if (n == 0) { return mpi; } n--; } return null; }
public MessagePartInfo addMessagePart(String name) { return addMessagePart(getMessagePartQName(name)); } /**
if (name.getNamespaceURI() == null || name.getNamespaceURI().isEmpty()) { name = new QName(p.getMessageInfo().getName().getNamespaceURI(), name.getLocalPart()); if (name.equals(p.getConcreteName())) { exchange.put(BindingOperationInfo.class, boi); exchange.setOneWay(op.isOneWay()); return p; if (Constants.XSD_ANYTYPE.equals(p.getTypeQName())) { lastChoice = p; lastBoi = boi;
+ bmsg.getBindingOperation().getName().getLocalPart() + " does not specify a part."); msg.getMessagePart(new QName(msg.getName().getNamespaceURI(), partName)); mpi.setProperty(Message.CONTENT_TYPE, mc.getType()); attParts.add(mpi); && !mpi.getMessageInfo().getName().equals(header.getMessage())) { mpi = null; if (mpi2.getName().getLocalPart().equals(header.getPart()) && mpi2.getMessageInfo().getName().equals(header.getMessage())) { mpi = mpi2;
el.setName(wrapperName.getLocalPart()); wrappedMessage.getFirstMessagePart().setXmlSchema(el); ct.setName(wrapperName.getLocalPart()); el.setSchemaTypeName(wrapperName); ct.setParticle(seq); for (MessagePartInfo mpi : unwrappedMessage.getMessageParts()) { el = new XmlSchemaElement(schema, Boolean.TRUE.equals(mpi.getProperty(HEADER))); Map<Class<?>, Boolean> jaxbAnnoMap = getJaxbAnnoMap(mpi); if (mpi.isElement()) { addImport(schema, mpi.getElementQName().getNamespaceURI()); XmlSchemaUtils.setElementRefName(el, mpi.getElementQName()); } else {
+ msg.getQName().getLocalPart() + " does not specify a name."); QName pqname = new QName(minfo.getName().getNamespaceURI(), part.getName()); MessagePartInfo pi = minfo.getMessagePart(pqname); if (pi != null && pi.getMessageInfo().getName().equals(msg.getQName())) { continue; if (!minfo.getName().equals(msg.getQName())) { pi.setMessageContainer(new MessageInfo(minfo.getOperation(), null, msg.getQName())); pi.setTypeQName(part.getTypeName()); pi.setElement(false); pi.setXmlSchema(schemas.getTypeByQName(part.getTypeName()));
private void buildMessage(AbstractMessageContainer minfo, Message msg) { SchemaCollection schemas = minfo.getOperation().getInterface().getService() .getXmlSchemaCollection(); List<?> orderedParam = msg.getOrderedParts(null); for (Part part : cast(orderedParam, Part.class)) { MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(), part .getName())); if (part.getTypeName() != null) { pi.setTypeQName(part.getTypeName()); pi.setElement(false); pi.setXmlSchema(schemas.getTypeByQName(part.getTypeName())); } else if (part.getElementName() != null) { pi.setElementQName(part.getElementName());
public static void marshallException(Marshaller marshaller, Exception elValue, MessagePartInfo part, Object source) { XMLStreamWriter writer = getStreamWriter(source); QName qn = part.getElementQName(); try { writer.writeStartElement("ns1", qn.getLocalPart(), qn.getNamespaceURI()); Class<?> cls = part.getTypeClass(); XmlAccessType accessType = Utils.getXmlAccessType(cls); String namespace = part.getElementQName().getNamespaceURI(); String attNs = namespace; SchemaInfo sch = part.getMessageInfo().getOperation().getInterface() .getService().getSchema(namespace); if (sch == null) {
protected void buildMessage(Message message, AbstractMessageContainer messageContainer, final Definition def) { addDocumentation(message, messageContainer.getMessageDocumentation()); message.setQName(messageContainer.getName()); message.setUndefined(false); def.addMessage(message); List<MessagePartInfo> messageParts = messageContainer.getMessageParts(); Part messagePart = null; for (MessagePartInfo messagePartInfo : messageParts) { messagePart = def.createPart(); messagePart.setName(messagePartInfo.getName().getLocalPart()); if (messagePartInfo.isElement()) { messagePart.setElementName(messagePartInfo.getElementQName()); addNamespace(messagePartInfo.getElementQName().getNamespaceURI(), def); } else if (messagePartInfo.getTypeQName() != null) { messagePart.setTypeName(messagePartInfo.getTypeQName()); addNamespace(messagePartInfo.getTypeQName().getNamespaceURI(), def); } message.addPart(messagePart); } }
protected void checkForElement(ServiceInfo serviceInfo, MessagePartInfo mpi) { SchemaInfo si = getOrCreateSchema(serviceInfo, mpi.getElementQName().getNamespaceURI(), getQualifyWrapperSchema()); XmlSchemaElement e = si.getSchema().getElementByName(mpi.getElementQName().getLocalPart()); if (e != null) { mpi.setXmlSchema(e); return; } XmlSchema schema = si.getSchema(); si.setElement(null); //cached element is now invalid XmlSchemaElement el = new XmlSchemaElement(schema, true); el.setName(mpi.getElementQName().getLocalPart()); el.setNillable(true); XmlSchemaType tp = (XmlSchemaType)mpi.getXmlSchema(); if (tp == null) { throw new ServiceConstructionException(new Message("INTRACTABLE_PART", LOG, mpi.getName(), mpi.getMessageInfo().getName())); } el.setSchemaTypeName(tp.getQName()); mpi.setXmlSchema(el); }
@Override public void begin(MessagePartInfo part) { if (part.getTypeQName() != null || part.getElementQName() != null) { checkForExistence(part); return; Class<?> clazz = part.getTypeClass(); if (clazz == null) { return; boolean isFromWrapper = part.getMessageInfo().getOperation().isUnwrapped(); boolean isList = false; if (clazz.isArray()) { QName name = (QName)part.getMessageInfo().getProperty("elementName"); part.setElementQName(name); buildExceptionType(part, clazz); && !Boolean.TRUE.equals(part.getMessageInfo().getOperation() .getProperty("operation.force.types")); boolean hasType = !beanInfo.getTypeNames().isEmpty(); if (isElement && isFromWrapper && hasType) { QName name = new QName(beanInfo.getElementNamespaceURI(null), beanInfo.getElementLocalName(null)); XmlSchemaElement el = schemas.getElementByQName(name);
@Override public void begin(MessagePartInfo part) { OperationInfo op = part.getMessageInfo().getOperation(); if (!isFault && !allowWrapperOperations && op.isUnwrappedCapable() && !op.isUnwrapped()) { return; if (part.isElement()) { name = part.getElementQName(); } else { name = part.getTypeQName(); if (part.getMessageInfo() == oInfo.getInput()) { mapping = model.get(op.getInput().getFirstMessagePart().getElementQName()); } else { mapping = model.get(op.getOutput().getFirstMessagePart().getElementQName()); while (i.hasNext()) { JType jt = i.next(); if (jt.name().equalsIgnoreCase(part.getElementQName().getLocalPart())) { jType = jt; part.getMessageInfo().setProperty(Class.class.getName(), createFaultClass(cls)); } catch (Throwable t) {
MessagePartInfo part, boolean unwrap) { Class<?> clazz = part != null ? part.getTypeClass() : null; if (clazz != null && Exception.class.isAssignableFrom(clazz) && part != null && Boolean.TRUE.equals(part.getProperty(JAXBDataBinding.class.getName() + ".CUSTOM_EXCEPTION"))) { return unmarshallException(u, source, part); QName elName = part != null ? part.getConcreteName() : null; if (clazz != null && clazz.isArray() && part != null && part.getXmlSchema() instanceof XmlSchemaElement) { } else if (part.getMessageInfo().getOperation().isUnwrapped() && el.getMaxOccurs() != 1) { } else if (byte[].class == clazz && part != null && part.getTypeQName() != null && "hexBinary".equals(part.getTypeQName().getLocalPart())) {
private void collectWrapperElementInfo() { if (currentOperation.getInput() != null) { inputWrapperPartInfo = currentOperation.getInput().getMessagePart(0); currentOperation.getUnwrappedOperation().getInput().getMessageParts(); String jsParamName = JavascriptUtils.javaScriptNameToken(mpi.getName().getLocalPart()); inputParameterNames.add(jsParamName); inputWrapperPartInfo = currentOperation.getInput().getMessagePart(0); assert inputWrapperPartInfo.isElement(); inputWrapperElement = (XmlSchemaElement)inputWrapperPartInfo.getXmlSchema(); if (inputWrapperElement == null) { inputWrapperElement = } else { unsupportedConstruct("NON_ELEMENT_ANON_TYPE_PART", inputWrapperPartInfo.getMessageInfo().getName(), inputWrapperPartInfo.getName());
if (p.getMessageInfo() != null && p.getMessageInfo().getOperation() != null) { OperationInfo op = p.getMessageInfo().getOperation(); Boolean b = (Boolean)op.getProperty("operation.is.synthetic"); if (b != null) { synth = b; if (p.isElement()) { if (p.getConcreteName() != null && !elName.equals(p.getConcreteName()) && !synth) { throw new Fault("UNEXPECTED_ELEMENT", LOG, null, elName, if (!(elName.equals(p.getName()) || elName.equals(p.getConcreteName())) && !synth) { throw new Fault("UNEXPECTED_ELEMENT", LOG, null, elName,
private JavaReturn getReturnFromQName(QName element, MessagePartInfo part) { String fullJavaName = ""; String simpleJavaName = ""; fullJavaName = this.dataBinding.getWrappedElementType(part.getElementQName(), element); simpleJavaName = fullJavaName; int index = fullJavaName.lastIndexOf("."); if (index > -1) { simpleJavaName = fullJavaName.substring(index); } String targetNamespace = ""; if (isHeader(part)) { targetNamespace = part.getMessageInfo().getOperation().getInterface(). getService().getTargetNamespace(); } else { targetNamespace = element.getNamespaceURI(); } String jpname = ProcessorUtil.mangleNameToVariableName(simpleJavaName); JavaReturn returnType = new JavaReturn(jpname, fullJavaName, targetNamespace); returnType.setDefaultValueWriter( ProcessorUtil.getDefaultValueWriterForWrappedElement(part, context, element)); returnType.setQName(element); returnType.setStyle(JavaType.Style.OUT); return returnType; }
@Override public void begin(MessagePartInfo part) { LOG.finest(part.getName().toString()); // Check to see if the WSDL information has been filled in for us. if (part.getTypeQName() != null || part.getElementQName() != null) { checkForExistence(part); return; } Class<?> clazz = part.getTypeClass(); if (clazz == null) { return; } boolean isFromWrapper = part.getMessageInfo().getOperation().isUnwrapped(); if (isFromWrapper && clazz.isArray() && !Byte.TYPE.equals(clazz.getComponentType())) { clazz = clazz.getComponentType(); } mapClass(part, clazz); } private void mapClass(MessagePartInfo part, Class<?> clazz) {
rawClass = c; type = c; part.getMessageInfo().setProperty("parameterized", Boolean.TRUE); part.setProperty(GENERIC_TYPE, type); part.setProperty(RAW_CLASS, rawClass); part.setTypeClass(rawClass); if (part.getMessageInfo().getOperation().isUnwrapped() && Boolean.TRUE.equals(part.getProperty(HEADER))) { OperationInfo o = ((UnwrappedOperationInfo)part.getMessageInfo().getOperation()) .getWrappedOperation(); if (Boolean.TRUE.equals(part.getProperty(ReflectionServiceFactoryBean.MODE_OUT)) || Boolean.TRUE.equals(part.getProperty(ReflectionServiceFactoryBean.MODE_INOUT))) { MessagePartInfo mpi = o.getOutput().getMessagePart(part.getName()); if (mpi != null) { mpi.setTypeClass(rawClass); if (!Boolean.TRUE.equals(part.getProperty(ReflectionServiceFactoryBean.MODE_OUT))) { MessagePartInfo mpi = o.getInput().getMessagePart(part.getName()); if (mpi != null) { mpi.setTypeClass(rawClass);