Package javax.xml.rpc

Examples of javax.xml.rpc.ServiceException


     * @throws ServiceException If this Service class does not
     *     have access to the required WSDL metadata
     */
    public Iterator getPorts() throws ServiceException {
        if (wsdlService == null)
            throw new ServiceException(Messages.getMessage("wsdlMissing00"));

        if (wsdlService.getPorts() == null) {
            // Return an empty iterator;
            return new Vector().iterator();
        }
View Full Code Here


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

        else {
            Document doc = null;
            try {
                doc = XMLUtils.newDocument(this.wsdlLocation.toString());
            } catch (Exception exp ) {
                throw new ServiceException(
                   Messages.getMessage("wsdlError00", "" + "", "\n" + exp) );
            }
          initService(doc, serviceName);
        }
    }
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(doc, serviceName);
    }
View Full Code Here

              cachedWSDL.put( this.wsdlLocation.toString(), parser );

            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"));

        return getPort(null, null, proxyInterface);
    }
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));
        } 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

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.