Package org.jibx.ws

Examples of org.jibx.ws.WsConfigurationException


            if (m_outBodyBindingFactory == null && m_inBodyBindingFactory == null && clas != null) {
                try {
                    m_outBodyBindingFactory = BindingDirectory.getFactory(clas);
                    m_inBodyBindingFactory = m_outBodyBindingFactory;
                } catch (JiBXException e) {
                    throw new WsConfigurationException(
                        "Unable to create service since bindings not compiled for class " + clas.getName(), e);
                }
            }
            if (hasInputs && (m_inBodyBindingFactory == null)) {
                throw new WsConfigurationException("Binding factories must be defined for body of inbound messages");
            }
            if (hasOutputs && (m_outBodyBindingFactory == null)) {
                throw new WsConfigurationException("Binding factories must be defined for body of outbound messages");
            }
           
            if (sdef.getOutputCompletionListenerObject() != null) {
                m_outputCompletionListener = sdef.getOutputCompletionListenerObject();
            } else if (sdef.getOutputCompletionListenerClass() != null) {
                m_outputCompletionListener =
                    (OutputCompletionListener) sdef.getOutputCompletionListenerClass().newInstance();
            }
           
            m_xmlOptions = sdef.getXmlOptions();

            Collection transportOptionsDefinitions = sdef.getTransportOptionsDefinitions();
            if (transportOptionsDefinitions.size() > 0) {
                m_transportOptionsMap = new HashMap();
                for (Iterator iterator = transportOptionsDefinitions.iterator(); iterator.hasNext();) {
                    TransportOptionsDefinition def = (TransportOptionsDefinition) iterator.next();
                    TransportOptions transportOptions = def.createTransportOptions();
                    m_transportOptionsMap.put(transportOptions.getClass().getName(), transportOptions);
                }
            }
       
            try {
                if (sdef.getWsdlFilepath() != null) {
                    InputStream wsdlStream = Service.class.getResourceAsStream(sdef.getWsdlFilepath());
                    if (wsdlStream == null) {
                        throw new WsConfigurationException("Unable to open WSDL file '" + sdef.getWsdlFilepath() + "'");
                    }
                    WsdlProvider wsdlProvider = new InputStreamWsdlProvider(wsdlStream);
                    if (sdef.getWsdlLocationTransform()) {
                        wsdlProvider = new WsdlLocationToRequestUrlAdapter(wsdlProvider);
                    }
                    setWsdlProvider(wsdlProvider);
                }
            } catch (IOException e) {
                throw new WsConfigurationException("Error reading WSDL file '" + sdef.getWsdlFilepath() + "'");
            }
        } catch (InstantiationException e) {
            throw new WsException("Error creating endpoint service object", e);
        } catch (IllegalAccessException e) {
            throw new WsException("Unable to create endpoint service object", e);
View Full Code Here

TOP

Related Classes of org.jibx.ws.WsConfigurationException

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.