Package javax.xml.rpc

Examples of javax.xml.rpc.ServiceException


        if (portToImplementationMap.containsKey(portName)) {
            SEIFactory seiFactory = (SEIFactory) portToImplementationMap.get(portName);
            Remote port = seiFactory.createServiceEndpoint();
            return port;
        }
        throw new ServiceException("No port for portname: " + portName);
    }
View Full Code Here


        if (seiClassNameToFactoryMap.containsKey(className)) {
            SEIFactory seiFactory = (SEIFactory) seiClassNameToFactoryMap.get(className);
            Remote port = seiFactory.createServiceEndpoint();
            return port;
        }
        throw new ServiceException("no port for class " + className);
    }
View Full Code Here

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

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

        try {
            this.wsdlDefinition = def ;

            this.wsdlService    = def.getService( serviceName );
            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 ( wsdlDefinition == 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"));

        javax.xml.rpc.Call[] array = new javax.xml.rpc.Call[]{createCall(portName)};
        return array;
    }
View Full Code Here

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

            initService( def, serviceName );
        }
        catch( Exception exp ) {
            throw new ServiceException(
                    JavaUtils.getMessage("wsdlError00", "" + "", "\n" + 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.