use of com.webcohesion.enunciate.modules.jaxws.model.WebMessage in project enunciate by stoicflame.
the class WsdlInfo method getWebMessages.
public List<WebMessage> getWebMessages() {
ArrayList<WebMessage> messages = new ArrayList<WebMessage>();
HashSet<String> foundFaults = new HashSet<String>();
for (EndpointInterface ei : getEndpointInterfaces()) {
Collection<WebMethod> webMethods = ei.getWebMethods();
for (WebMethod method : webMethods) {
for (WebMessage webMessage : method.getMessages()) {
if (webMessage.isFault() && !foundFaults.add(((WebFault) webMessage).getQualifiedName().toString())) {
continue;
}
messages.add(webMessage);
}
}
}
return messages;
}
use of com.webcohesion.enunciate.modules.jaxws.model.WebMessage in project enunciate by stoicflame.
the class EnunciateJaxwsContext method add.
/**
* Add an endpoint interface to the model.
*
* @param ei The endpoint interface to add to the model.
*/
public void add(EndpointInterface ei) {
String namespace = ei.getTargetNamespace();
String prefix = this.jaxbContext.addNamespace(namespace);
WsdlInfo wsdlInfo = wsdls.get(namespace);
if (wsdlInfo == null) {
wsdlInfo = new WsdlInfo(jaxbContext);
wsdlInfo.setId(prefix);
wsdls.put(namespace, wsdlInfo);
wsdlInfo.setTargetNamespace(namespace);
}
for (WebMethod webMethod : ei.getWebMethods()) {
for (WebMessage webMessage : webMethod.getMessages()) {
for (WebMessagePart messagePart : webMessage.getParts()) {
if (messagePart.isImplicitSchemaElement()) {
ImplicitSchemaElement implicitElement = (ImplicitSchemaElement) messagePart;
String particleNamespace = messagePart.getParticleQName().getNamespaceURI();
SchemaInfo schemaInfo = this.jaxbContext.getSchemas().get(particleNamespace);
if (schemaInfo == null) {
schemaInfo = new SchemaInfo(this.jaxbContext);
schemaInfo.setId(this.jaxbContext.addNamespace(particleNamespace));
schemaInfo.setNamespace(particleNamespace);
this.jaxbContext.getSchemas().put(particleNamespace, schemaInfo);
}
schemaInfo.getImplicitSchemaElements().add(implicitElement);
}
}
}
}
wsdlInfo.getEndpointInterfaces().add(ei);
this.endpointInterfaces.add(ei);
debug("Added %s as a JAX-WS endpoint interface.", ei.getQualifiedName());
if (getContext().getProcessingEnvironment().findSourcePosition(ei) == null) {
OneTimeLogMessage.SOURCE_FILES_NOT_FOUND.log(getContext());
if (OneTimeLogMessage.SOURCE_FILES_NOT_FOUND.getLogged() <= 3) {
info("Unable to find source file for %s.", ei.getQualifiedName());
} else {
debug("Unable to find source file for %s.", ei.getQualifiedName());
}
}
}
Aggregations