use of com.sun.xml.ws.api.model.wsdl.WSDLDescriptorKind in project metro-jax-ws by eclipse-ee4j.
the class RuntimeWSDLParser method parseMessage.
private void parseMessage(XMLStreamReader reader) {
String msgName = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
EditableWSDLMessage msg = new WSDLMessageImpl(reader, new QName(targetNamespace, msgName));
extensionFacade.messageAttributes(msg, reader);
int partIndex = 0;
while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
QName name = reader.getName();
if (WSDLConstants.QNAME_PART.equals(name)) {
String part = ParserUtil.getMandatoryNonEmptyAttribute(reader, WSDLConstants.ATTR_NAME);
String desc = null;
int index = reader.getAttributeCount();
WSDLDescriptorKind kind = WSDLDescriptorKind.ELEMENT;
for (int i = 0; i < index; i++) {
QName descName = reader.getAttributeName(i);
if (descName.getLocalPart().equals("element"))
kind = WSDLDescriptorKind.ELEMENT;
else if (descName.getLocalPart().equals("type"))
kind = WSDLDescriptorKind.TYPE;
if (descName.getLocalPart().equals("element") || descName.getLocalPart().equals("type")) {
desc = reader.getAttributeValue(i);
break;
}
}
if (desc != null) {
EditableWSDLPart wsdlPart = new WSDLPartImpl(reader, part, partIndex, new WSDLPartDescriptorImpl(reader, ParserUtil.getQName(reader, desc), kind));
msg.add(wsdlPart);
}
if (reader.getEventType() != XMLStreamConstants.END_ELEMENT)
goToEnd(reader);
} else {
extensionFacade.messageElements(msg, reader);
}
}
wsdlDoc.addMessage(msg);
if (reader.getEventType() != XMLStreamConstants.END_ELEMENT)
goToEnd(reader);
}
Aggregations