Search in sources :

Example 1 with WSDLOperation

use of com.sun.xml.ws.api.model.wsdl.WSDLOperation 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 2 with WSDLOperation

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

the class WsaTubeHelper method getEffectiveInputAction.

/**
 * This method gives the Input addressing Action for a message.
 * It gives the Action set in the wsdl operation for the corresponding payload.
 * If it is not explicitly set, it gives the soapAction
 * @return input Action
 */
public String getEffectiveInputAction(Packet packet) {
    // non-default SOAPAction beomes wsa:action
    if (packet.soapAction != null && !packet.soapAction.equals("")) {
        return packet.soapAction;
    }
    String action;
    if (wsdlPort != null) {
        WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
        if (wsdlOp != null) {
            WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
            WSDLOperation op = wbo.getOperation();
            action = op.getInput().getAction();
        } else {
            action = packet.soapAction;
        }
    } else {
        action = packet.soapAction;
    }
    return action;
}
Also used : WSDLOperationMapping(com.sun.xml.ws.api.model.WSDLOperationMapping) WSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation) WSDLOperation(com.sun.xml.ws.api.model.wsdl.WSDLOperation)

Example 3 with WSDLOperation

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

the class WsaTubeHelper method isInputActionDefault.

public boolean isInputActionDefault(Packet packet) {
    if (wsdlPort == null) {
        return false;
    }
    WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
    if (wsdlOp == null) {
        return false;
    }
    WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
    WSDLOperation op = wbo.getOperation();
    return op.getInput().isDefaultAction();
}
Also used : WSDLOperationMapping(com.sun.xml.ws.api.model.WSDLOperationMapping) WSDLBoundOperation(com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation) WSDLOperation(com.sun.xml.ws.api.model.wsdl.WSDLOperation)

Example 4 with WSDLOperation

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

the class WsaTubeHelper method getFaultAction.

String getFaultAction(@Nullable WSDLBoundOperation wbo, Packet responsePacket) {
    String action = AddressingUtils.getAction(responsePacket.getMessage().getHeaders(), addVer, soapVer);
    if (action != null) {
        return action;
    }
    action = addVer.getDefaultFaultAction();
    if (wbo == null) {
        return action;
    }
    try {
        SOAPMessage sm = responsePacket.getMessage().copy().readAsSOAPMessage();
        if (sm == null) {
            return action;
        }
        if (sm.getSOAPBody() == null) {
            return action;
        }
        if (sm.getSOAPBody().getFault() == null) {
            return action;
        }
        Detail detail = sm.getSOAPBody().getFault().getDetail();
        if (detail == null) {
            return action;
        }
        String ns = detail.getFirstChild().getNamespaceURI();
        String name = detail.getFirstChild().getLocalName();
        WSDLOperation o = wbo.getOperation();
        WSDLFault fault = o.getFault(new QName(ns, name));
        if (fault == null) {
            return action;
        }
        action = fault.getAction();
        return action;
    } catch (SOAPException e) {
        throw new WebServiceException(e);
    }
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) QName(javax.xml.namespace.QName) SOAPException(jakarta.xml.soap.SOAPException) WSDLOperation(com.sun.xml.ws.api.model.wsdl.WSDLOperation) SOAPMessage(jakarta.xml.soap.SOAPMessage) WSDLFault(com.sun.xml.ws.api.model.wsdl.WSDLFault) Detail(jakarta.xml.soap.Detail)

Example 5 with WSDLOperation

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

the class FODTest method testFreezeFOD.

// OrderProcessorService service = null;
public void testFreezeFOD() throws Exception {
    /*
		 * Verify that we can get messages from a port type by walking the model.
		 * 
		 */
    // File f = new File("testcases/fromwsdl/freeze/concrete.wsdl");
    // System.out.println(f.getAbsolutePath());
    // URL wsdl = new URL("file:/scratch/bnaugle/bugs/fod/v2/concrete.wsdl");
    // URL wsdl = new URL("file:/scratch/bnaugle/bugs/fod/FusionOrderDemoShared/services/orderbooking/output/concrete.wsdl");
    String WSDL_NAME = "concrete.wsdl";
    Source wsdlSource = getSource(WSDL_NAME);
    WSDLModel model = RuntimeWSDLParser.parse(getURL(WSDL_NAME), wsdlSource, XmlUtil.createDefaultCatalogResolver(), true, Container.NONE, new WSDLParserExtension[] {});
    Map<QName, ? extends WSDLPortType> portTypes = model.getPortTypes();
    Set<QName> keySet = portTypes.keySet();
    for (QName name : keySet) {
        WSDLPortType pt = portTypes.get(name);
        System.out.println(name.toString() + portTypes.get(name));
        Iterable<? extends WSDLOperation> operations = pt.getOperations();
        for (WSDLOperation operation : operations) {
            assertNotNull(operation.getInput().getMessage());
        }
    }
}
Also used : WSDLPortType(com.sun.xml.ws.api.model.wsdl.WSDLPortType) QName(javax.xml.namespace.QName) WSDLModel(com.sun.xml.ws.api.model.wsdl.WSDLModel) WSDLOperation(com.sun.xml.ws.api.model.wsdl.WSDLOperation) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source)

Aggregations

WSDLOperation (com.sun.xml.ws.api.model.wsdl.WSDLOperation)6 WSDLOperationMapping (com.sun.xml.ws.api.model.WSDLOperationMapping)3 WSDLBoundOperation (com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation)3 QName (javax.xml.namespace.QName)3 WSDLPortType (com.sun.xml.ws.api.model.wsdl.WSDLPortType)2 ParameterBinding (com.sun.xml.ws.api.model.ParameterBinding)1 WSDLFault (com.sun.xml.ws.api.model.wsdl.WSDLFault)1 WSDLMessage (com.sun.xml.ws.api.model.wsdl.WSDLMessage)1 WSDLModel (com.sun.xml.ws.api.model.wsdl.WSDLModel)1 EditableWSDLBoundOperation (com.sun.xml.ws.api.model.wsdl.editable.EditableWSDLBoundOperation)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 Detail (jakarta.xml.soap.Detail)1 SOAPException (jakarta.xml.soap.SOAPException)1 SOAPMessage (jakarta.xml.soap.SOAPMessage)1 WebServiceException (jakarta.xml.ws.WebServiceException)1 Source (javax.xml.transform.Source)1 StreamSource (javax.xml.transform.stream.StreamSource)1