com.sun.xml.internal.ws.api.WSBinding Java Examples

The following examples show how to use com.sun.xml.internal.ws.api.WSBinding. 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: MtomPolicyMapConfigurator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #2
Source File: DeploymentDescriptorParser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses the handler and role information and sets it
 * on the {@link WSBinding}.
 *
 * @return true if <handler-chains> element present in DD
 *         false otherwise.
 */
protected boolean setHandlersAndRoles(WSBinding binding, XMLStreamReader reader, QName serviceName, QName portName) {

    if (reader.getEventType() == XMLStreamConstants.END_ELEMENT ||
            !reader.getName().equals(HandlerChainsModel.QNAME_HANDLER_CHAINS)) {
        return false;
    }

    HandlerAnnotationInfo handlerInfo = HandlerChainsModel.parseHandlerFile(
            reader, classLoader, serviceName, portName, binding);

    binding.setHandlerChain(handlerInfo.getHandlers());
    if (binding instanceof SOAPBinding) {
        ((SOAPBinding) binding).setRoles(handlerInfo.getRoles());
    }

    // move past </handler-chains>
    XMLStreamReaderUtil.nextContent(reader);
    return true;
}
 
Example #3
Source File: Packet.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void populateAddressingHeaders(WSBinding binding, Packet responsePacket, WSDLPort wsdlPort, SEIModel seiModel) {
    AddressingVersion addressingVersion = binding.getAddressingVersion();

    if (addressingVersion == null) {
        return;
    }

    WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, seiModel, binding);
    String action = responsePacket.getMessage().isFault() ?
            wsaHelper.getFaultAction(this, responsePacket) :
            wsaHelper.getOutputAction(this);
    if (action == null) {
        LOGGER.info("WSA headers are not added as value for wsa:Action cannot be resolved for this message");
        return;
    }
    populateAddressingHeaders(responsePacket, addressingVersion, binding.getSOAPVersion(), action, AddressingVersion.isRequired(binding));
}
 
Example #4
Source File: Packet.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void populateAddressingHeaders(WSBinding binding, Packet responsePacket, WSDLPort wsdlPort, SEIModel seiModel) {
    AddressingVersion addressingVersion = binding.getAddressingVersion();

    if (addressingVersion == null) {
        return;
    }

    WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, seiModel, binding);
    String action = responsePacket.getMessage().isFault() ?
            wsaHelper.getFaultAction(this, responsePacket) :
            wsaHelper.getOutputAction(this);
    if (action == null) {
        LOGGER.info("WSA headers are not added as value for wsa:Action cannot be resolved for this message");
        return;
    }
    populateAddressingHeaders(responsePacket, addressingVersion, binding.getSOAPVersion(), action, AddressingVersion.isRequired(binding));
}
 
Example #5
Source File: DatabindingFactoryImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public Builder property(String name, Object value) {
    config.properties().put(name, value);
    if (isfor(BindingID.class, name, value)) {
        config.getMappingInfo().setBindingID((BindingID)value);
    }
    if (isfor(WSBinding.class, name, value)) {
        config.setWSBinding((WSBinding)value);
    }
    if (isfor(WSDLPort.class, name, value)) {
        config.setWsdlPort((WSDLPort)value);
    }
    if (isfor(MetadataReader.class, name, value)) {
        config.setMetadataReader((MetadataReader)value);
    }
    return this;
}
 
Example #6
Source File: MtomPolicyMapConfigurator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #7
Source File: ClientLogicalHandlerTube.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            WSBinding binding = getBinding();
            List<LogicalHandler> logicalSnapShot= ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
            if (!logicalSnapShot.isEmpty()) {
                handlers.addAll(logicalSnapShot);
                if (binding.getSOAPVersion() == null) {
                    processor = new XMLHandlerProcessor(this, binding,
                            handlers);
                } else {
                    processor = new SOAPHandlerProcessor(true, this, binding,
                            handlers);
                }
            }
    }
}
 
Example #8
Source File: ClientLogicalHandlerTube.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            WSBinding binding = getBinding();
            List<LogicalHandler> logicalSnapShot= ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
            if (!logicalSnapShot.isEmpty()) {
                handlers.addAll(logicalSnapShot);
                if (binding.getSOAPVersion() == null) {
                    processor = new XMLHandlerProcessor(this, binding,
                            handlers);
                } else {
                    processor = new SOAPHandlerProcessor(true, this, binding,
                            handlers);
                }
            }
    }
}
 
Example #9
Source File: SOAPProviderArgumentBuilder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected Packet getResponse(Packet request, @Nullable SOAPMessage returnValue, WSDLPort port, WSBinding binding) {
    Packet response = super.getResponse(request, returnValue, port, binding);
    // Populate SOAPMessage's transport headers
    if (returnValue != null && response.supports(Packet.OUTBOUND_TRANSPORT_HEADERS)) {
        MimeHeaders hdrs = returnValue.getMimeHeaders();
        Map<String, List<String>> headers = new HashMap<String, List<String>>();
        Iterator i = hdrs.getAllHeaders();
        while(i.hasNext()) {
            MimeHeader header = (MimeHeader)i.next();
            if(header.getName().equalsIgnoreCase("SOAPAction"))
                // SAAJ sets this header automatically, but it interferes with the correct operation of JAX-WS.
                // so ignore this header.
                continue;

            List<String> list = headers.get(header.getName());
            if (list == null) {
                list = new ArrayList<String>();
                headers.put(header.getName(), list);
            }
            list.add(header.getValue());
        }
        response.put(Packet.OUTBOUND_TRANSPORT_HEADERS, headers);
    }
    return response;
}
 
Example #10
Source File: WebServiceFeatureList.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static public WebServiceFeature[] toFeatureArray(WSBinding binding) {
    //TODO scchen convert BindingID  to WebServiceFeature[]
    if(!binding.isFeatureEnabled(EnvelopeStyleFeature.class)) {
        WebServiceFeature[] f = { binding.getSOAPVersion().toFeature() };
        binding.getFeatures().mergeFeatures(f, false);
    }
    return binding.getFeatures().toArray();
}
 
Example #11
Source File: WSDLGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #12
Source File: ClientSchemaValidationTube.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public ClientSchemaValidationTube(WSBinding binding, WSDLPort port, Tube next) {
    super(binding, next);
    this.port = port;
    if (port != null) {
        String primaryWsdl = port.getOwner().getParent().getLocation().getSystemId();
        MetadataResolverImpl mdresolver = new MetadataResolverImpl();
        Map<String, SDDocument> docs = MetadataUtil.getMetadataClosure(primaryWsdl, mdresolver, true);
        mdresolver = new MetadataResolverImpl(docs.values());
        Source[] sources = getSchemaSources(docs.values(), mdresolver);
        for(Source source : sources) {
            LOGGER.fine("Constructing client validation schema from = "+source.getSystemId());
            //printDOM((DOMSource)source);
        }
        if (sources.length != 0) {
            noValidation = false;
            sf.setResourceResolver(mdresolver);
            try {
                schema = sf.newSchema(sources);
            } catch(SAXException e) {
                throw new WebServiceException(e);
            }
            validator = schema.newValidator();
            return;
        }
    }
    noValidation = true;
    schema = null;
    validator = null;
}
 
Example #13
Source File: Packet.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public WSBinding getBinding() {
    if (endpoint != null) {
        return endpoint.getBinding();
    }
    if (proxy != null) {
        return (WSBinding) proxy.getBinding();
    }
    return null;
}
 
Example #14
Source File: Packet.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public WSBinding getBinding() {
    if (endpoint != null) {
        return endpoint.getBinding();
    }
    if (proxy != null) {
        return (WSBinding) proxy.getBinding();
    }
    return null;
}
 
Example #15
Source File: EndpointFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static <T> void processHandlerAnnotation(WSBinding binding, Class<T> implType, QName serviceName, QName portName) {
    HandlerAnnotationInfo chainInfo =
            HandlerAnnotationProcessor.buildHandlerInfo(
                    implType, serviceName, portName, binding);
    if (chainInfo != null) {
        binding.setHandlerChain(chainInfo.getHandlers());
        if (binding instanceof SOAPBinding) {
            ((SOAPBinding) binding).setRoles(chainInfo.getRoles());
        }
    }

}
 
Example #16
Source File: EndpointFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static <T> WSEndpoint<T> createEndpoint(
        Class<T> implType, boolean processHandlerAnnotation, @Nullable Invoker invoker,
        @Nullable QName serviceName, @Nullable QName portName,
        @Nullable Container container, @Nullable WSBinding binding,
        @Nullable SDDocumentSource primaryWsdl,
        @Nullable Collection<? extends SDDocumentSource> metadata,
        EntityResolver resolver, boolean isTransportSynchronous, boolean isStandard) {
    EndpointFactory factory = container != null ? container.getSPI(EndpointFactory.class) : null;
    if (factory == null)
            factory = EndpointFactory.getInstance();

    return factory.create(
            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous,isStandard);
}
 
Example #17
Source File: Packet.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public MTOMFeature getMtomFeature() {
    //If we have a binding, use that in preference to an explicitly
    //set MTOMFeature
    WSBinding binding = getBinding();
    if (binding != null) {
        return binding.getFeature(MTOMFeature.class);
    }
    return mtomFeature;
}
 
Example #18
Source File: WSEndpoint.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static <T> WSEndpoint<T> create(
    @NotNull Class<T> implType,
    boolean processHandlerAnnotation,
    @Nullable Invoker invoker,
    @Nullable QName serviceName,
    @Nullable QName portName,
    @Nullable Container container,
    @Nullable WSBinding binding,
    @Nullable SDDocumentSource primaryWsdl,
    @Nullable Collection<? extends SDDocumentSource> metadata,
    @Nullable EntityResolver resolver,
    boolean isTransportSynchronous,
    boolean isStandard)
{
    final WSEndpoint<T> endpoint =
        EndpointFactory.createEndpoint(
            implType,processHandlerAnnotation, invoker,serviceName,portName,container,binding,primaryWsdl,metadata,resolver,isTransportSynchronous,isStandard);

    final Iterator<ManagedEndpointFactory> managementFactories = ServiceFinder.find(ManagedEndpointFactory.class).iterator();
    if (managementFactories.hasNext()) {
        final ManagedEndpointFactory managementFactory = managementFactories.next();
        final EndpointCreationAttributes attributes = new EndpointCreationAttributes(
                processHandlerAnnotation, invoker, resolver, isTransportSynchronous);

        WSEndpoint<T> managedEndpoint = managementFactory.createEndpoint(endpoint, attributes);

        if (endpoint.getAssemblerContext().getTerminalTube() instanceof EndpointAwareTube) {
            ((EndpointAwareTube)endpoint.getAssemblerContext().getTerminalTube()).setEndpoint(managedEndpoint);
        }

        return managedEndpoint;
    }


    return endpoint;
}
 
Example #19
Source File: DispatchImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static void checkNullAllowed(@Nullable Object in, RequestContext rc, WSBinding binding, Service.Mode mode) {

        if (in != null)
            return;

        //With HTTP Binding a null invocation parameter can not be used
        //with HTTP Request Method == POST
        if (isXMLHttp(binding)){
            if (methodNotOk(rc))
                throw new WebServiceException(DispatchMessages.INVALID_NULLARG_XMLHTTP_REQUEST_METHOD(HTTP_REQUEST_METHOD_POST, HTTP_REQUEST_METHOD_GET));
        } else { //soapBinding
              if (mode == Service.Mode.MESSAGE )
                   throw new WebServiceException(DispatchMessages.INVALID_NULLARG_SOAP_MSGMODE(mode.name(), Service.Mode.PAYLOAD.toString()));
        }
    }
 
Example #20
Source File: WSDLGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the WSDLGenerator
 * @param model The {@link AbstractSEIModelImpl} used to generate the WSDL
 * @param wsdlResolver The {@link WSDLResolver} to use resovle names while generating the WSDL
 * @param binding specifies which {@link javax.xml.ws.BindingType} to generate
 * @param disableXmlSecurity specifies whether to disable the secure xml processing feature
 * @param extensions an array {@link WSDLGeneratorExtension} that will
 * be invoked to generate WSDL extensions
 */
public WSDLGenerator(AbstractSEIModelImpl model, WSDLResolver wsdlResolver, WSBinding binding, Container container,
                     Class implType, boolean inlineSchemas, boolean disableXmlSecurity,
                     WSDLGeneratorExtension... extensions) {

    this.model = model;
    resolver = new JAXWSOutputSchemaResolver();
    this.wsdlResolver = wsdlResolver;
    this.binding = binding;
    this.container = container;
    this.implType = implType;
    extensionHandlers = new ArrayList<WSDLGeneratorExtension>();
    this.inlineSchemas = inlineSchemas;
    this.disableXmlSecurity = disableXmlSecurity;

    // register handlers for default extensions
    register(new W3CAddressingWSDLGeneratorExtension());
    register(new W3CAddressingMetadataWSDLGeneratorExtension());
    register(new PolicyWSDLGeneratorExtension());

    if (container != null) { // on server
        WSDLGeneratorExtension[] wsdlGeneratorExtensions = container.getSPI(WSDLGeneratorExtension[].class);
        if (wsdlGeneratorExtensions != null) {
            for (WSDLGeneratorExtension wsdlGeneratorExtension : wsdlGeneratorExtensions) {
                register(wsdlGeneratorExtension);
            }
        }
    }

    for (WSDLGeneratorExtension w : extensions)
        register(w);

    this.extension = new WSDLGeneratorExtensionFacade(extensionHandlers.toArray(new WSDLGeneratorExtension[0]));
}
 
Example #21
Source File: WsaTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public WsaTube(WSDLPort wsdlPort, WSBinding binding, Tube next) {
    super(next);
    this.wsdlPort = wsdlPort;
    this.binding = binding;
    addKnownHeadersToBinding(binding);
    addressingVersion = binding.getAddressingVersion();
    soapVersion = binding.getSOAPVersion();
    helper = getTubeHelper();
    addressingRequired = AddressingVersion.isRequired(binding);
}
 
Example #22
Source File: XMLProviderArgumentBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected Packet getResponse(Packet request, Exception e, WSDLPort port, WSBinding binding) {
    Packet response = super.getResponse(request, e, port, binding);
    if (e instanceof HTTPException) {
        if (response.supports(MessageContext.HTTP_RESPONSE_CODE)) {
            response.put(MessageContext.HTTP_RESPONSE_CODE, ((HTTPException)e).getStatusCode());
        }
    }
    return response;
}
 
Example #23
Source File: HandlerTube.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public HandlerTube(Tube next, HandlerTube cousinTube, WSBinding binding) {
    super(next);
    this.cousinTube = cousinTube;
    this.binding = binding;
    if(cousinTube != null) {
        this.port = cousinTube.port;
    } else {
        this.port = null;
    }
}
 
Example #24
Source File: ProviderArgumentsBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates {@link Packet} from method invocation's return value
 */
protected Packet getResponse(Packet request, @Nullable T returnValue, WSDLPort port, WSBinding binding) {
    Message message = null;
    if (returnValue != null) {
        message = getResponseMessage(returnValue);
    }
    Packet response = request.createServerResponse(message,port,null,binding);
    return response;
}
 
Example #25
Source File: DispatchImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void checkValidSOAPMessageDispatch(WSBinding binding, Service.Mode mode) {
    // Dispatch<SOAPMessage> is only valid for soap binding and in Service.Mode.MESSAGE
    if (DispatchImpl.isXMLHttp(binding))
        throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_BINDING(HTTPBinding.HTTP_BINDING, SOAPBinding.SOAP11HTTP_BINDING + " or " + SOAPBinding.SOAP12HTTP_BINDING));
    if (DispatchImpl.isPAYLOADMode(mode))
        throw new WebServiceException(DispatchMessages.INVALID_SOAPMESSAGE_DISPATCH_MSGMODE(mode.name(), Service.Mode.MESSAGE.toString()));
}
 
Example #26
Source File: WSEndpoint.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This is used by WsaServerTube and WSEndpointImpl to create a Packet with SOAPFault message from a Java exception.
 */
public abstract Packet createServiceResponseForException(final ThrowableContainerPropertySet tc,
                                                         final Packet      responsePacket,
                                                         final SOAPVersion soapVersion,
                                                         final WSDLPort    wsdlPort,
                                                         final SEIModel    seiModel,
                                                         final WSBinding   binding);
 
Example #27
Source File: Packet.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Packet relateServerResponse(@Nullable Packet r, @Nullable WSDLPort wsdlPort, @Nullable SEIModel seiModel, @NotNull WSBinding binding) {
    relatePackets(r, false);
    r.setState(State.ServerResponse);
    AddressingVersion av = binding.getAddressingVersion();
    // populate WS-A headers only if WS-A is enabled
    if (av == null) {
        return r;
    }

    if (getMessage() == null) {
        return r;
    }

    //populate WS-A headers only if the request has addressing headers
    String inputAction = AddressingUtils.getAction(getMessage().getHeaders(), av, binding.getSOAPVersion());
    if (inputAction == null) {
        return r;
    }
    // if one-way, then dont populate any WS-A headers
    if (r.getMessage() == null || (wsdlPort != null && getMessage().isOneWay(wsdlPort))) {
        return r;
    }

    // otherwise populate WS-Addressing headers
    populateAddressingHeaders(binding, r, wsdlPort, seiModel);
    return r;
}
 
Example #28
Source File: WSEndpointImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected WSEndpointImpl(@NotNull QName serviceName, @NotNull QName portName, WSBinding binding, Container container,
                      SEIModel seiModel, WSDLPort port,
                      Tube masterTubeline) {
              this.serviceName = serviceName;
              this.portName = portName;
              this.binding = binding;
              this.soapVersion = binding.getSOAPVersion();
              this.container = container;
              this.endpointPolicy = null;
              this.port = port;
              this.seiModel = seiModel;
              this.serviceDef = null;
              this.implementationClass = null;
              this.masterTubeline = masterTubeline;
              this.masterCodec = ((BindingImpl) this.binding).createCodec();

      LazyMOMProvider.INSTANCE.registerEndpoint(this);
      initManagedObjectManager();

      this.operationDispatcher = (port == null) ? null : new OperationDispatcher(port, binding, seiModel);
          this.context = new ServerPipeAssemblerContext(
              seiModel, port, this, null /* not known */, false);

              tubePool = new TubePool(masterTubeline);
              engine = new Engine(toString(), container);
              wsdlProperties = (port == null) ? new WSDLDirectProperties(serviceName, portName, seiModel) : new WSDLPortProperties(port, seiModel);
}
 
Example #29
Source File: WsaTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void addKnownHeadersToBinding(WSBinding binding) {
    for (AddressingVersion addrVersion: AddressingVersion.values()) {
      binding.addKnownHeader(addrVersion.actionTag);
      binding.addKnownHeader(addrVersion.faultDetailTag);
      binding.addKnownHeader(addrVersion.faultToTag);
      binding.addKnownHeader(addrVersion.fromTag);
      binding.addKnownHeader(addrVersion.messageIDTag);
      binding.addKnownHeader(addrVersion.relatesToTag);
      binding.addKnownHeader(addrVersion.replyToTag);
      binding.addKnownHeader(addrVersion.toTag);
    }
}
 
Example #30
Source File: EndpointFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static MetadataReader getExternalMetadatReader(Class<?> implType, WSBinding binding) {
    com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef = binding.getFeature(
            com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature.class);
    // TODO-Miran: would it be necessary to disable secure xml processing?
    if (ef != null)
        return ef.getMetadataReader(implType.getClassLoader(), false);
    return null;
}