com.sun.xml.internal.ws.api.model.WSDLOperationMapping Java Examples

The following examples show how to use com.sun.xml.internal.ws.api.model.WSDLOperationMapping. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WsaTubeHelper.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
 * @param packet
 * @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;
}
 
Example #2
Source File: WsaTubeHelper.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public String getFaultAction(Packet requestPacket, Packet responsePacket) {
    String action = null;
    if(seiModel != null) {
        action = getFaultActionFromSEIModel(requestPacket,responsePacket);
    }
    if (action != null) {
        return action;
    } else {
        action = addVer.getDefaultFaultAction();
    }
    if (wsdlPort != null) {
        WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping();
        if (wsdlOp != null) {
            WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
            return getFaultAction(wbo, responsePacket);
        }
    }
    return action;
}
 
Example #3
Source File: WsaTubeHelper.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
 * @param packet
 * @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;
}
 
Example #4
Source File: PayloadQNameBasedOperationFinder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
Example #5
Source File: WsaTubeHelper.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public String getOutputAction(Packet packet) {
    //String action = AddressingVersion.UNSET_OUTPUT_ACTION;
    String action = null;
    WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
    if (wsdlOp != null) {
        JavaMethod javaMethod = wsdlOp.getJavaMethod();
        if (javaMethod != null) {
            JavaMethodImpl jm = (JavaMethodImpl) javaMethod;
            if (jm != null && jm.getOutputAction() != null && !jm.getOutputAction().equals("")) {
                return jm.getOutputAction();
            }
        }
        WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
        if (wbo != null) return getOutputAction(wbo);
    }
    return action;
}
 
Example #6
Source File: WsaTubeHelper.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public String getOutputAction(Packet packet) {
    //String action = AddressingVersion.UNSET_OUTPUT_ACTION;
    String action = null;
    WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
    if (wsdlOp != null) {
        JavaMethod javaMethod = wsdlOp.getJavaMethod();
        if (javaMethod != null) {
            JavaMethodImpl jm = (JavaMethodImpl) javaMethod;
            if (jm != null && jm.getOutputAction() != null && !jm.getOutputAction().equals("")) {
                return jm.getOutputAction();
            }
        }
        WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
        if (wbo != null) return getOutputAction(wbo);
    }
    return action;
}
 
Example #7
Source File: PayloadQNameBasedOperationFinder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
Example #8
Source File: WsaTubeHelper.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public String getSOAPAction(Packet packet) {
    String action = "";

    if (packet == null || packet.getMessage() == null) {
        return action;
    }

    if (wsdlPort == null) {
        return action;
    }

    WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
    if (wsdlOp == null) {
        return action;
    }

    WSDLBoundOperation op = wsdlOp.getWSDLBoundOperation();
    action = op.getSOAPAction();
    return action;
}
 
Example #9
Source File: WsaTubeHelper.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
 * @param packet
 * @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;
}
 
Example #10
Source File: Packet.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public WSDLOperationMapping getWSDLOperationMapping() {
    if (wsdlOperationMapping != null) return wsdlOperationMapping;
    OperationDispatcher opDispatcher = null;
    if (endpoint != null) {
        opDispatcher = endpoint.getOperationDispatcher();
    } else if (proxy != null) {
        opDispatcher = ((Stub) proxy).getOperationDispatcher();
    }
    //OpDispatcher is null when there is no WSDLModel
    if (opDispatcher != null) {
        try {
            wsdlOperationMapping = opDispatcher.getWSDLOperationMapping(this);
        } catch (DispatchException e) {
            //Ignore, this might be a protocol message which may not have a wsdl operation
            //LOGGER.info("Cannot resolve wsdl operation that this Packet is targeted for.");
        }
    }
    return wsdlOperationMapping;
}
 
Example #11
Source File: WsaTubeHelper.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public String getFaultAction(Packet requestPacket, Packet responsePacket) {
    String action = null;
    if(seiModel != null) {
        action = getFaultActionFromSEIModel(requestPacket,responsePacket);
    }
    if (action != null) {
        return action;
    } else {
        action = addVer.getDefaultFaultAction();
    }
    if (wsdlPort != null) {
        WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping();
        if (wsdlOp != null) {
            WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
            return getFaultAction(wbo, responsePacket);
        }
    }
    return action;
}
 
Example #12
Source File: WsaTubeHelper.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
 * @param packet
 * @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;
}
 
Example #13
Source File: OperationDispatcher.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
Example #14
Source File: WsaTubeHelper.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public String getFaultAction(Packet requestPacket, Packet responsePacket) {
    String action = null;
    if(seiModel != null) {
        action = getFaultActionFromSEIModel(requestPacket,responsePacket);
    }
    if (action != null) {
        return action;
    } else {
        action = addVer.getDefaultFaultAction();
    }
    if (wsdlPort != null) {
        WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping();
        if (wsdlOp != null) {
            WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
            return getFaultAction(wbo, responsePacket);
        }
    }
    return action;
}
 
Example #15
Source File: PayloadQNameBasedOperationFinder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
Example #16
Source File: Packet.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public WSDLOperationMapping getWSDLOperationMapping() {
    if (wsdlOperationMapping != null) return wsdlOperationMapping;
    OperationDispatcher opDispatcher = null;
    if (endpoint != null) {
        opDispatcher = endpoint.getOperationDispatcher();
    } else if (proxy != null) {
        opDispatcher = ((Stub) proxy).getOperationDispatcher();
    }
    //OpDispatcher is null when there is no WSDLModel
    if (opDispatcher != null) {
        try {
            wsdlOperationMapping = opDispatcher.getWSDLOperationMapping(this);
        } catch (DispatchException e) {
            //Ignore, this might be a protocol message which may not have a wsdl operation
            //LOGGER.info("Cannot resolve wsdl operation that this Packet is targeted for.");
        }
    }
    return wsdlOperationMapping;
}
 
Example #17
Source File: WsaTubeHelper.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
 * @param packet
 * @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;
}
 
Example #18
Source File: WsaTubeHelper.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public String getFaultAction(Packet requestPacket, Packet responsePacket) {
    String action = null;
    if(seiModel != null) {
        action = getFaultActionFromSEIModel(requestPacket,responsePacket);
    }
    if (action != null) {
        return action;
    } else {
        action = addVer.getDefaultFaultAction();
    }
    if (wsdlPort != null) {
        WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping();
        if (wsdlOp != null) {
            WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
            return getFaultAction(wbo, responsePacket);
        }
    }
    return action;
}
 
Example #19
Source File: WsaTubeHelper.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public String getSOAPAction(Packet packet) {
    String action = "";

    if (packet == null || packet.getMessage() == null) {
        return action;
    }

    if (wsdlPort == null) {
        return action;
    }

    WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
    if (wsdlOp == null) {
        return action;
    }

    WSDLBoundOperation op = wsdlOp.getWSDLBoundOperation();
    action = op.getSOAPAction();
    return action;
}
 
Example #20
Source File: WsaTubeHelper.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public String getOutputAction(Packet packet) {
    //String action = AddressingVersion.UNSET_OUTPUT_ACTION;
    String action = null;
    WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
    if (wsdlOp != null) {
        JavaMethod javaMethod = wsdlOp.getJavaMethod();
        if (javaMethod != null) {
            JavaMethodImpl jm = (JavaMethodImpl) javaMethod;
            if (jm != null && jm.getOutputAction() != null && !jm.getOutputAction().equals("")) {
                return jm.getOutputAction();
            }
        }
        WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
        if (wbo != null) return getOutputAction(wbo);
    }
    return action;
}
 
Example #21
Source File: Packet.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public WSDLOperationMapping getWSDLOperationMapping() {
    if (wsdlOperationMapping != null) return wsdlOperationMapping;
    OperationDispatcher opDispatcher = null;
    if (endpoint != null) {
        opDispatcher = endpoint.getOperationDispatcher();
    } else if (proxy != null) {
        opDispatcher = ((Stub) proxy).getOperationDispatcher();
    }
    //OpDispatcher is null when there is no WSDLModel
    if (opDispatcher != null) {
        try {
            wsdlOperationMapping = opDispatcher.getWSDLOperationMapping(this);
        } catch (DispatchException e) {
            //Ignore, this might be a protocol message which may not have a wsdl operation
            //LOGGER.info("Cannot resolve wsdl operation that this Packet is targeted for.");
        }
    }
    return wsdlOperationMapping;
}
 
Example #22
Source File: Packet.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public WSDLOperationMapping getWSDLOperationMapping() {
    if (wsdlOperationMapping != null) return wsdlOperationMapping;
    OperationDispatcher opDispatcher = null;
    if (endpoint != null) {
        opDispatcher = endpoint.getOperationDispatcher();
    } else if (proxy != null) {
        opDispatcher = ((Stub) proxy).getOperationDispatcher();
    }
    //OpDispatcher is null when there is no WSDLModel
    if (opDispatcher != null) {
        try {
            wsdlOperationMapping = opDispatcher.getWSDLOperationMapping(this);
        } catch (DispatchException e) {
            //Ignore, this might be a protocol message which may not have a wsdl operation
            //LOGGER.info("Cannot resolve wsdl operation that this Packet is targeted for.");
        }
    }
    return wsdlOperationMapping;
}
 
Example #23
Source File: PayloadQNameBasedOperationFinder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
Example #24
Source File: WsaTubeHelper.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public String getFaultAction(Packet requestPacket, Packet responsePacket) {
    String action = null;
    if(seiModel != null) {
        action = getFaultActionFromSEIModel(requestPacket,responsePacket);
    }
    if (action != null) {
        return action;
    } else {
        action = addVer.getDefaultFaultAction();
    }
    if (wsdlPort != null) {
        WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping();
        if (wsdlOp != null) {
            WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
            return getFaultAction(wbo, responsePacket);
        }
    }
    return action;
}
 
Example #25
Source File: WsaTubeHelper.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public String getOutputAction(Packet packet) {
    //String action = AddressingVersion.UNSET_OUTPUT_ACTION;
    String action = null;
    WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
    if (wsdlOp != null) {
        JavaMethod javaMethod = wsdlOp.getJavaMethod();
        if (javaMethod != null) {
            JavaMethodImpl jm = (JavaMethodImpl) javaMethod;
            if (jm != null && jm.getOutputAction() != null && !jm.getOutputAction().equals("")) {
                return jm.getOutputAction();
            }
        }
        WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
        if (wbo != null) return getOutputAction(wbo);
    }
    return action;
}
 
Example #26
Source File: WsaTubeHelper.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public String getSOAPAction(Packet packet) {
    String action = "";

    if (packet == null || packet.getMessage() == null) {
        return action;
    }

    if (wsdlPort == null) {
        return action;
    }

    WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
    if (wsdlOp == null) {
        return action;
    }

    WSDLBoundOperation op = wsdlOp.getWSDLBoundOperation();
    action = op.getSOAPAction();
    return action;
}
 
Example #27
Source File: OperationDispatcher.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
Example #28
Source File: WsaTubeHelper.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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
 * @param packet
 * @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;
}
 
Example #29
Source File: Packet.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public WSDLOperationMapping getWSDLOperationMapping() {
    if (wsdlOperationMapping != null) return wsdlOperationMapping;
    OperationDispatcher opDispatcher = null;
    if (endpoint != null) {
        opDispatcher = endpoint.getOperationDispatcher();
    } else if (proxy != null) {
        opDispatcher = ((Stub) proxy).getOperationDispatcher();
    }
    //OpDispatcher is null when there is no WSDLModel
    if (opDispatcher != null) {
        try {
            wsdlOperationMapping = opDispatcher.getWSDLOperationMapping(this);
        } catch (DispatchException e) {
            //Ignore, this might be a protocol message which may not have a wsdl operation
            //LOGGER.info("Cannot resolve wsdl operation that this Packet is targeted for.");
        }
    }
    return wsdlOperationMapping;
}
 
Example #30
Source File: WsaTubeHelper.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public String getFaultAction(Packet requestPacket, Packet responsePacket) {
    String action = null;
    if(seiModel != null) {
        action = getFaultActionFromSEIModel(requestPacket,responsePacket);
    }
    if (action != null) {
        return action;
    } else {
        action = addVer.getDefaultFaultAction();
    }
    if (wsdlPort != null) {
        WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping();
        if (wsdlOp != null) {
            WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
            return getFaultAction(wbo, responsePacket);
        }
    }
    return action;
}