Return-Path: Delivered-To: apmail-ws-soap-user-archive@www.apache.org Received: (qmail 8166 invoked from network); 20 Oct 2004 17:56:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 Oct 2004 17:56:09 -0000 Received: (qmail 87976 invoked by uid 500); 20 Oct 2004 17:56:03 -0000 Delivered-To: apmail-ws-soap-user-archive@ws.apache.org Received: (qmail 87879 invoked by uid 500); 20 Oct 2004 17:56:02 -0000 Mailing-List: contact soap-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: soap-user@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list soap-user@ws.apache.org Received: (qmail 87847 invoked by uid 99); 20 Oct 2004 17:56:01 -0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=DNS_FROM_RFC_POST X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [80.247.70.7] (HELO smtp-out2.email.it) (80.247.70.7) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 20 Oct 2004 10:56:00 -0700 Received: by smtp-out2.email.it (Email.it, from userid 101) id 6F0521BC1DB; Wed, 20 Oct 2004 19:56:04 +0200 (CEST) Received: from BOBO (ppp-57-185.28-151.libero.it [151.28.185.57])by smtp-out2.email.it (Email.it) with ESMTP id 24FDC1BC1DBfor ; Wed, 20 Oct 2004 19:56:01 +0200 (CEST) Message-ID: <005201c4b6ce$0a836d00$d9bc1c97@BOBO> From: "Francesco Dipalo" To: References: <001d01c4b66f$d0464df0$c7b21c97@BOBO> <17a901c4b6af$a93fcfc0$6401a8c0@northgate> <001b01c4b6c6$598d2a60$d9bc1c97@BOBO> <189801c4b6cd$038f7260$6401a8c0@northgate> Subject: Re: problems in creating a web service Date: Wed, 20 Oct 2004 19:55:23 +0200 MIME-Version: 1.0 Content-Type: text/plain;charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Copyrighted-Material: Please visit http://www.email.it/ita/privacy.html X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N What does it mean "to factor a class"? ----- Original Message ----- From: "Scott Nichol" To: Sent: Wednesday, October 20, 2004 7:48 PM Subject: Re: problems in creating a web service It looks to me like servizio methods prompt the user for input and write stuff to System.out. SOAP does not interact with a user. The composizione also seems to directly or indirectly interact with System.in and System.out. Besides that, it has no methods, just a constructor. To expose some of your logic through SOAP, you need to factor out classes that just do computations, file and database I/O, etc. The code that interacts with a human needs to be in the client application. Scott Nichol Do not send e-mail directly to this e-mail address, because it is filtered to accept only mail from specific mail lists. ----- Original Message ----- From: "Francesco Dipalo" To: Sent: Wednesday, October 20, 2004 1:00 PM Subject: Re: problems in creating a web service > For example, if I have this java class > > package javasoap.book.ch4; > public class MethodCounter { > int _counter; > public MethodCounter() { > _counter = 0; > } > public int getCount() { > return _counter; > } > } > I create a deployment descriptor file and an application like this to > execute the getCount method: > > package javasoap.book.ch4; > import java.net.*; > import org.apache.soap.*; > import org.apache.soap.rpc.*; > public class GetCountApp { > public static void main(String[] args) > throws Exception { > > URL url = > new URL( > "http://localhost:8080/soap/servlet/rpcrouter"); > > Call call = new Call(); > call.setTargetObjectURI("urn:CallCounterService"); > call.setMethodName("getCount"); > try { > Response resp = call.invoke(url, ""); > Parameter ret = resp.getReturnValue(); > Object value = ret.getValue(); > System.out.println("Result is " + value); > } > catch (SOAPException e) { > System.err.println("Caught SOAPException (" + > e.getFaultCode() + "): " + > e.getMessage()); > } > } > } > > Do you understand now what my purpose is? In my case I want to execute > servizio and composizione methods. > ----- Original Message ----- > From: "Scott Nichol" > To: > Sent: Wednesday, October 20, 2004 4:18 PM > Subject: Re: problems in creating a web service > > > What exactly do you mean by "transform this software in a web service"? > What classes and/or methods to you want to access via SOAP? > > Scott Nichol > > Do not send e-mail directly to this e-mail address, > because it is filtered to accept only mail from > specific mail lists. > ----- Original Message ----- > From: "Francesco Dipalo" > To: > Sent: Wednesday, October 20, 2004 2:41 AM > Subject: problems in creating a web service > > > I have this software: > > > THE APPLICATION_CONTROLLER CLASS > import java.io.*; > import java.util.*; > public class application_controller { > public static void main(String [] args) { > servizio s = new servizio(); > composizione c = new composizione( > s.c_Nomefile1, s.c_Nomefile2, s.c_Nomefile ); > } > } > > > THE SERVIZIO CLASS > import java.io.*; > import java.util.*; > public class servizio { > public static String c_Nomefile; > public static String c_Nomefile1; > public static String c_Nomefile2; > public servizio() { > c_Elenco(); > c_Scelta(); > } > static private void c_Elenco() { > System.out.println("ELENCO SERVIZI:"); > String [] lista = new File(".").list(); //crea lista > for(int cx=0; cx if ( new File(lista[cx]).isFile() ) //verifica se S file > if ( lista[cx].toLowerCase().lastIndexOf(".owl") >= 0) //e con > estensione .owl > System.out.print((" � "+lista[cx]+" > ").substring(0,20)); > } > static private String input(String prompt) { > String instr = ""; > try { > BufferedReader inp = new BufferedReader(new > InputStreamReader(System.in)); > do { > System.out.print(prompt); > } while ((instr = inp.readLine()).length() == 0); > } catch(Exception e){}; > if (instr.lastIndexOf(".") < 0) instr += ".owl"; > return instr; > } > static public void c_Scelta() { > c_Nomefile1 = input("\nServizio principale : "); > c_Nomefile2 = input("Servizio da comporre: "); > // crea nome file composto > c_Nomefile = c_Nomefile1.substring(0,c_Nomefile1.lastIndexOf(".")) + > c_Nomefile2; > } > } > > > THE COMPOSIZIONE CLASS > import java.io.*; > import java.util.*; > public class composizione { > public static int c_Comp; // esito della composizione > public composizione (String file_1, String file_2, String file_composto) { > output out = new output(); > if ( (c_Comp = new metodi_xml(file_2).c_ProceduraTag(file_1)) == 0) { > out.c_EliminaFile(); > out.c_ScriviMessaggio(); > } else { > System.out.println("\nFILE COMPOSTO:\n"); > out.c_StampaFile(); > out.c_SpostaFile(file_1, file_2, file_composto); > } > } > } > > > THE METODI_XML CLASS > import java.io.*; > import java.util.*; > public class metodi_xml { > public static String c_Tabella; > final private static String fileTMP = "tmp.owl"; > final private static xml_pars owl = new xml_pars(); //classe parsing > .XML > private static String tempor; > private static String linea; > private static boolean corretto; > public metodi_xml (String file) { > System.out.print("Apro il file "+file+" ... "); > if (! (corretto = owl.load_parsing(file)) ) > System.out.println("Errore!"); > else c_CompilaTabella(file); > } > public static void c_CompilaTabella(String file) { // crea tabella > System.out.println("Ok!\nCompilo la tabella..."); > owl.tag(2); //salta header (tag e tag Ontology) > c_Tabella = tempor = ""; > while(true) { > //String tag = owl.ctags(); > String tag = owl.tags(); > if (owl.nido < 0) break; > tempor += tag; c_AnalisiTag(tag); > if (linea.length() > 1) c_Tabella += linea + "\n"; > } > } > public static int c_AnalisiTag(String tag) { // ritorna tipo tag > e linea > linea = "."; > if (owl.si_tag(tag," 0) { > linea = owl.search_true(tag, "owls:Class ", "C") + > owl.search_true(tag, "owls:ObjectProperty ", "P") + > //owl.search_true(tag, "owls:Ontology ", "O") + > linea; > if (linea.length() == 1) { > System.out.println("Tag sconosciuto: " + tag); > corretto = false; }; > linea += owl.search_tag(tag, "name="); //"owls:name" > }; > return linea.charAt(0); > } > public static int c_ProceduraTag(String file) { // esegue utility > int comp=0; String temp = "", tag = ""; > System.out.print("Apro il file "+file+" ... "); > if (! owl.load_parsing(file) ) { > System.out.println("Errore!"); > corretto = false; }; > if (corretto) { > System.out.println("Ok!\nAvvio utility..."); > owl.tag(2); //salta header (tag e tag Ontology) > do { > tag = owl.tags(); //o tag = owl.tag(0); > int tipo = c_AnalisiTag(tag); > if (linea.length() > 1) { > if (c_Tabella.indexOf(linea) < 0) { > //temp += owl.ctag_root(owl.xml_id); > temp += owl.tag_root(owl.xml_id); > } else { > if (tipo == 'C') comp = 1; //... > } > } > } while (owl.nido >= 0); > }; > if (!corretto) { System.out.println("Utility interrotta per > errori."); comp = 0; }; > // if (temp.length() > 0) { //aggiunge intestazione padre > owl.reset(); tempor = owl.tags() + owl.tags() + > tempor + temp + tag; //}; //temp + tempor + tag; //}; > owl.save_pars(fileTMP, tempor); //crea file temporaneo > return comp; > } > } > > > THE OUTPUT CLASS > import java.io.*; > import java.util.*; > public class output { > final private static String fileTMP = "tmp.owl"; > final private static String cartellaServizi = "servizi"; > final private static xml_pars owl = new xml_pars(2,8); //classe parsing > .XML > private static void waitkey() { > try { > System.out.print("\nPremere INVIO per proseguire..."); > System.in.read(); System.out.println(); > } catch(Exception e) {} > } > public static void c_SpostaFile(String file_1, String file_2, String > file_composto) { > owl.newdir(cartellaServizi); //se non c'S crea la cartella > //new File(cartellaServizi).mkdirs(); new File(fileTMP).renameTo(new > File(cartellaServizi + "/" + file_composto)); > if (owl.load_parsing(fileTMP)) { > owl.save_parsing(cartellaServizi + "/" + file_composto); > c_EliminaFile(); > owl.load_parsing(file_1); owl.save_parsing(cartellaServizi + > "/" + file_1); > owl.load_parsing(file_2); owl.save_parsing(cartellaServizi + > "/" + file_2); > } > } > public static void c_StampaFile() { > int cx=0; > if (owl.load_parsing(fileTMP)) > do { System.out.print(owl.ctags()); if ( ((++cx)&15) == 0) > waitkey(); > } while (owl.nido >= 0 || cx<3); > } > public static void c_EliminaFile() { > owl.delfile(fileTMP); //new File(fileTMP).delete(); > } > public static void c_ScriviMessaggio() { > System.out.println("\nI due servizi non sono tra loro componibili."); > waitkey(); > } > } > > How can I create the .dd file and the application file to transform this > software in a web service? Thanks for the help and excuse for the lenght of > the message > > > -- > Email.it, the professional e-mail, gratis per te: http://www.email.it/f > > Sponsor: > La foto che hai sempre vicino a te... Stampala su un nostro gadget! > * Stelle & Strisce stampa quello che vuoi TU .... dove Vuoi Tu!! > * > Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid!16&d -10 > > > > > -- > Email.it, the professional e-mail, gratis per te: http://www.email.it/f > > Sponsor: > Il Cinema a casa Tua!: film e dvd a meno di 10 Euro! Clicca e scopri tutti i titoli > Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2755&d=20-10 > -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Vuoi ricevere gratuitamente, ogni gioved�, manuali e guide per il tuo PC? Aggiornati gratis con Manuali.net! Clicca qui Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2733&d=20-10