Package javax.xml.rpc

Examples of javax.xml.rpc.ServiceException


        Enhancer.registerCallbacks(serviceEndpointClass, callbacks);
        try {
            return (Remote) constructor.newInstance(new Object[]{serviceEndpoint});
        } catch (InvocationTargetException e) {
            e.getTargetException().printStackTrace();
            throw new ServiceException("Could not construct service instance", e.getTargetException());
        }
    }
View Full Code Here


              Document         doc = XMLUtils.newDocument(fis);
              initService(doc, serviceName);
            }
        }
        catch( FileNotFoundException exp ) {
            throw new ServiceException(
                    JavaUtils.getMessage("wsdlError00", "" + wsdlLocation, "\n" + exp) );
        }
    }
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

            String           lp = serviceName.getLocalPart();
            javax.wsdl.QName qn = new javax.wsdl.QName( ns, lp );

            this.wsdlService    = def.getService( qn );
            if ( this.wsdlService == null )
                throw new ServiceException(
                        JavaUtils.getMessage("noService00", "" + serviceName));
        }
        catch( Exception exp ) {
            throw new ServiceException(
                    JavaUtils.getMessage("wsdlError00", "" + "", "\n" + exp) );
        }
    }
View Full Code Here

    }

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

        if (!(Remote.class.isAssignableFrom(proxyInterface))) {
            throw new ServiceException(
                            JavaUtils.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

    public javax.xml.rpc.Call createCall(QName portName)
                            throws ServiceException {
        javax.wsdl.QName qn = new javax.wsdl.QName( portName.getNamespaceURI(),
                                                    portName.getLocalPart() );
        if ( wsdlDefinition == null )
            throw new ServiceException( JavaUtils.getMessage("wsdlMissing00") );

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

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

        Call call = (org.apache.axis.client.Call)createCall();
        call.setPortTypeName( 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(
                            JavaUtils.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() throws ServiceException {
        if (wsdlLocation == null) {
            throw new ServiceException();
        }
        else {
            return new javax.xml.rpc.Call[0];
        }
    }
View Full Code Here

    }

    public Call[] getCalls(QName portName) throws ServiceException {

        if (portName == null)
            throw new ServiceException("Portname cannot be null");

        SEIFactory factory = (SEIFactory) portToImplementationMap.get(portName.getLocalPart());
        if( factory == null )
            throw new ServiceException("No port for portname: " + portName);

        OperationInfo[] operationInfos = factory.getOperationInfos();
        javax.xml.rpc.Call[] array = new javax.xml.rpc.Call[operationInfos.length];
        for (int i = 0; i < operationInfos.length; i++) {
            OperationInfo operation = operationInfos[i];
View Full Code Here

        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

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.