Search in sources :

Example 1 with PortType

use of com.sun.xml.ws.wsdl.writer.document.PortType in project metro-jax-ws by eclipse-ee4j.

the class WSDLGenerator method generatePortType.

/**
 * Generates the WSDL portType
 */
protected void generatePortType() {
    PortType portType = portDefinitions.portType().name(model.getPortTypeName().getLocalPart());
    extension.addPortTypeExtension(portType);
    for (JavaMethodImpl method : model.getJavaMethods()) {
        Operation operation = portType.operation().name(method.getOperationName());
        generateParameterOrder(operation, method);
        extension.addOperationExtension(operation, method);
        switch(method.getMEP()) {
            case REQUEST_RESPONSE:
                // input message
                generateInputMessage(operation, method);
                // output message
                generateOutputMessage(operation, method);
                break;
            case ONE_WAY:
                generateInputMessage(operation, method);
                break;
            default:
                break;
        }
        // faults
        for (CheckedExceptionImpl exception : method.getCheckedExceptions()) {
            QName messageName = new QName(model.getTargetNamespace(), exception.getMessageName());
            FaultType paramType = operation.fault().message(messageName).name(exception.getMessageName());
            extension.addOperationFaultExtension(paramType, method, exception);
        }
    }
}
Also used : JavaMethodImpl(com.sun.xml.ws.model.JavaMethodImpl) QName(javax.xml.namespace.QName) CheckedExceptionImpl(com.sun.xml.ws.model.CheckedExceptionImpl) Operation(com.sun.xml.ws.wsdl.writer.document.Operation) FaultType(com.sun.xml.ws.wsdl.writer.document.FaultType) PortType(com.sun.xml.ws.wsdl.writer.document.PortType)

Aggregations

CheckedExceptionImpl (com.sun.xml.ws.model.CheckedExceptionImpl)1 JavaMethodImpl (com.sun.xml.ws.model.JavaMethodImpl)1 FaultType (com.sun.xml.ws.wsdl.writer.document.FaultType)1 Operation (com.sun.xml.ws.wsdl.writer.document.Operation)1 PortType (com.sun.xml.ws.wsdl.writer.document.PortType)1 QName (javax.xml.namespace.QName)1