Search in sources :

Example 1 with EditableWSDLPart

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

the class WSDLBoundOperationImpl method getRequestPayloadName.

@Override
@Nullable
public QName getRequestPayloadName() {
    if (emptyRequestPayload)
        return null;
    if (requestPayloadName != null)
        return requestPayloadName;
    if (style.equals(Style.RPC)) {
        String ns = getRequestNamespace() != null ? getRequestNamespace() : name.getNamespaceURI();
        requestPayloadName = new QName(ns, name.getLocalPart());
        return requestPayloadName;
    } else {
        QName inMsgName = operation.getInput().getMessage().getName();
        EditableWSDLMessage message = messages.get(inMsgName);
        for (EditableWSDLPart part : message.parts()) {
            ParameterBinding binding = getInputBinding(part.getName());
            if (binding.isBody()) {
                requestPayloadName = part.getDescriptor().name();
                return requestPayloadName;
            }
        }
        // Its empty payload
        emptyRequestPayload = true;
    }
    // empty body
    return null;
}
Also used : 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) ParameterBinding(com.sun.xml.ws.api.model.ParameterBinding) Nullable(com.sun.istack.Nullable)

Example 2 with EditableWSDLPart

use of com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPart 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 3 with EditableWSDLPart

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

the class WSDLBoundOperationImpl method getResponsePayloadName.

@Override
@Nullable
public QName getResponsePayloadName() {
    if (emptyResponsePayload)
        return null;
    if (responsePayloadName != null)
        return responsePayloadName;
    if (style.equals(Style.RPC)) {
        String ns = getResponseNamespace() != null ? getResponseNamespace() : name.getNamespaceURI();
        responsePayloadName = new QName(ns, name.getLocalPart() + "Response");
        return responsePayloadName;
    } else {
        QName outMsgName = operation.getOutput().getMessage().getName();
        EditableWSDLMessage message = messages.get(outMsgName);
        for (EditableWSDLPart part : message.parts()) {
            ParameterBinding binding = getOutputBinding(part.getName());
            if (binding.isBody()) {
                responsePayloadName = part.getDescriptor().name();
                return responsePayloadName;
            }
        }
        // Its empty payload
        emptyResponsePayload = true;
    }
    // empty body
    return null;
}
Also used : 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) ParameterBinding(com.sun.xml.ws.api.model.ParameterBinding) Nullable(com.sun.istack.Nullable)

Example 4 with EditableWSDLPart

use of com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPart 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);
}
Also used : WSDLDescriptorKind(com.sun.xml.ws.api.model.wsdl.WSDLDescriptorKind) 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)

Aggregations

EditableWSDLMessage (com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLMessage)4 EditableWSDLPart (com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPart)4 QName (javax.xml.namespace.QName)4 ParameterBinding (com.sun.xml.ws.api.model.ParameterBinding)3 Nullable (com.sun.istack.Nullable)2 WSDLDescriptorKind (com.sun.xml.ws.api.model.wsdl.WSDLDescriptorKind)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 EditableWSDLBoundOperation (com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation)1 EditableWSDLPortType (com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLPortType)1