Package javax.xml.ws

Examples of javax.xml.ws.WebServiceException


        try {
            for (Handler handler : handlers) {
                injectResources(handler);
            }
        } catch (AnnotationException e) {
            throw new WebServiceException("Handler annotation failed", e);
        }
    }
View Full Code Here


     */
    public static WebServiceException makeWebServiceException(String message, Throwable throwable) {
        try {
            // See if there is already a WebServiceException (Note that the returned exception could be a ProtocolException or
            // other kind of exception)
            WebServiceException e =
                    (WebServiceException)findException(throwable, WebServiceException.class);
            if (e == null) {
                e = createWebServiceException(message, throwable);
            }
            return e;
View Full Code Here

     * @return WebServiceException
     */
    private static WebServiceException createWebServiceException(String message, Throwable t) {

        // We might have an embedded WebServiceException that has a good message on it
        WebServiceException me = (WebServiceException)findException(t, WebServiceException.class);
        if (me != null) {
            String meMessage = me.getMessage();
            if (meMessage != null) {
                if (message == null) {
                    message = meMessage;
                } else {
                    message = message + ": " + meMessage;
                }
            }
        }

        // Get the root cause.  We want to strip out the intermediate exceptions (like AxisFault) because
        // these won't make sense to the user.
        Throwable rootCause = null;
        if (t != null) {
            rootCause = getRootCause(t);
        }
        rootCause = rootCause == null ? t : rootCause;
        WebServiceException e = null;

        // The root cause may not have a good message.  We might want to enhance it
        String enhancedMessage = enhanceMessage(rootCause);
        if (enhancedMessage != null) {
            if (message != null)
                message = message + ": " + enhancedMessage;
            else
                message = enhancedMessage;
        }

        if (message != null) {
            e = new WebServiceException(message, rootCause);
        } else {
            e = new WebServiceException(rootCause);
        }

        if (log.isDebugEnabled()) {
            log.debug("Create Exception:", e);
        }
View Full Code Here

                        if (feature instanceof RespectBindingFeature && feature.isEnabled()) {
                           
                            org.apache.cxf.common.i18n.Message message =
                                new org.apache.cxf.common.i18n.Message("UNKONWN_REQUIRED_WSDL_BINDING", LOG);
                            LOG.severe(message.toString());
                            throw new WebServiceException(message.toString());
                        }
                    }
                }
            }
        }
View Full Code Here

                stop();
            } catch (Exception e) {
                // Nothing we can do.
            }
           
            throw new WebServiceException(ex);
        } finally {
            if (loader != null) {
                loader.reset();
            }
        }
View Full Code Here

        this.schemaLocations = schemaLocations;
    }
   
    public EndpointReference getEndpointReference(Element... referenceParameters) {
        if (!isPublished()) {
            throw new WebServiceException(new org.apache.cxf.common.i18n.Message("ENDPOINT_NOT_PUBLISHED",
                                                                                 LOG).toString());
        }

        if (getBinding() instanceof HTTPBinding) {       
            throw new UnsupportedOperationException(new org.apache.cxf.common.i18n.Message(
View Full Code Here

    public <T extends EndpointReference> T getEndpointReference(Class<T> clazz,
                                                                Element... referenceParameters) {
        if (W3CEndpointReference.class.isAssignableFrom(clazz)) {
            return clazz.cast(getEndpointReference(referenceParameters));
        } else {
            throw new WebServiceException(new org.apache.cxf.common.i18n.Message(
                "ENDPOINTREFERENCE_TYPE_NOT_SUPPORTED", LOG, clazz
                .getName()).toString());
        }
    }
View Full Code Here

                if (null != uri) {
                    try {
                        url = uri.toURL();
                    } catch (MalformedURLException e) {
                        LOG.log(Level.FINE, "resolve qname failed", name);
                        throw new WebServiceException(e);
                    }
                }
            }
        }

        wsdlURL = url == null ? null : url.toString();
       
        if (url != null) {
            try {
                initializePorts();
            } catch (ServiceConstructionException e) {
                throw new WebServiceException(e);
            }
        }
    }
View Full Code Here

    private void initializePorts() {
        try {
            Definition def = bus.getExtension(WSDLManager.class).getDefinition(wsdlURL);
            javax.wsdl.Service serv = def.getService(serviceName);
            if (serv == null) {
                throw new WebServiceException("Could not find service named " + serviceName
                                              + " in wsdl " + wsdlURL);
            }
           
            Map<String, Port> wsdlports = CastUtils.cast(serv.getPorts());
            for (Port port : wsdlports.values()) {
View Full Code Here

                PortInfoImpl portInfo = getPortInfo(portName);
                if (null != portInfo) {
                    try {
                        ei = createEndpointInfo(sf, portName, portInfo);
                    } catch (BusException e) {
                        throw new WebServiceException(e);
                    }
                }
            }
        }

        if (ei == null) {
            Message msg = new Message("INVALID_PORT", BUNDLE, portName);
            throw new WebServiceException(msg.toString());
        }

        try {
            return new JaxWsClientEndpointImpl(bus, service, ei, this, features);
        } catch (EndpointException e) {
            throw new WebServiceException(e);
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.ws.WebServiceException

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.