Package eu.planets_project.services.identify

Examples of eu.planets_project.services.identify.Identify


            e.printStackTrace();
            throw e;
        }
        Service service = Service.create(url, new QName(PlanetsServices.NS,
                Identify.NAME));
        Identify droid = service.getPort(Identify.class);
        byte[] array = FileUtils.readFileToByteArray(f1);
       
        //invoke the service and extract results
        IdentifyResult identify = droid.identify(new DigitalObject.Builder(Content.byValue(array)).build(), null);
        List<URI> result = identify.getTypes();
        String status = identify.getReport().getMessage();
       
        if(!status.equals("Positive")){
          throw new Exception("Service execution failed");
View Full Code Here


                    this.fillComparisonEvent(me, chr, cr);
                    ExperimentInspector.persistExperiment();
                }
               
            } else if(sd.getType().equals(Identify.class.getCanonicalName())) {
                Identify idf = new IdentifyWrapper(surl);
                IdentifyResult ir1 = idf.identify( this.getDob1().getDob(), null);
                this.compareServiceReport = ir1.getReport();
                IdentifyResult ir2 = idf.identify( this.getDob2().getDob(), null);
                this.compareServiceReport = ir2.getReport();
               
                me = this.createMeasurementEvent();
                if( me != null ) {
                    me.setAgent(new MeasurementAgent(idf.describe()));
                    me.setDate(Calendar.getInstance());
                    this.recordIdentifyComparison(me, ir1, this.getDobUri1(), ir2, this.getDobUri2() );
                   
                    ExperimentInspector.persistExperiment();
                }
View Full Code Here

            System.out.println("Using WSDL from: "+service.getWSDLDocumentLocation());
            Iterator<QName> ports = service.getPorts();
            while( ports.hasNext() ) {
                System.out.println("Got : "+ports.next());
            }
            Identify droid = (Identify) service.getPort( Identify.class );
            IdentifyResult result = droid.identify(new DigitalObject.Builder(
                    Content.byValue(new File("PC/droid/src/resources/Licence.rtf"))).build(), null);
            System.out.println("Result: "+result.getTypes());
            System.exit(1);
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
View Full Code Here

    }
   
    private IdentifyResult runIdentifyService() {
        if( this.getIdentifyService() == null ) return null;
        try {
            Identify id = new IdentifyWrapper(new URL( this.getIdentifyService()));
            IdentifyResult ir = id.identify(this.getDob().getDob(), null);
            return ir;
        } catch( Exception e ) {
            log.error("FAILED! "+e);
            e.printStackTrace();
            return null;
View Full Code Here

TOP

Related Classes of eu.planets_project.services.identify.Identify

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.