Search in sources :

Example 1 with EditableWSDLBoundOperation

use of com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation in project metro-jax-ws by eclipse-ee4j.

the class RuntimeWSDLParser method parseBindingOperation.

private void parseBindingOperation(XMLStreamReader reader, EditableWSDLBoundPortType binding) {
    String bindingOpName = ParserUtil.getMandatoryNonEmptyAttribute(reader, "name");
    if (bindingOpName == null) {
        // TODO: throw exception?
        // skip wsdl:binding element for now
        XMLStreamReaderUtil.skipElement(reader);
        return;
    }
    QName opName = new QName(binding.getPortTypeName().getNamespaceURI(), bindingOpName);
    EditableWSDLBoundOperation bindingOp = new WSDLBoundOperationImpl(reader, binding, opName);
    binding.put(opName, bindingOp);
    extensionFacade.bindingOperationAttributes(bindingOp, reader);
    while (XMLStreamReaderUtil.nextElementContent(reader) != XMLStreamConstants.END_ELEMENT) {
        QName name = reader.getName();
        String style = null;
        if (WSDLConstants.QNAME_INPUT.equals(name)) {
            parseInputBinding(reader, bindingOp);
        } else if (WSDLConstants.QNAME_OUTPUT.equals(name)) {
            parseOutputBinding(reader, bindingOp);
        } else if (WSDLConstants.QNAME_FAULT.equals(name)) {
            parseFaultBinding(reader, bindingOp);
        } else if (SOAPConstants.QNAME_OPERATION.equals(name) || SOAPConstants.QNAME_SOAP12OPERATION.equals(name)) {
            style = reader.getAttributeValue(null, "style");
            String soapAction = reader.getAttributeValue(null, "soapAction");
            if (soapAction != null)
                bindingOp.setSoapAction(soapAction);
            goToEnd(reader);
        } else {
            extensionFacade.bindingOperationElements(bindingOp, reader);
        }
        /*
               If style attribute is present set it otherwise set the style as defined
               on the <soap:binding> element
             */
        if (style != null) {
            if (style.equals("rpc"))
                bindingOp.setStyle(Style.RPC);
            else
                bindingOp.setStyle(Style.DOCUMENT);
        } else {
            bindingOp.setStyle(binding.getStyle());
        }
    }
}
Also used : EditableWSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation) QName(javax.xml.namespace.QName)

Example 2 with EditableWSDLBoundOperation

use of com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation in project metro-jax-ws by eclipse-ee4j.

the class WSDLBoundPortTypeImpl method freezePayloadMap.

private void freezePayloadMap() {
    if (style == Style.RPC) {
        payloadMap = new QNameMap<>();
        for (EditableWSDLBoundOperation op : bindingOperations.values()) {
            payloadMap.put(op.getRequestPayloadName(), op);
        }
    } else {
        payloadMap = new QNameMap<>();
        // For doclit The tag will be the operation that has the same input part descriptor value
        for (EditableWSDLBoundOperation op : bindingOperations.values()) {
            QName name = op.getRequestPayloadName();
            if (name == null) {
                // empty payload
                emptyPayloadOperation = op;
                continue;
            }
            payloadMap.put(name, op);
        }
    }
}
Also used : EditableWSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation) QName(javax.xml.namespace.QName)

Example 3 with EditableWSDLBoundOperation

use of com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation in project metro-jax-ws by eclipse-ee4j.

the class WSDLModelImpl method finalizeRpcLitBinding.

public void finalizeRpcLitBinding(EditableWSDLBoundPortType boundPortType) {
    assert (boundPortType != null);
    QName portTypeName = boundPortType.getPortTypeName();
    if (portTypeName == null)
        return;
    WSDLPortType pt = portTypes.get(portTypeName);
    if (pt == null)
        return;
    for (EditableWSDLBoundOperation bop : boundPortType.getBindingOperations()) {
        WSDLOperation pto = pt.get(bop.getName().getLocalPart());
        WSDLMessage inMsgName = pto.getInput().getMessage();
        if (inMsgName == null)
            continue;
        EditableWSDLMessage inMsg = messages.get(inMsgName.getName());
        int bodyindex = 0;
        if (inMsg != null) {
            for (EditableWSDLPart part : inMsg.parts()) {
                String name = part.getName();
                ParameterBinding pb = bop.getInputBinding(name);
                if (pb.isBody()) {
                    part.setIndex(bodyindex++);
                    part.setBinding(pb);
                    bop.addPart(part, Mode.IN);
                }
            }
        }
        bodyindex = 0;
        if (pto.isOneWay())
            continue;
        WSDLMessage outMsgName = pto.getOutput().getMessage();
        if (outMsgName == null)
            continue;
        EditableWSDLMessage outMsg = messages.get(outMsgName.getName());
        if (outMsg != null) {
            for (EditableWSDLPart part : outMsg.parts()) {
                String name = part.getName();
                ParameterBinding pb = bop.getOutputBinding(name);
                if (pb.isBody()) {
                    part.setIndex(bodyindex++);
                    part.setBinding(pb);
                    bop.addPart(part, Mode.OUT);
                }
            }
        }
    }
}
Also used : EditableWSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation) EditableWSDLMessage(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLMessage) WSDLMessage(com.sun.xml.ws.api.model.wsdl.WSDLMessage) WSDLPortType(com.sun.xml.ws.api.model.wsdl.WSDLPortType) EditableWSDLPortType(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPortType) EditableWSDLPart(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPart) QName(javax.xml.namespace.QName) EditableWSDLMessage(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLMessage) WSDLOperation(com.sun.xml.ws.api.model.wsdl.WSDLOperation) ParameterBinding(com.sun.xml.ws.api.model.ParameterBinding)

Example 4 with EditableWSDLBoundOperation

use of com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation in project metro-jax-ws by eclipse-ee4j.

the class WSDLBoundPortTypeImpl method freeze.

public void freeze() {
    portType = owner.getPortType(portTypeName);
    if (portType == null) {
        throw new LocatableWebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName), getLocation());
    }
    portType.freeze();
    for (EditableWSDLBoundOperation op : bindingOperations.values()) {
        op.freeze(owner);
    }
    freezePayloadMap();
    owner.finalizeRpcLitBinding(this);
}
Also used : EditableWSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation) LocatableWebServiceException(com.sun.xml.ws.util.exception.LocatableWebServiceException)

Aggregations

EditableWSDLBoundOperation (com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation)4 QName (javax.xml.namespace.QName)3 ParameterBinding (com.sun.xml.ws.api.model.ParameterBinding)1 WSDLMessage (com.sun.xml.ws.api.model.wsdl.WSDLMessage)1 WSDLOperation (com.sun.xml.ws.api.model.wsdl.WSDLOperation)1 WSDLPortType (com.sun.xml.ws.api.model.wsdl.WSDLPortType)1 EditableWSDLMessage (com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLMessage)1 EditableWSDLPart (com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPart)1 EditableWSDLPortType (com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPortType)1 LocatableWebServiceException (com.sun.xml.ws.util.exception.LocatableWebServiceException)1