com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation Java Examples

The following examples show how to use com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation. 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-8-source 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 #2
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 #3
Source File: W3CWsaServerTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void checkMandatoryHeaders(
        Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo,
        boolean foundFaultTo, boolean foundMessageId, boolean foundRelatesTo) {
    super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo,
            foundFaultTo, foundMessageId, foundRelatesTo);

    // find Req/Response or Oneway using WSDLModel(if it is availabe)
    WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
    // Taking care of protocol messages as they do not have any corresponding operations
    if (wbo != null) {
        // if two-way and no wsa:MessageID is found
        if (!wbo.getOperation().isOneWay() && !foundMessageId) {
            throw new MissingAddressingHeaderException(addressingVersion.messageIDTag,packet);
        }
    }

}
 
Example #4
Source File: WsaTubeHelper.java    From openjdk-8-source 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 #5
Source File: WsaClientTube.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void validateAction(Packet packet) {
    //There may not be a WSDL operation.  There may not even be a WSDL.
    //For instance this may be a RM CreateSequence message.
    WSDLBoundOperation wbo = getWSDLBoundOperation(packet);

    if (wbo == null)    return;

    String gotA = AddressingUtils.getAction(
            packet.getMessage().getHeaders(),
            addressingVersion, soapVersion);
    if (gotA == null)
        throw new WebServiceException(AddressingMessages.VALIDATION_CLIENT_NULL_ACTION());

    String expected = helper.getOutputAction(packet);

    if (expected != null && !gotA.equals(expected))
        throw new ActionNotSupportedException(gotA);
}
 
Example #6
Source File: WsaClientTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void validateAction(Packet packet) {
    //There may not be a WSDL operation.  There may not even be a WSDL.
    //For instance this may be a RM CreateSequence message.
    WSDLBoundOperation wbo = getWSDLBoundOperation(packet);

    if (wbo == null)    return;

    String gotA = AddressingUtils.getAction(
            packet.getMessage().getHeaders(),
            addressingVersion, soapVersion);
    if (gotA == null)
        throw new WebServiceException(AddressingMessages.VALIDATION_CLIENT_NULL_ACTION());

    String expected = helper.getOutputAction(packet);

    if (expected != null && !gotA.equals(expected))
        throw new ActionNotSupportedException(gotA);
}
 
Example #7
Source File: WsaTubeHelper.java    From openjdk-jdk8u-backup 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 #8
Source File: WsaTubeHelper.java    From TencentKona-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 #9
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 #10
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 #11
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 #12
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 #13
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;
}
 
Example #14
Source File: WsaServerTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void checkMessageAddressingProperties(Packet packet) {
    super.checkMessageAddressingProperties(packet);

    // wsaw:Anonymous validation
    WSDLBoundOperation wsdlBoundOperation = getWSDLBoundOperation(packet);
    checkAnonymousSemantics(wsdlBoundOperation, replyTo, faultTo);
     // check if addresses are valid
    checkNonAnonymousAddresses(replyTo,faultTo);
}
 
Example #15
Source File: W3CWsaServerTube.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void checkAnonymousSemantics(WSDLBoundOperation wbo, WSEndpointReference replyTo, WSEndpointReference faultTo) {
    String replyToValue = null;
    String faultToValue = null;

    if (replyTo != null)
        replyToValue = replyTo.getAddress();

    if (faultTo != null)
        faultToValue = faultTo.getAddress();
    WSDLBoundOperation.ANONYMOUS responseRequirement = getResponseRequirement(wbo);

    switch (responseRequirement) {
        case prohibited:
            if (replyToValue != null && replyToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);

            if (faultToValue != null && faultToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
            break;
        case required:
            if (replyToValue != null && !replyToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);

            if (faultToValue != null && !faultToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
            break;
        default:
            // ALL: no check
    }
}
 
Example #16
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addBindingOperationOutputExtension(final TypedXmlWriter output, final JavaMethod method) {
    LOGGER.entering();
    final QName operationName = new QName(method.getOwner().getTargetNamespace(), method.getOperationName());
    selectAndProcessBindingSubject(output, WSDLBoundOperation.class, ScopeType.OUTPUT_MESSAGE, operationName);
    LOGGER.exiting();
}
 
Example #17
Source File: W3CWsaServerTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void checkAnonymousSemantics(WSDLBoundOperation wbo, WSEndpointReference replyTo, WSEndpointReference faultTo) {
    String replyToValue = null;
    String faultToValue = null;

    if (replyTo != null)
        replyToValue = replyTo.getAddress();

    if (faultTo != null)
        faultToValue = faultTo.getAddress();
    WSDLBoundOperation.ANONYMOUS responseRequirement = getResponseRequirement(wbo);

    switch (responseRequirement) {
        case prohibited:
            if (replyToValue != null && replyToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);

            if (faultToValue != null && faultToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
            break;
        case required:
            if (replyToValue != null && !replyToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);

            if (faultToValue != null && !faultToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
            break;
        default:
            // ALL: no check
    }
}
 
Example #18
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addBindingOperationExtension(final TypedXmlWriter operation, final JavaMethod method) {
    LOGGER.entering();
    final QName operationName = (method == null) ? null : new QName(method.getOwner().getTargetNamespace(), method.getOperationName());
    selectAndProcessBindingSubject(operation, WSDLBoundOperation.class, ScopeType.OPERATION, operationName);
    LOGGER.exiting();
}
 
Example #19
Source File: WsaTubeHelper.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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();

}
 
Example #20
Source File: RuntimeModeler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private WSDLPart getPart(QName opName, String partName, Mode mode){
    if(binding != null){
        WSDLBoundOperation bo = binding.getBinding().get(opName);
        if(bo != null)
            return bo.getPart(partName, mode);
    }
    return null;
}
 
Example #21
Source File: MemberSubmissionWsaServerTube.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo,
        boolean foundFaultTo, boolean foundMessageId, boolean foundRelatesTo) {

    super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo,
            foundFaultTo, foundMessageId, foundRelatesTo);

    // if no wsa:To header is found
    if (!foundTo)
        throw new MissingAddressingHeaderException(addressingVersion.toTag,packet);

    //we can find Req/Response or Oneway only with WSDLModel
    if (wsdlPort != null) {
        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
        // if two-way, must contain wsa:ReplyTo
        // Unlike W3C version, we cannot assume default value as anonymous if not present.
        // For protocol messages, don't check as they do not have any corresponding wsdl operations
        if (wbo != null && !wbo.getOperation().isOneWay() && !foundReplyTo) {
            throw new MissingAddressingHeaderException(addressingVersion.replyToTag,packet);
        }
    }
    if (!validation.equals(MemberSubmissionAddressing.Validation.LAX)) {
        // wsa:MessageId is required if wsa:ReplyTo is present.
        if ((foundReplyTo || foundFaultTo) && !foundMessageId)
            throw new MissingAddressingHeaderException(addressingVersion.messageIDTag,packet);
    }
}
 
Example #22
Source File: MemberSubmissionWsaServerTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo,
        boolean foundFaultTo, boolean foundMessageId, boolean foundRelatesTo) {

    super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo,
            foundFaultTo, foundMessageId, foundRelatesTo);

    // if no wsa:To header is found
    if (!foundTo)
        throw new MissingAddressingHeaderException(addressingVersion.toTag,packet);

    //we can find Req/Response or Oneway only with WSDLModel
    if (wsdlPort != null) {
        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
        // if two-way, must contain wsa:ReplyTo
        // Unlike W3C version, we cannot assume default value as anonymous if not present.
        // For protocol messages, don't check as they do not have any corresponding wsdl operations
        if (wbo != null && !wbo.getOperation().isOneWay() && !foundReplyTo) {
            throw new MissingAddressingHeaderException(addressingVersion.replyToTag,packet);
        }
    }
    if (!validation.equals(MemberSubmissionAddressing.Validation.LAX)) {
        // wsa:MessageId is required if wsa:ReplyTo is present.
        if ((foundReplyTo || foundFaultTo) && !foundMessageId)
            throw new MissingAddressingHeaderException(addressingVersion.messageIDTag,packet);
    }
}
 
Example #23
Source File: W3CWsaServerTube.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private WSDLBoundOperation.ANONYMOUS getResponseRequirement(@Nullable WSDLBoundOperation wbo) {
    try {
        if (af.getResponses() == AddressingFeature.Responses.ANONYMOUS) {
            return WSDLBoundOperation.ANONYMOUS.required;
        } else if (af.getResponses() == AddressingFeature.Responses.NON_ANONYMOUS) {
            return WSDLBoundOperation.ANONYMOUS.prohibited;
        }
    } catch (NoSuchMethodError e) {
        //Ignore error, defaut to optional
    }
    //wsaw wsdl binding case will have some value set on wbo
    return wbo != null ? wbo.getAnonymous() : WSDLBoundOperation.ANONYMOUS.optional;
}
 
Example #24
Source File: WsaTubeHelper.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public String getInputAction(Packet packet) {
    String action = null;

    if (wsdlPort != null) {
        WSDLOperationMapping wsdlOp = packet.getWSDLOperationMapping();
        if (wsdlOp != null) {
            WSDLBoundOperation wbo = wsdlOp.getWSDLBoundOperation();
            WSDLOperation op = wbo.getOperation();
            action = op.getInput().getAction();
        }
    }

    return action;
}
 
Example #25
Source File: MemberSubmissionWsaServerTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void checkMandatoryHeaders(Packet packet, boolean foundAction, boolean foundTo, boolean foundReplyTo,
        boolean foundFaultTo, boolean foundMessageId, boolean foundRelatesTo) {

    super.checkMandatoryHeaders(packet, foundAction, foundTo, foundReplyTo,
            foundFaultTo, foundMessageId, foundRelatesTo);

    // if no wsa:To header is found
    if (!foundTo)
        throw new MissingAddressingHeaderException(addressingVersion.toTag,packet);

    //we can find Req/Response or Oneway only with WSDLModel
    if (wsdlPort != null) {
        WSDLBoundOperation wbo = getWSDLBoundOperation(packet);
        // if two-way, must contain wsa:ReplyTo
        // Unlike W3C version, we cannot assume default value as anonymous if not present.
        // For protocol messages, don't check as they do not have any corresponding wsdl operations
        if (wbo != null && !wbo.getOperation().isOneWay() && !foundReplyTo) {
            throw new MissingAddressingHeaderException(addressingVersion.replyToTag,packet);
        }
    }
    if (!validation.equals(MemberSubmissionAddressing.Validation.LAX)) {
        // wsa:MessageId is required if wsa:ReplyTo is present.
        if ((foundReplyTo || foundFaultTo) && !foundMessageId)
            throw new MissingAddressingHeaderException(addressingVersion.messageIDTag,packet);
    }
}
 
Example #26
Source File: W3CWsaServerTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void checkAnonymousSemantics(WSDLBoundOperation wbo, WSEndpointReference replyTo, WSEndpointReference faultTo) {
    String replyToValue = null;
    String faultToValue = null;

    if (replyTo != null)
        replyToValue = replyTo.getAddress();

    if (faultTo != null)
        faultToValue = faultTo.getAddress();
    WSDLBoundOperation.ANONYMOUS responseRequirement = getResponseRequirement(wbo);

    switch (responseRequirement) {
        case prohibited:
            if (replyToValue != null && replyToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);

            if (faultToValue != null && faultToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
            break;
        case required:
            if (replyToValue != null && !replyToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);

            if (faultToValue != null && !faultToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
            break;
        default:
            // ALL: no check
    }
}
 
Example #27
Source File: WsaTube.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected final WSDLBoundOperation getWSDLBoundOperation(Packet packet) {
    //we can find Req/Response or Oneway only with WSDLModel
    if(wsdlPort == null)
        return null;
    QName opName = packet.getWSDLOperation();
    if(opName != null)
        return wsdlPort.getBinding().get(opName);
    return null;
}
 
Example #28
Source File: W3CWsaServerTube.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void checkAnonymousSemantics(WSDLBoundOperation wbo, WSEndpointReference replyTo, WSEndpointReference faultTo) {
    String replyToValue = null;
    String faultToValue = null;

    if (replyTo != null)
        replyToValue = replyTo.getAddress();

    if (faultTo != null)
        faultToValue = faultTo.getAddress();
    WSDLBoundOperation.ANONYMOUS responseRequirement = getResponseRequirement(wbo);

    switch (responseRequirement) {
        case prohibited:
            if (replyToValue != null && replyToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);

            if (faultToValue != null && faultToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
            break;
        case required:
            if (replyToValue != null && !replyToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);

            if (faultToValue != null && !faultToValue.equals(addressingVersion.anonymousUri))
                throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
            break;
        default:
            // ALL: no check
    }
}
 
Example #29
Source File: W3CWsaServerTube.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private WSDLBoundOperation.ANONYMOUS getResponseRequirement(@Nullable WSDLBoundOperation wbo) {
    try {
        if (af.getResponses() == AddressingFeature.Responses.ANONYMOUS) {
            return WSDLBoundOperation.ANONYMOUS.required;
        } else if (af.getResponses() == AddressingFeature.Responses.NON_ANONYMOUS) {
            return WSDLBoundOperation.ANONYMOUS.prohibited;
        }
    } catch (NoSuchMethodError e) {
        //Ignore error, defaut to optional
    }
    //wsaw wsdl binding case will have some value set on wbo
    return wbo != null ? wbo.getAnonymous() : WSDLBoundOperation.ANONYMOUS.optional;
}
 
Example #30
Source File: WsaTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
protected final WSDLBoundOperation getWSDLBoundOperation(Packet packet) {
    //we can find Req/Response or Oneway only with WSDLModel
    if(wsdlPort == null)
        return null;
    QName opName = packet.getWSDLOperation();
    if(opName != null)
        return wsdlPort.getBinding().get(opName);
    return null;
}