Package org.apache.axis2.jaxws.message

Examples of org.apache.axis2.jaxws.message.Protocol


                .getFactory(HandlerLifecycleManagerFactory.class);
        return elmf.createHandlerLifecycleManager();
    }
   
    private MessageContext isProtocolMismatch(MessageContext request, MessageContext response){
      Protocol requestProtocol =request.getMessage().getProtocol();
      Protocol responseProtocol = response.getMessage().getProtocol();
      boolean protocolMismatch = false;
      String msg = null;
      if(requestProtocol.equals(Protocol.soap11)){
        if(!responseProtocol.equals(Protocol.soap11)){
          protocolMismatch = true;
          msg = "Request SOAP message protocol is version 1.1, but Response SOAP message is configured for SOAP 1.2.  This is not supported.";
        }
      }
      else if(requestProtocol.equals(Protocol.soap12)){
        if(!responseProtocol.equals(Protocol.soap12)){
          protocolMismatch = true;
          msg = "Request SOAP message protocol is version 1.2, but Response SOAP message is configured for SOAP 1.1.  This is not supported.";
        }
      }
      MessageContext msgContext = null;
View Full Code Here


        SOAPEnvelope soapEnv = msgContext.getEnvelope();
        if (soapEnv != null) {
            MessageFactory msgFactory =
                    (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
            try {
                Protocol protocol = msgContext.isDoingREST() ? Protocol.rest : null;
                message = msgFactory.createFrom(soapEnv, protocol);
            } catch (Exception e) {
                throw ExceptionFactory.makeWebServiceException(
                    Messages.getMessage("msgFromMsgErr"), e);
            }
View Full Code Here

        if ((eds != null) && (eds.size() > 0)) {
            Iterator<EndpointDescription> i = eds.iterator();
            if (i.hasNext()) {
                EndpointDescription ed = eds.iterator().next();
               
                Protocol protocol = mc.getMessage().getProtocol();
                String bindingType = ed.getBindingType();
               
                if (log.isDebugEnabled()) {
                    log.debug("Checking for matching binding types.");
                    log.debug("    message protocol: " + protocol);
                    log.debug("        binding type: " + bindingType);
                }
               
                if (protocol.equals(Protocol.soap11)) {
                  return (BindingUtils.isSOAP11Binding(bindingType));
                } else if (protocol.equals(Protocol.soap12)) {
                  return (BindingUtils.isSOAP12Binding(bindingType));                
                } else if (protocol.equals(Protocol.rest)) {
                    return HTTPBinding.HTTP_BINDING.equalsIgnoreCase(bindingType);
                }               
            }
            else {
                if (log.isDebugEnabled()) {
View Full Code Here

     * @param serviceDesc
     * @return
     */
    public static boolean bindingTypesMatch(MessageContext mc, EndpointDescription ed) {
       
        Protocol protocol = mc.getMessage().getProtocol();
        String bindingType = ed.getBindingType();
       
        if (log.isDebugEnabled()) {
            log.debug("Checking for matching binding types.");
            log.debug("    message protocol: " + protocol);
            log.debug("        binding type: " + bindingType);
        }
       
        if (protocol.equals(Protocol.soap11)) {
                return (BindingUtils.isSOAP11Binding(bindingType));
        } else if (protocol.equals(Protocol.soap12)) {
                return (BindingUtils.isSOAP12Binding(bindingType));                    
        } else if (protocol.equals(Protocol.rest)) {
            return HTTPBinding.HTTP_BINDING.equalsIgnoreCase(bindingType);
        }              
        return true;
    }
View Full Code Here

    public Message marshalRequest(Object[] signatureArguments, OperationDescription operationDesc)
            throws WebServiceException {

        EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
        EndpointDescription endpointDesc = ed.getEndpointDescription();
        Protocol protocol = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID());

        // Note all exceptions are caught and rethrown with a WebServiceException
        try {

            // Sample RPC message
View Full Code Here

        SOAPEnvelope soapEnv = msgContext.getEnvelope();
        if (soapEnv != null) {
            MessageFactory msgFactory =
                    (MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
            try {
                Protocol protocol = msgContext.isDoingREST() ? Protocol.rest : null;
                message = msgFactory.createFrom(soapEnv, protocol);
            } catch (Exception e) {
                throw ExceptionFactory.makeWebServiceException("Could not create new Message");
            }
View Full Code Here

    public Message marshalRequest(Object[] signatureArguments, OperationDescription operationDesc)
            throws WebServiceException {

        EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
        EndpointDescription endpointDesc = ed.getEndpointDescription();
        Protocol protocol = Protocol.getProtocolForBinding(endpointDesc.getClientBindingID());

        // Note all exceptions are caught and rethrown with a WebServiceException
        try {

            // Sample Document message
View Full Code Here

        initialize(mc);
        OperationDescription operationDesc =
                getOperationDescription(mc); //mc.getOperationDescription();
        //Set SOAP Operation Related properties in SOAPMessageContext.
        ContextUtils.addWSDLProperties(mc);
        Protocol requestProtocol = mc.getMessage().getProtocol();
        MethodMarshaller methodMarshaller =
                getMethodMarshaller(mc.getMessage().getProtocol(), mc.getOperationDescription());
        Object[] methodInputParams =
                methodMarshaller.demarshalRequest(mc.getMessage(), mc.getOperationDescription());
        Method target = getJavaMethod(mc, serviceImplClass);
View Full Code Here

         * anywhere to be found...
         */
        ic.setHandlers(new HandlerResolverImpl(endpointDesc).getHandlerChain(endpointDesc.getPortInfo()));
       
        if (!bindingTypesMatch(requestMsgCtx, endpointDesc.getServiceDescription())) {
            Protocol protocol = requestMsgCtx.getMessage().getProtocol();
            // only if protocol is soap12 and MISmatches the endpoint do we halt processing
            if (protocol.equals(Protocol.soap12)) {
                ic.setResponseMessageContext(createMismatchFaultMsgCtx(requestMsgCtx,
                                                                       "Incoming SOAP message protocol is version 1.2, but endpoint is configured for SOAP 1.1"));
                return ic;
            } else if (protocol.equals(Protocol.soap11)) {
                // SOAP 1.1 message and SOAP 1.2 binding

                // The canSupport flag indicates that we can support this scenario.
                // Possible Examples of canSupport:  JAXB impl binding, JAXB Provider
                // Possible Example of !canSupport: Application handler usage, non-JAXB Provider
View Full Code Here

        // compare soap versions and respond appropriately under SOAP 1.2 Appendix 'A'
        Collection<EndpointDescription> eds = serviceDesc.getEndpointDescriptions_AsCollection();
        // dispatch endpoints do not have SEIs, so watch out for null or empty array
        if ((eds != null) && (eds.size() > 0)) {
            EndpointDescription ed = eds.iterator().next();
            Protocol protocol = requestMsgCtx.getMessage().getProtocol();
            String endpointBindingType = ed.getBindingType();
            if (protocol.equals(Protocol.soap11)) {
                return (SOAPBinding.SOAP11HTTP_BINDING.equalsIgnoreCase(endpointBindingType)) ||
                        (SOAPBinding.SOAP11HTTP_MTOM_BINDING.equalsIgnoreCase(endpointBindingType));
            } else if (protocol.equals(Protocol.soap12)) {
                return (SOAPBinding.SOAP12HTTP_BINDING.equalsIgnoreCase(endpointBindingType)) ||
                        (SOAPBinding.SOAP12HTTP_MTOM_BINDING.equalsIgnoreCase(endpointBindingType));
            } else if (protocol.equals(Protocol.rest)) {
                return HTTPBinding.HTTP_BINDING.equalsIgnoreCase(endpointBindingType);
            }
        }
        // safe to assume?
        return true;
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.message.Protocol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.