Search in sources :

Example 1 with WebMessage

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;
}
Also used : EndpointInterface(com.webcohesion.enunciate.modules.jaxws.model.EndpointInterface) WebMethod(com.webcohesion.enunciate.modules.jaxws.model.WebMethod) WebFault(com.webcohesion.enunciate.modules.jaxws.model.WebFault) WebMessage(com.webcohesion.enunciate.modules.jaxws.model.WebMessage)

Example 2 with WebMessage

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());
        }
    }
}
Also used : WebMethod(com.webcohesion.enunciate.modules.jaxws.model.WebMethod) ImplicitSchemaElement(com.webcohesion.enunciate.modules.jaxb.model.ImplicitSchemaElement) WebMessagePart(com.webcohesion.enunciate.modules.jaxws.model.WebMessagePart) WebMessage(com.webcohesion.enunciate.modules.jaxws.model.WebMessage) SchemaInfo(com.webcohesion.enunciate.modules.jaxb.model.SchemaInfo)

Aggregations

WebMessage (com.webcohesion.enunciate.modules.jaxws.model.WebMessage)2 WebMethod (com.webcohesion.enunciate.modules.jaxws.model.WebMethod)2 ImplicitSchemaElement (com.webcohesion.enunciate.modules.jaxb.model.ImplicitSchemaElement)1 SchemaInfo (com.webcohesion.enunciate.modules.jaxb.model.SchemaInfo)1 EndpointInterface (com.webcohesion.enunciate.modules.jaxws.model.EndpointInterface)1 WebFault (com.webcohesion.enunciate.modules.jaxws.model.WebFault)1 WebMessagePart (com.webcohesion.enunciate.modules.jaxws.model.WebMessagePart)1