Java Code Examples for com.sun.xml.internal.ws.api.WSBinding#getSOAPVersion()

The following examples show how to use com.sun.xml.internal.ws.api.WSBinding#getSOAPVersion() . 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: 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 2
Source File: ClientSOAPHandlerTube.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new instance of SOAPHandlerTube
 */
public ClientSOAPHandlerTube(WSBinding binding, WSDLPort port, Tube next) {
    super(next, port, binding);
    if (binding.getSOAPVersion() != null) {
        // SOAPHandlerTube should n't be used for bindings other than SOAP.
        // TODO: throw Exception
    }
}
 
Example 3
Source File: LogicalMessageImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example 4
Source File: StreamSOAPCodec.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link StreamSOAPCodec} instance using binding
 *
 * @deprecated use {@link #create(WSFeatureList)}
 */
public static StreamSOAPCodec create(WSBinding binding) {
    SOAPVersion version = binding.getSOAPVersion();
    if(version==null)
        // this decoder is for SOAP, not for XML/HTTP
        throw new IllegalArgumentException();
    switch(version) {
        case SOAP_11:
            return new StreamSOAP11Codec(binding);
        case SOAP_12:
            return new StreamSOAP12Codec(binding);
        default:
            throw new AssertionError();
    }
}
 
Example 5
Source File: StreamSOAPCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link StreamSOAPCodec} instance using binding
 *
 * @deprecated use {@link #create(WSFeatureList)}
 */
public static StreamSOAPCodec create(WSBinding binding) {
    SOAPVersion version = binding.getSOAPVersion();
    if(version==null)
        // this decoder is for SOAP, not for XML/HTTP
        throw new IllegalArgumentException();
    switch(version) {
        case SOAP_11:
            return new StreamSOAP11Codec(binding);
        case SOAP_12:
            return new StreamSOAP12Codec(binding);
        default:
            throw new AssertionError();
    }
}
 
Example 6
Source File: WSEndpointImpl.java    From openjdk-jdk9 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 7
Source File: HeaderList.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private SOAPVersion getEffectiveSOAPVersion(WSBinding binding) {
    SOAPVersion mySOAPVersion = (soapVersion != null) ? soapVersion : binding.getSOAPVersion();
    if (mySOAPVersion == null) {
        mySOAPVersion = SOAPVersion.SOAP_11;
    }
    return mySOAPVersion;
}
 
Example 8
Source File: LogicalMessageImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example 9
Source File: StreamSOAPCodec.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new {@link StreamSOAPCodec} instance using binding
 *
 * @deprecated use {@link #create(WSFeatureList)}
 */
public static StreamSOAPCodec create(WSBinding binding) {
    SOAPVersion version = binding.getSOAPVersion();
    if(version==null)
        // this decoder is for SOAP, not for XML/HTTP
        throw new IllegalArgumentException();
    switch(version) {
        case SOAP_11:
            return new StreamSOAP11Codec(binding);
        case SOAP_12:
            return new StreamSOAP12Codec(binding);
        default:
            throw new AssertionError();
    }
}
 
Example 10
Source File: LogicalMessageImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    Node n = dom.getNode();
    if(n.getNodeType()== Node.DOCUMENT_NODE) {
        n = ((Document)n).getDocumentElement();
    }
    return new DOMMessage(binding.getSOAPVersion(), headers, (Element)n, attachments);
}
 
Example 11
Source File: TieHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public TieHandler(JavaMethodImpl method, WSBinding binding, MessageContextFactory mcf) {
    this.soapVersion = binding.getSOAPVersion();
    this.method = method.getMethod();
    this.javaMethodModel = method;
    argumentsBuilder = createArgumentsBuilder();
    List<MessageFiller> fillers = new ArrayList<MessageFiller>();
    bodyBuilder = createResponseMessageBuilder(fillers);
    this.outFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    this.isOneWay = method.getMEP().isOneWay();
    this.noOfArgs = this.method.getParameterTypes().length;
    packetFactory = mcf;
}
 
Example 12
Source File: WSEndpointImpl.java    From openjdk-jdk8u-backup 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 13
Source File: HeaderList.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private SOAPVersion getEffectiveSOAPVersion(WSBinding binding) {
    SOAPVersion mySOAPVersion = (soapVersion != null) ? soapVersion : binding.getSOAPVersion();
    if (mySOAPVersion == null) {
        mySOAPVersion = SOAPVersion.SOAP_11;
    }
    return mySOAPVersion;
}
 
Example 14
Source File: MUTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected MUTube(WSBinding binding, Tube next) {
    super(next);
    // MUPipe should n't be used for bindings other than SOAP.
    if (!(binding instanceof SOAPBinding)) {
        throw new WebServiceException(
                "MUPipe should n't be used for bindings other than SOAP.");
    }
    this.binding = (SOAPBindingImpl) binding;
    this.soapVersion = binding.getSOAPVersion();
}
 
Example 15
Source File: AddressingUtils.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static void fillRequestAddressingHeaders(MessageHeaders headers, WSDLPort wsdlPort, WSBinding binding, Packet packet) {
    if (binding == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_BINDING());
    }

    if (binding.isFeatureEnabled(SuppressAutomaticWSARequestHeadersFeature.class)) {
        return;
    }

    //See if WSA headers are already set by the user.
    MessageHeaders hl = packet.getMessage().getHeaders();
    String action = AddressingUtils.getAction(hl, binding.getAddressingVersion(), binding.getSOAPVersion());
    if (action != null) {
        //assume that all the WSA headers are set by the user
        return;
    }
    AddressingVersion addressingVersion = binding.getAddressingVersion();
    //seiModel is passed as null as it is not needed.
    WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, null, binding);

    // wsa:Action
    String effectiveInputAction = wsaHelper.getEffectiveInputAction(packet);
    if (effectiveInputAction == null || effectiveInputAction.equals("") && binding.getSOAPVersion() == SOAPVersion.SOAP_11) {
        throw new WebServiceException(ClientMessages.INVALID_SOAP_ACTION());
    }
    boolean oneway = !packet.expectReply;
    if (wsdlPort != null) {
        // if WSDL has <wsaw:Anonymous>prohibited</wsaw:Anonymous>, then throw an error
        // as anonymous ReplyTo MUST NOT be added in that case. BindingProvider need to
        // disable AddressingFeature and MemberSubmissionAddressingFeature and hand-craft
        // the SOAP message with non-anonymous ReplyTo/FaultTo.
        if (!oneway && packet.getMessage() != null && packet.getWSDLOperation() != null) {
            WSDLBoundOperation wbo = wsdlPort.getBinding().get(packet.getWSDLOperation());
            if (wbo != null && wbo.getAnonymous() == WSDLBoundOperation.ANONYMOUS.prohibited) {
                throw new WebServiceException(AddressingMessages.WSAW_ANONYMOUS_PROHIBITED());
            }
        }
    }

    OneWayFeature oneWayFeature = binding.getFeature(OneWayFeature.class);
    final AddressingPropertySet addressingPropertySet = packet.getSatellite(AddressingPropertySet.class);
    oneWayFeature = addressingPropertySet == null ? oneWayFeature : new OneWayFeature(addressingPropertySet, addressingVersion);

    if (oneWayFeature == null || !oneWayFeature.isEnabled()) {
        // standard oneway
        fillRequestAddressingHeaders(headers, packet, addressingVersion, binding.getSOAPVersion(), oneway, effectiveInputAction, AddressingVersion.isRequired(binding));
    } else {
        // custom oneway
        fillRequestAddressingHeaders(headers, packet, addressingVersion, binding.getSOAPVersion(), oneWayFeature, oneway, effectiveInputAction);
    }
}
 
Example 16
Source File: StreamSOAPCodec.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
StreamSOAPCodec(WSBinding binding) {
    this(binding.getSOAPVersion(), binding.getFeature(SerializationFeature.class));
}
 
Example 17
Source File: LogicalMessageImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public Message getMessage(MessageHeaders headers, AttachmentSet attachments, WSBinding binding) {
    return new EmptyMessageImpl(headers,attachments,binding.getSOAPVersion());
}
 
Example 18
Source File: AddressingUtils.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void fillRequestAddressingHeaders(MessageHeaders headers, WSDLPort wsdlPort, WSBinding binding, Packet packet) {
    if (binding == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_BINDING());
    }

    if (binding.isFeatureEnabled(SuppressAutomaticWSARequestHeadersFeature.class)) {
        return;
    }

    //See if WSA headers are already set by the user.
    MessageHeaders hl = packet.getMessage().getHeaders();
    String action = AddressingUtils.getAction(hl, binding.getAddressingVersion(), binding.getSOAPVersion());
    if (action != null) {
        //assume that all the WSA headers are set by the user
        return;
    }
    AddressingVersion addressingVersion = binding.getAddressingVersion();
    //seiModel is passed as null as it is not needed.
    WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, null, binding);

    // wsa:Action
    String effectiveInputAction = wsaHelper.getEffectiveInputAction(packet);
    if (effectiveInputAction == null || effectiveInputAction.equals("") && binding.getSOAPVersion() == SOAPVersion.SOAP_11) {
        throw new WebServiceException(ClientMessages.INVALID_SOAP_ACTION());
    }
    boolean oneway = !packet.expectReply;
    if (wsdlPort != null) {
        // if WSDL has <wsaw:Anonymous>prohibited</wsaw:Anonymous>, then throw an error
        // as anonymous ReplyTo MUST NOT be added in that case. BindingProvider need to
        // disable AddressingFeature and MemberSubmissionAddressingFeature and hand-craft
        // the SOAP message with non-anonymous ReplyTo/FaultTo.
        if (!oneway && packet.getMessage() != null && packet.getWSDLOperation() != null) {
            WSDLBoundOperation wbo = wsdlPort.getBinding().get(packet.getWSDLOperation());
            if (wbo != null && wbo.getAnonymous() == WSDLBoundOperation.ANONYMOUS.prohibited) {
                throw new WebServiceException(AddressingMessages.WSAW_ANONYMOUS_PROHIBITED());
            }
        }
    }

    OneWayFeature oneWayFeature = binding.getFeature(OneWayFeature.class);
    final AddressingPropertySet addressingPropertySet = packet.getSatellite(AddressingPropertySet.class);
    oneWayFeature = addressingPropertySet == null ? oneWayFeature : new OneWayFeature(addressingPropertySet, addressingVersion);

    if (oneWayFeature == null || !oneWayFeature.isEnabled()) {
        // standard oneway
        fillRequestAddressingHeaders(headers, packet, addressingVersion, binding.getSOAPVersion(), oneway, effectiveInputAction, AddressingVersion.isRequired(binding));
    } else {
        // custom oneway
        fillRequestAddressingHeaders(headers, packet, addressingVersion, binding.getSOAPVersion(), oneWayFeature, oneway, effectiveInputAction);
    }
}
 
Example 19
Source File: StreamSOAPCodec.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
StreamSOAPCodec(WSBinding binding) {
    this(binding.getSOAPVersion(), binding.getFeature(SerializationFeature.class));
}
 
Example 20
Source File: StreamSOAPCodec.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
StreamSOAPCodec(WSBinding binding) {
    this(binding.getSOAPVersion(), binding.getFeature(SerializationFeature.class));
}