Example usage for javax.xml.ws.soap SOAPBinding SOAP11HTTP_BINDING

List of usage examples for javax.xml.ws.soap SOAPBinding SOAP11HTTP_BINDING

Introduction

In this page you can find the example usage for javax.xml.ws.soap SOAPBinding SOAP11HTTP_BINDING.

Prototype

String SOAP11HTTP_BINDING

To view the source code for javax.xml.ws.soap SOAPBinding SOAP11HTTP_BINDING.

Click Source Link

Document

A constant representing the identity of the SOAP 1.1 over HTTP binding.

Usage

From source file:org.apache.axis2.jaxws.client.dispatch.BaseDispatch.java

private boolean isValidInvocationParam(Object object) {
    String bindingId = endpointDesc.getClientBindingID();

    // If no bindingId was found, use the default.
    if (bindingId == null) {
        bindingId = SOAPBinding.SOAP11HTTP_BINDING;
    }/*from  w  ww  .  j  a va 2 s.  co  m*/

    // If it's not an HTTP_BINDING, then we can allow for null params,  
    // but only in PAYLOAD mode per JAX-WS Section 4.3.2.
    if (!bindingId.equals(HTTPBinding.HTTP_BINDING)) {
        if (mode.equals(Mode.MESSAGE) && object == null) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchNullParamMessageMode"));
        }
    } else {
        // In all cases (PAYLOAD and MESSAGE) we must throw a WebServiceException
        // if the parameter is null and request method is POST or PUT.
        if (object == null && isPOSTorPUTRequest()) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchNullParamHttpBinding"));
        }
    }

    if (object instanceof DOMSource) {
        DOMSource ds = (DOMSource) object;
        if (ds.getNode() == null && ds.getSystemId() == null) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("dispatchBadDOMSource"));
        }
    }

    // If we've gotten this far, then all is good.
    return true;
}

From source file:org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.java

/**
 * This will set up the arguments that will be used by the WsGen tool.
 *//* w w  w .  j a va  2 s .co  m*/
private String[] getWsGenArguments(String className, String bindingType, String localOutputDirectory)
        throws WebServiceException {
    String[] arguments = null;
    if (bindingType == null || bindingType.equals("") || bindingType.equals(SOAPBinding.SOAP11HTTP_BINDING)
            || bindingType.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)) {
        if (log.isDebugEnabled()) {
            log.debug("Generating WSDL with SOAP 1.1 binding type");
        }
        arguments = new String[] { "-cp", classPath, className, "-keep", "-wsdl:soap1.1", "-d",
                localOutputDirectory };
    } else if (bindingType.equals(SOAPBinding.SOAP12HTTP_BINDING)
            || bindingType.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
        if (log.isDebugEnabled()) {
            log.debug("Generating WSDL with SOAP 1.2 binding type");
        }
        arguments = new String[] { "-cp", classPath, className, "-keep", "-extension", "-wsdl:Xsoap1.2", "-d",
                localOutputDirectory };
    } else {
        throw new WebServiceException("The binding " + bindingType + " specified by the " + "class " + className
                + " cannot be used to generate a WSDL. Please choose " + "a supported binding type.");
    }
    return arguments;
}

From source file:org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.java

private synchronized void initialize(AxisService service) {
    String className = (String) axisService.getParameter(Constants.SERVICE_CLASS).getValue();
    if (!init) {/*from   www.j a va 2s. com*/
        generateWsdl(className, SOAPBinding.SOAP11HTTP_BINDING, getCatalogManager(service));
        init = true;
    }
}

From source file:org.apache.axis2.jaxws.description.impl.DescriptionUtils.java

/**
 * Given a binding type value based on a JAXWS anntation, return the corresponding WSDL
 * binding type.  The JAXWS annotation values understood are those returned by
 * mapBindingTypeWsdltoAnnotation.//from w w  w .j a v  a2s.c  o  m
 * 
 * @see #mapBindingTypeWsdlToAnnotation(String, String)
 * 
 * @param annotationBindingType The binding type as represented by a JAXWS annotation value
 * @return The binding type as represented by a WSDL binding extension namespace value
 */
public static String mapBindingTypeAnnotationToWsdl(String annotationBindingType) {
    String wsdlBindingType = null;

    if (SOAPBinding.SOAP11HTTP_BINDING.equals(annotationBindingType)
            || MDQConstants.SOAP11JMS_BINDING.equals(annotationBindingType)) {
        wsdlBindingType = EndpointDescriptionWSDL.SOAP11_WSDL_BINDING;
    } else if (SOAPBinding.SOAP12HTTP_BINDING.equals(annotationBindingType)
            || MDQConstants.SOAP12JMS_BINDING.equals(annotationBindingType)) {
        wsdlBindingType = EndpointDescriptionWSDL.SOAP12_WSDL_BINDING;
    } else if (javax.xml.ws.http.HTTPBinding.HTTP_BINDING.equals(annotationBindingType)) {
        wsdlBindingType = EndpointDescriptionWSDL.HTTP_WSDL_BINDING;
    }

    return wsdlBindingType;
}

From source file:org.apache.axis2.jaxws.description.impl.DescriptionUtils.java

/**
 * Given a binding type value based on WSDL, return the corresponding JAXWS annotation value.
 * The WSDL binding type values are based on the namespace of the binding extension element.
 * The JAXWS annotation values correspond to the values to the HTTPBinding and SOAPBinding
 * annotations.  Additionally, proprietary values for JMS bindings are supported.  The JAXWS
 * binding type annotation values returned could be from SOAPBinding or HTTPBinding.
 * //w w  w. ja  v  a 2  s  .  co  m
 * @param wsdlBindingType The binding type as represnted by the WSDL binding extension namespace
 * @param soapTransport The WSDL transport.  Used to determine if a JMS binding type should
 * be returned
 * @return The binding represented by a JAXWS Binding Type Annotation value from either 
 * SOAPBinding or HTTPBinding.
 */
public static String mapBindingTypeWsdlToAnnotation(String wsdlBindingType, String soapTransport) {
    String soapBindingType = null;
    if (EndpointDescriptionWSDL.SOAP11_WSDL_BINDING.equals(wsdlBindingType)) {
        if (MDQConstants.SOAP11JMS_BINDING.equals(soapTransport)) {
            soapBindingType = MDQConstants.SOAP11JMS_BINDING;
        } else {
            //REVIEW: We are making the assumption that if not JMS, then HTTP
            soapBindingType = SOAPBinding.SOAP11HTTP_BINDING;
        }
    } else if (EndpointDescriptionWSDL.SOAP12_WSDL_BINDING.equals(wsdlBindingType)) {
        if (MDQConstants.SOAP12JMS_BINDING.equals(soapTransport)) {
            soapBindingType = MDQConstants.SOAP12JMS_BINDING;
        } else {
            //REVIEW: We are making the assumption that if not JMS, then HTTP
            soapBindingType = SOAPBinding.SOAP12HTTP_BINDING;
        }
    } else if (EndpointDescriptionWSDL.HTTP_WSDL_BINDING.equals(wsdlBindingType)) {
        soapBindingType = javax.xml.ws.http.HTTPBinding.HTTP_BINDING;
    }
    return soapBindingType;
}

From source file:org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.java

/**
 * Create a service-provider side EndpointDescription based on the DescriptionBuilderComposite. 
 * Note that per the//w w w .  j  a  va2  s  .c o  m
 * JAX-WS Spec (Final Release, 4/19/2006 Section 4.2.3 Proxies, page 55)the "namespace component
 * of the port is the target namespace of the WSDL definition document".
 *
 * @param theClass The SEI or Impl class.  This will be NULL for Dispatch clients since they
 *                 don't use an SEI
 */
EndpointDescriptionImpl(ServiceDescriptionImpl parent, String serviceImplName, Map<String, Object> properties,
        Integer portCompositeIndex) {

    if (log.isDebugEnabled()) {
        log.debug(
                "entry EndpointDescriptionImpl(ServiceDescriptionImpl, String, Map<String, Object>, Integer)");
        log.debug("  parent=" + parent);
        log.debug("  serviceImplName=" + parent);
        log.debug("  portCompositeIndex=" + portCompositeIndex);
    }

    this.axisConfig = parent.getAxisConfigContext().getAxisConfiguration();

    // initialize CustomAnnotationIntance list and CustomAnnotationProcessor map
    customAnnotations = new ArrayList<CustomAnnotationInstance>();
    customAnnotationProcessors = new HashMap<String, CustomAnnotationProcessor>();
    this.portCompositeIndex = portCompositeIndex;

    // set properties map
    this.properties = properties;

    this.parentServiceDescription = parent;
    this.serviceImplName = serviceImplName;

    // if the ServiceDescription's service QName is specified, let's use that to get the
    // correct DescriptionBuilderComposite
    if (parent.getServiceQName() != null) {
        composite = getServiceDescriptionImpl().getDescriptionBuilderComposite(parent.getServiceQName(),
                portCompositeIndex);
    }

    // otherwise we will get the DescriptionBuilderComposite by the current index
    else {
        composite = getServiceDescriptionImpl().getDescriptionBuilderComposite(null, portCompositeIndex);
    }

    if (composite == null) {
        throw ExceptionFactory.makeWebServiceException(Messages.getMessage("endpointDescriptionErr3"));
    }

    if (composite.getHandlerChainAnnot() != null && composite.getHandlerChainsType() != null) {
        throw ExceptionFactory
                .makeWebServiceException(Messages.getMessage("handlerSourceFail", composite.getClassName()));
    }

    handlerChainsType = composite.getHandlerChainsType();

    //Set the base level of annotation that we are processing...currently
    // a 'WebService' or a 'WebServiceProvider'
    if (composite.getWebServiceAnnot() != null)
        webServiceAnnotation = composite.getWebServiceAnnot();
    else
        webServiceProviderAnnotation = composite.getWebServiceProviderAnnot();

    // now get the custom annotation and process information from the DBC
    customAnnotations.addAll(composite.getCustomAnnotationInstances());
    customAnnotationProcessors.putAll(composite.getCustomAnnotationProcessors());

    // Note that on the client side, the service QN should be set; on the server side it will not be.
    if (DescriptionUtils.isEmpty(getServiceDescription().getServiceQName())) {
        getServiceDescriptionImpl().setServiceQName(getServiceQName());
    }
    //Call the getter to insure the qualified port name is set. 
    getPortQName();

    setupAxisServiceFromDBL();
    addToAxisService(); //Add a reference to this EndpointDescription to the AxisService

    buildDescriptionHierachy();

    WsdlComposite wsdlComposite = null;

    String bindingType = getBindingType();

    boolean isSOAP11 = (bindingType.equals(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING)
            || bindingType.equals(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING)) ? true : false;

    // Determine if we need to generate WSDL
    // First, make sure that this is only a SOAP 1.1 based binding, per JAXWS spec. we cannot 
    // generate WSDL if the binding type is not SOAP 1.1 based.
    // Then, assuming the composite does not contain a 
    // Wsdl Definition, go ahead and generate it
    if (isSOAP11) {
        if ((isEndpointBased() && DescriptionUtils.isEmpty(getAnnoWebServiceEndpointInterface()))
                || (!isEndpointBased())) {
            //This is either an implicit SEI, or a WebService Provider

            wsdlComposite = generateWSDL(composite);

        } else if (isEndpointBased()) {
            //This impl class specifies an SEI...this is a special case. There is a bug
            //in the tooling that allows for the wsdllocation to be specifed on either the
            //impl. class, or the SEI, or both. So, we need to look for the wsdl as follows:
            //         1. If the Wsdl exists on the SEI, then check for it on the impl.
            //         2. If it is not found in either location, in that order, then generate

            DescriptionBuilderComposite seic = getServiceDescriptionImpl().getDBCMap()
                    .get(composite.getWebServiceAnnot().endpointInterface());

            //Only generate WSDL if a definition doesn't already exist
            if (seic.getWsdlDefinition() == null)
                wsdlComposite = generateWSDL(composite);
        }

    } else if (composite.getWsdlDefinition() == null) {
        //This is a SOAP12 binding that does not contain a WSDL definition, log a WARNING
        log.warn(Messages.getMessage("generateWSDLNonSoap11", composite.getClassName()));
    }

    if (isSOAP11) {

        //Save the WSDL Location and the WsdlDefinition, value depends on whether wsdl was generated
        Parameter wsdlLocationParameter = new Parameter();
        wsdlLocationParameter.setName(MDQConstants.WSDL_LOCATION);

        Parameter wsdlDefParameter = new Parameter();
        wsdlDefParameter.setName(MDQConstants.WSDL_DEFINITION);

        Parameter wsdlCompositeParameter = new Parameter();
        wsdlCompositeParameter.setName(MDQConstants.WSDL_COMPOSITE);

        if (wsdlComposite != null) {

            //We have a wsdl composite, so set these values for the generated wsdl
            wsdlCompositeParameter.setValue(wsdlComposite);
            wsdlLocationParameter.setValue(wsdlComposite.getWsdlFileName());

            Definition def = getServiceDescriptionImpl().getGeneratedWsdlWrapper().getDefinition();
            URL wsdlUrl = getServiceDescriptionImpl().getGeneratedWsdlWrapper().getWSDLLocation();
            if (def instanceof WSDLDefinitionWrapper) {
                wsdlDefParameter.setValue(def);
            } else {
                // Create WSDLDefinitionWrapper
                WSDLDefinitionWrapper wrap = null;
                ConfigurationContext cc = composite.getConfigurationContext();
                if (cc != null && cc.getAxisConfiguration() != null) {
                    wrap = new WSDLDefinitionWrapper(def, wsdlUrl, cc.getAxisConfiguration());
                } else {
                    // Probably shouldn't get here.  But if we do, use
                    // a memory sensitve wsdl wrapper
                    wrap = new WSDLDefinitionWrapper(def, wsdlUrl, true, 2);
                }
                wsdlDefParameter.setValue(wrap);
            }

        } else if (getServiceDescriptionImpl().getWSDLWrapper() != null) {
            //No wsdl composite because wsdl already exists

            wsdlLocationParameter.setValue(getAnnoWebServiceWSDLLocation());

            Definition def = getServiceDescriptionImpl().getWSDLWrapper().getDefinition();
            URL wsdlUrl = getServiceDescriptionImpl().getWSDLWrapper().getWSDLLocation();
            if (def instanceof WSDLDefinitionWrapper) {
                wsdlDefParameter.setValue(def);
            } else {
                // Create WSDLDefinitionWrapper
                WSDLDefinitionWrapper wrap = null;
                ConfigurationContext cc = composite.getConfigurationContext();
                if (cc != null && cc.getAxisConfiguration() != null) {
                    wrap = new WSDLDefinitionWrapper(def, wsdlUrl, cc.getAxisConfiguration());
                } else {
                    // Probably shouldn't get here.  But if we do, use
                    // a memory sensitve wsdl wrapper
                    wrap = new WSDLDefinitionWrapper(def, wsdlUrl, true, 2);
                }
                wsdlDefParameter.setValue(wrap);
            }

        } else {
            //There is no wsdl composite and there is NOT a wsdl definition
            wsdlLocationParameter.setValue(null);
            wsdlDefParameter.setValue(null);

        }

        try {
            if (wsdlComposite != null) {
                axisService.addParameter(wsdlCompositeParameter);
            }
            axisService.addParameter(wsdlDefParameter);
            axisService.addParameter(wsdlLocationParameter);
        } catch (Exception e) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("endpointDescriptionErr4"));
        }
    } else {
        // Need to account for SOAP 1.2 WSDL when supplied with application
        Parameter wsdlDefParameter = new Parameter();
        wsdlDefParameter.setName(MDQConstants.WSDL_DEFINITION);
        Parameter wsdlLocationParameter = new Parameter();
        wsdlLocationParameter.setName(MDQConstants.WSDL_LOCATION);
        if (getServiceDescriptionImpl().getWSDLWrapper() != null) {
            wsdlLocationParameter.setValue(getAnnoWebServiceWSDLLocation());

            Definition def = getServiceDescriptionImpl().getWSDLWrapper().getDefinition();
            URL wsdlUrl = getServiceDescriptionImpl().getWSDLWrapper().getWSDLLocation();
            if (def instanceof WSDLDefinitionWrapper) {
                wsdlDefParameter.setValue(def);
            } else {
                // Create WSDLDefinitionWrapper
                WSDLDefinitionWrapper wrap = null;
                ConfigurationContext cc = composite.getConfigurationContext();
                if (cc != null && cc.getAxisConfiguration() != null) {
                    wrap = new WSDLDefinitionWrapper(def, wsdlUrl, cc.getAxisConfiguration());
                } else {
                    // Probably shouldn't get here.  But if we do, use
                    // a memory sensitve wsdl wrapper
                    wrap = new WSDLDefinitionWrapper(def, wsdlUrl, true, 2);
                }
                wsdlDefParameter.setValue(wrap);
            }
        }
        // No WSDL supplied and we do not generate for non-SOAP 1.1/HTTP
        // endpoints
        else {
            wsdlLocationParameter.setValue(null);
            wsdlDefParameter.setValue(null);
        }
        try {
            axisService.addParameter(wsdlDefParameter);
            axisService.addParameter(wsdlLocationParameter);

        } catch (Exception e) {
            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("endpointDescriptionErr4"), e);
        }
    }

    // Before we leave we need to drive the CustomAnnotationProcessors if 
    // there were any CustomAnnotationInstance objects registered
    Iterator<CustomAnnotationInstance> annotationIter = customAnnotations.iterator();
    while (annotationIter.hasNext()) {
        CustomAnnotationInstance annotation = annotationIter.next();
        if (log.isDebugEnabled()) {
            log.debug("Checking for CustomAnnotationProcessor for CustomAnnotationInstance " + "class: "
                    + annotation.getClass().getName());
        }
        CustomAnnotationProcessor processor = customAnnotationProcessors.get(annotation.getClass().getName());
        if (processor != null) {
            if (log.isDebugEnabled()) {
                log.debug("Found CustomAnnotationProcessor: " + processor.getClass().getName()
                        + " for CustomAnnotationInstance: " + annotation.getClass().getName());
            }
            processor.processTypeLevelAnnotation(this, annotation);
        }
    }

    // Configure any available WebServiceFeatures on the endpoint.
    configureWebServiceFeatures();

    // REVIEW: there are some throws above that won't cause the release
    setupReleaseResources(composite.getConfigurationContext());
    releaseAxisServiceResources();
    if (log.isDebugEnabled()) {
        log.debug("exit EndpointDescriptionImpl(ServiceDescriptionImpl, String, Map<String, Object>, Integer)");
    }
}

From source file:org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.java

private void buildEndpointDescriptionFromAnnotations() {
    // TODO: The comments below are not quite correct; this method is used on BOTH the 
    //       client and server.  On the client the class is always an SEI.  On the server it 
    //       is always a service impl which may be a provider or endpoint based;
    //       endpoint based may reference an SEI class

    // The Service Implementation class could be either Provider-based or Endpoint-based.  The 
    // annotations that are present are similar but different.  Conformance requirements 
    // per JAX-WS
    // - A Provider based implementation MUST carry the @WebServiceProvider annotation
    //   per section 5.1 javax.xml.ws.Provider on page 63
    // - An Endpoint based implementation MUST carry the @WebService annotation per JSR-181 
    //   (reference TBD) and JAX-WS (reference TBD)
    // - An Endpoint based implementation @WebService annotation MAY reference an endpoint
    //   interface 
    // - The @WebService and @WebServiceProvider annotations can not appear in the same class per 
    //   JAX-WS section 7.7 on page 82.

    // If portName was specified, set it.  Otherwise, we will get it from the appropriate
    // annotation when the getter is called.

    // If this is an Endpoint-based service implementation (i.e. not a 
    // Provider-based one), then create the EndpointInterfaceDescription to contain
    // the operations on the endpoint.  Provider-based endpoints don't have operations
    // associated with them, so they don't have an EndpointInterfaceDescription.
    if (webServiceAnnotation != null) {
        // If this impl class references an SEI, then use that SEI to create the EndpointInterfaceDesc.
        String seiClassName = getAnnoWebServiceEndpointInterface();

        if (!composite.isServiceProvider()) {
            Class seiClass = null;
            if (DescriptionUtils.isEmpty(seiClassName)) {
                // This is the client code path; the @WebServce will not have an endpointInterface member
                // For now, just build the EndpointInterfaceDesc based on the class itself.
                seiClass = composite.getCorrespondingClass();
            }//from ww  w  .jav  a  2  s  . c om
            endpointInterfaceDescription = new EndpointInterfaceDescriptionImpl(seiClass, this);
        } else {
            if (DescriptionUtils.isEmpty(getAnnoWebServiceEndpointInterface())) {

                endpointInterfaceDescription = new EndpointInterfaceDescriptionImpl(composite, true, this);

            } else {
                //Otherwise, build the EID based on the SEI composite
                endpointInterfaceDescription = new EndpointInterfaceDescriptionImpl(
                        getServiceDescriptionImpl().getDBCMap().get(seiClassName), false, this);

                // after this is constructed, we need to update the @WebService.name 
                // attribute on the axisService instance
                if (axisService != null) {
                    updateWebServiceNameParameter(
                            ((EndpointInterfaceDescriptionImpl) endpointInterfaceDescription)
                                    .getAnnoWebServiceName(),
                            axisService);
                }
            }
        }
    } else {
        if (log.isDebugEnabled()) {
            log.debug("WebServiceProvider without WSDL encountered");
        }
        String bindingType = getBindingType();
        if (javax.xml.ws.http.HTTPBinding.HTTP_BINDING.equals(bindingType)
                || SOAPBinding.SOAP11HTTP_BINDING.equals(bindingType)
                || SOAPBinding.SOAP12HTTP_BINDING.equals(bindingType)
                || MDQConstants.SOAP_HTTP_BINDING.equals(bindingType)) {
            endpointInterfaceDescription = new EndpointInterfaceDescriptionImpl(composite, this);
        }
    }
}

From source file:org.apache.axis2.jaxws.description.impl.EndpointDescriptionImpl.java

private boolean validateClientBindingID(String bindingId) {
    boolean isValid = true;
    if (bindingId != null && !(bindingId.equals(SOAPBinding.SOAP11HTTP_BINDING)
            || bindingId.equals(javax.xml.ws.http.HTTPBinding.HTTP_BINDING)
            || bindingId.equals(SOAPBinding.SOAP12HTTP_BINDING)
            || bindingId.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
            || bindingId.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)
            || bindingId.equals(MDQConstants.SOAP11JMS_BINDING)
            || bindingId.equals(MDQConstants.SOAP12JMS_BINDING)
            || bindingId.equals(MDQConstants.SOAP11JMS_MTOM_BINDING)
            || bindingId.equals(MDQConstants.SOAP12JMS_MTOM_BINDING))) {
        throw ExceptionFactory
                .makeWebServiceException(Messages.getMessage("addPortErr0", getPortQName().toString()));
    }/*from  ww  w.ja  v a 2s  .  c o  m*/
    return isValid;
}

From source file:org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.java

/**
 * Validate that, if using PAYLOAD mode, then interfaces list cannot contain SOAPMessage or
 * DataSource/* w ww  .  ja va2s . co  m*/
 *
 * @return
 */
private void validateProviderInterfaces() {

    // Default for ServiceMode is 'PAYLOAD'. So, if it is specified  (explicitly or
    // implicitly) then verify that we are not implementing improper interfaces)
    if ((composite.getServiceModeAnnot() == null)
            || composite.getServiceModeAnnot().value() == javax.xml.ws.Service.Mode.PAYLOAD) {

        Iterator<String> iter = composite.getInterfacesList().iterator();

        while (iter.hasNext()) {
            String interfaceString = iter.next();
            if (interfaceString.equals(MDQConstants.PROVIDER_SOAP)
                    || interfaceString.equals(MDQConstants.PROVIDER_DATASOURCE)) {

                throw ExceptionFactory.makeWebServiceException(
                        Messages.getMessage("validatePIsErr1", composite.getClassName()));
            }
        }

    } else {
        // We are in MESSAGE mode
        // Conformance: JAXWS Spec.- Sec. 4.3 (javax.activation.DataSource)

        // REVIEW: Should the provider interface validation be moved to post-construction validation, 
        // since it seems that the logic to understand the default values for binding type 
        // (see comment below) should be left to the creation of the Description objects.
        String bindingType = null;
        if (composite.getBindingTypeAnnot() != null) {
            bindingType = composite.getBindingTypeAnnot().value();
        }

        Iterator<String> iter = composite.getInterfacesList().iterator();

        while (iter.hasNext()) {
            String interfaceString = iter.next();

            if (interfaceString.equals(MDQConstants.PROVIDER_SOAP)) {

                // Make sure BindingType is SOAP/HTTP with SOAPMessage
                // object, Default for Binding Type is SOAP/HTTP
                if (!DescriptionUtils.isEmpty(bindingType)
                        && !bindingType.equals(SOAPBinding.SOAP11HTTP_BINDING)
                        && !bindingType.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
                        && !bindingType.equals(SOAPBinding.SOAP12HTTP_BINDING)
                        && !bindingType.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)
                        && !bindingType.equals(MDQConstants.SOAP11JMS_BINDING)
                        && !bindingType.equals(MDQConstants.SOAP11JMS_MTOM_BINDING)
                        && !bindingType.equals(MDQConstants.SOAP12JMS_BINDING)
                        && !bindingType.equals(MDQConstants.SOAP12JMS_MTOM_BINDING)
                        && !bindingType.equals(MDQConstants.SOAP_HTTP_BINDING))

                    throw ExceptionFactory.makeWebServiceException(
                            Messages.getMessage("validatePIsErr2", composite.getClassName()));

            } else if (interfaceString.equals(MDQConstants.PROVIDER_DATASOURCE)) {

                // Make sure BindingType is XML/HTTP with DataSource object
                if (DescriptionUtils.isEmpty(bindingType)
                        || !bindingType.equals(javax.xml.ws.http.HTTPBinding.HTTP_BINDING))

                    throw ExceptionFactory.makeWebServiceException(
                            Messages.getMessage("validatePIsErr3", composite.getClassName()));
            }
        }
    }
}

From source file:org.jboss.wsf.test.JBossWSTestHelper.java

private static Object getImplementationObject() {
    Service service = Service.create(new QName("dummyService"));
    Object obj = service.getHandlerResolver();
    if (obj == null) {
        service.addPort(new QName("dummyPort"), SOAPBinding.SOAP11HTTP_BINDING, "http://dummy-address");
        obj = service.createDispatch(new QName("dummyPort"), Source.class, Mode.PAYLOAD);
    }/*from w  ww  . j  av a2 s.  c  o m*/
    return obj;
}