Package javax.xml.rpc

Examples of javax.xml.rpc.ServiceException


                return service.getPort(name, serviceendpointClass);
            }
        }

        // no ports have been found
        throw new ServiceException("Port-component-ref : " + name + " not found");
    }
View Full Code Here


        engine = getAxisClient();
        Document doc = null;
        try {
            doc = XMLUtils.newDocument(wsdlInputStream);
        } catch (Exception exp) {
            throw new ServiceException(
                    Messages.getMessage("wsdlError00", "" + "", "\n" + exp));
        }
        initService(null, doc, serviceName);
    }
View Full Code Here

            if (cachingWSDL && this.wsdlLocation != null)
                cachedWSDL.put(url, parser);

            initService(parser, serviceName);
        } catch (Exception exp) {
            throw new ServiceException(
                    Messages.getMessage("wsdlError00", "" + "", "\n" + exp));
        }
    }
View Full Code Here

            Parser parser = new Parser();
            parser.run(context, doc);

            initService(parser, serviceName);
        } catch (Exception exp) {
            throw new ServiceException(
                    Messages.getMessage("wsdlError00", "" + "", "\n" + exp));
        }
    }
View Full Code Here

            this.wsdlParser = parser;
            ServiceEntry serviceEntry = parser.getSymbolTable().getServiceEntry(serviceName);
            if (serviceEntry != null)
                this.wsdlService = serviceEntry.getService();
            if (this.wsdlService == null)
                throw new ServiceException(
                        Messages.getMessage("noService00", "" + serviceName));
        } catch (Exception exp) {
            throw new ServiceException(
                    Messages.getMessage("wsdlError00", "" + "", "\n" + exp));
        }
    }
View Full Code Here

     */
    public Remote getPort(QName portName, Class proxyInterface)
            throws ServiceException {

        if (wsdlService == null)
            throw new ServiceException(Messages.getMessage("wsdlMissing00"));

        Port port = wsdlService.getPort(portName.getLocalPart());
        if (port == null)
            throw new ServiceException(Messages.getMessage("noPort00", "" + portName));

        // First, try to find a generated stub.  If that
        // returns null, then find a dynamic stub.
        Remote stub = getGeneratedStub(portName, proxyInterface);
        return stub != null ? stub : getPort(null, portName, proxyInterface);
View Full Code Here

     * @return java.rmi.Remote The stub implementation
     * @throws ServiceException If there's an error
     */
    public Remote getPort(Class proxyInterface) throws ServiceException {
        if (wsdlService == null)
            throw new ServiceException(Messages.getMessage("wsdlMissing00"));

        Map ports = wsdlService.getPorts();
        if (ports == null || ports.size() <= 0)
            throw new ServiceException(Messages.getMessage("noPort00", ""));

        // Get the name of the class (without package name)
        String clazzName = proxyInterface.getName();
        if(clazzName.lastIndexOf('.')!=-1) {
            clazzName = clazzName.substring(clazzName.lastIndexOf('.')+1);
View Full Code Here

    }

    private Remote getPort(String endpoint, QName portName,
                           Class proxyInterface) throws ServiceException {
        if (!proxyInterface.isInterface()) {
            throw new ServiceException(Messages.getMessage("mustBeIface00"));
        }

        if (!(Remote.class.isAssignableFrom(proxyInterface))) {
            throw new ServiceException(
                    Messages.getMessage("mustExtendRemote00"));
        }

        try {
            Call call = null;
            if (portName == null) {
                call = (org.apache.axis.client.Call) createCall();
                if (endpoint != null) {
                    call.setTargetEndpointAddress(new URL(endpoint));
                }
            } else {
                call = (org.apache.axis.client.Call) createCall(portName);
            }
            ClassLoader classLoader =
                    Thread.currentThread().getContextClassLoader();
            return (Remote) Proxy.newProxyInstance(classLoader,
                    new Class[]{proxyInterface, javax.xml.rpc.Stub.class},
                    new AxisClientProxy(call, portName));
        } catch (Exception e) {
            throw new ServiceException(e.toString());
        }
    } // getPort
View Full Code Here

        if (wsdlParser == null)
            return call;

        Port port = wsdlService.getPort(portName.getLocalPart());
        if (port == null)
            throw new ServiceException(Messages.getMessage("noPort00", "" + portName));

        Binding binding = port.getBinding();
        PortType portType = binding.getPortType();
        if (portType == null)
            throw new ServiceException(Messages.getMessage("noPortType00", "" + portName));

        // Get the URL
        ////////////////////////////////////////////////////////////////////
        List list = port.getExtensibilityElements();
        for (int i = 0; list != null && i < list.size(); i++) {
            Object obj = list.get(i);
            if (obj instanceof SOAPAddress) {
                try {
                    SOAPAddress addr = (SOAPAddress) obj;
                    URL url = new URL(addr.getLocationURI());
                    call.setTargetEndpointAddress(url);
                } catch (Exception exp) {
                    throw new ServiceException(
                            Messages.getMessage("cantSetURI00", "" + exp));
                }
            }
        }
View Full Code Here

     * @throws ServiceException - If this Service class does not have access
     * to the required WSDL metadata or if an illegal portName is specified.
     */
    public javax.xml.rpc.Call[] getCalls(QName portName) throws ServiceException {
        if (portName == null)
            throw new ServiceException(Messages.getMessage("badPort00"));

        if (wsdlService == null)
            throw new ServiceException(Messages.getMessage("wsdlMissing00"));

        Port port = wsdlService.getPort(portName.getLocalPart());
        if (port == null)
            throw new ServiceException(Messages.getMessage("noPort00", "" + portName));

        Binding binding = port.getBinding();
        SymbolTable symbolTable = wsdlParser.getSymbolTable();
        BindingEntry bEntry =
                symbolTable.getBindingEntry(binding.getQName());
View Full Code Here

TOP

Related Classes of javax.xml.rpc.ServiceException

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.