Example usage for javax.xml.ws.handler PortInfo getServiceName

List of usage examples for javax.xml.ws.handler PortInfo getServiceName

Introduction

In this page you can find the example usage for javax.xml.ws.handler PortInfo getServiceName.

Prototype

public QName getServiceName();

Source Link

Document

Gets the qualified name of the WSDL service name containing the port being accessed.

Usage

From source file:am.ik.aws.apa.handler.AwsHandlerResolver.java

@SuppressWarnings("rawtypes")
public List<Handler> getHandlerChain(PortInfo portInfo) {
    List<Handler> handlerChain = new ArrayList<Handler>();

    QName serviceQName = portInfo.getServiceName();
    if (serviceQName.getLocalPart().equals("AWSECommerceService")) {
        handlerChain.add(new AwsHandler(awsSecretKey));
    }/* w w  w  . j  a v  a  2s  . c o  m*/

    return handlerChain;
}

From source file:at.molindo.amazonclient.AWSHandlerResolver.java

@SuppressWarnings("rawtypes")
public List<Handler> getHandlerChain(final PortInfo portInfo) {
    final List<Handler> handlerChain = new ArrayList<Handler>();

    final QName serviceQName = portInfo.getServiceName();
    if (serviceQName.getLocalPart().equals("AWSECommerceService")) {
        handlerChain.add(new AwsHandler(awsSecretKey));
    }//from  w w  w. j av a  2  s  .c om

    return handlerChain;
}

From source file:org.apache.axis2.jaxws.spi.handler.BaseHandlerResolver.java

protected static boolean chainResolvesToPort(HandlerChainType hct, PortInfo portinfo) {

    List<String> protocolBindings = hct.getProtocolBindings();
    if (protocolBindings != null) {
        boolean match = true;
        for (Iterator<String> it = protocolBindings.iterator(); it.hasNext();) {
            match = false; // default to false in the protocol bindings until we find a match
            String protocolBinding = it.next();
            protocolBinding = protocolBinding.startsWith("##") ? protocolBindingsMap.get(protocolBinding)
                    : protocolBinding;//from  w  w  w  .  jav  a  2 s .  c  o  m
            // if the protocolBindingsMap returns null, it would mean someone has some nonsense ##binding
            if ((protocolBinding != null) && (protocolBinding.equals(portinfo.getBindingID()))) {
                match = true;
                break;
            }
        }
        if (match == false) {
            // we've checked all the protocolBindings, but didn't find a match, no need to continue
            return match;
        }
    }

    /*
     * need to figure out how to get the namespace declaration out of the port-name-pattern and service-name-pattern
     */

    if (!doesPatternMatch(portinfo.getPortName(), hct.getPortNamePattern())) {
        // we've checked the port-name-pattern, and didn't find a match, no need to continue
        return false;
    }

    if (!doesPatternMatch(portinfo.getServiceName(), hct.getServiceNamePattern())) {
        // we've checked the service-name-pattern, and didn't find a match, no need to continue
        return false;
    }

    return true;
}