From fecf5a9fa52adac5328da399408e8cbfd9b84f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Euzenat?= <Jerome.Euzenat@inria.fr> Date: Sat, 4 Aug 2007 09:37:17 +0000 Subject: [PATCH] - fully implemented web service connectioin --- .../align/service/AServProtocolManager.java | 11 +- .../exmo/align/service/AlignmentIds.java | 12 +- .../exmo/align/service/CacheImpl.java | 2 +- .../exmo/align/service/ErrorMsg.java | 3 + .../exmo/align/service/HTMLAServProfile.java | 538 +----------------- .../inrialpes/exmo/align/service/Message.java | 4 +- .../exmo/align/service/WSAServProfile.java | 450 +++++++-------- .../inrialpes/exmo/align/service/aserv.wsdl | 267 +++++++++ 8 files changed, 543 insertions(+), 744 deletions(-) create mode 100644 src/fr/inrialpes/exmo/align/service/aserv.wsdl diff --git a/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java b/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java index a8a5a5b1..1593455e 100644 --- a/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java +++ b/src/fr/inrialpes/exmo/align/service/AServProtocolManager.java @@ -384,9 +384,10 @@ public class AServProtocolManager { } // get the cut parameters String method = (String)mess.getParameters().getParameter("method"); + if ( method == null ) method = "hard"; double threshold = Double.parseDouble((String)mess.getParameters().getParameter("threshold")); al = (BasicAlignment)((BasicAlignment)al).clone(); - try { al.cut( method, threshold ); } + try { al.cut( method, threshold );} catch (AlignmentException e) { return new ErrorMsg(newId(),mess,myId,mess.getSender(),"dummy//",(Parameters)null); } @@ -408,12 +409,8 @@ public class AServProtocolManager { } catch (Exception e) { return new UnknownAlignment(newId(),mess,myId,mess.getSender(),"unknown/Alignment/"+id,(Parameters)null); } - // I think that this is useless because invert always copy the alignment - if ( params.getParameter("id") == null ){ - // Copy the alignment - } // Invert it - try { al.inverse(); } + try { al = al.inverse(); } catch (AlignmentException e) { return new ErrorMsg(newId(),mess,myId,mess.getSender(),"dummy//",(Parameters)null); } @@ -659,7 +656,7 @@ public class AServProtocolManager { //System.err.println(interfaceName+ ">> "+pcks[i].getName() ); //implementations( pcks[i].getName(), toclass, list ); //} - implementations( toclass, list, true ); + implementations( toclass, list, false ); } catch (ClassNotFoundException ex) { System.err.println("Class "+interfaceName+" not found!"); } diff --git a/src/fr/inrialpes/exmo/align/service/AlignmentIds.java b/src/fr/inrialpes/exmo/align/service/AlignmentIds.java index 6ffc7de3..7bf6035e 100644 --- a/src/fr/inrialpes/exmo/align/service/AlignmentIds.java +++ b/src/fr/inrialpes/exmo/align/service/AlignmentIds.java @@ -35,8 +35,18 @@ public class AlignmentIds extends Success { String result = "Alignment Ids: <ul>"; String id[] = content.split(" "); for ( int i = id.length-1; i >= 0; i-- ){ - result += "<li><a href=\"../html/retrieve?method=fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor&id="+id[i]+"\">"+id[i]+"</a></lI>"; + result += "<li><a href=\"../html/retrieve?method=fr.inrialpes.exmo.align.impl.renderer.HTMLRendererVisitor&id="+id[i]+"\">"+id[i]+"</a></li>"; } return result += "</ul>"; } + public String SOAPString(){ + String msg = "<id>"+surrogate+"</id>"+"<sender>"+sender+"</sender>" + "<receiver>"+receiver+"</receiver>" + "<in-reply-to>" + inReplyTo+ "</in-reply-to>" + "<content>"; + String id[] = content.split(" "); + for ( int i = id.length-1; i >= 0; i-- ){ + msg += "<uri>"+id[i]+"</uri>"; + } + msg += "</content>"; + return msg; + } + } diff --git a/src/fr/inrialpes/exmo/align/service/CacheImpl.java b/src/fr/inrialpes/exmo/align/service/CacheImpl.java index 2a02c1c3..5903fe77 100644 --- a/src/fr/inrialpes/exmo/align/service/CacheImpl.java +++ b/src/fr/inrialpes/exmo/align/service/CacheImpl.java @@ -330,7 +330,7 @@ public class CacheImpl implements Cache { */ public String recordNewAlignment( Alignment alignment, boolean force ) { try { return recordNewAlignment( generateAlignmentId(), alignment, force ); - } catch (Exception e) { return (String)null; } + } catch (AlignmentException ae) { return (String)null; } } /** diff --git a/src/fr/inrialpes/exmo/align/service/ErrorMsg.java b/src/fr/inrialpes/exmo/align/service/ErrorMsg.java index d461ed8d..ee1e803b 100644 --- a/src/fr/inrialpes/exmo/align/service/ErrorMsg.java +++ b/src/fr/inrialpes/exmo/align/service/ErrorMsg.java @@ -34,4 +34,7 @@ public class ErrorMsg extends Message { public String HTMLString(){ return "Generic error: "+content; } + public String SOAPString(){ + return "<ErrorMsg><id>"+surrogate+"</id>"+"<sender>"+sender+"</sender>" + "<receiver>"+receiver+"</receiver>" + "<in-reply-to>" + inReplyTo+ "</in-reply-to>" + "<content>" + content + "</content></ErrorMsg>"; + } } diff --git a/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java b/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java index 638f4e3e..eac733f6 100644 --- a/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java +++ b/src/fr/inrialpes/exmo/align/service/HTMLAServProfile.java @@ -643,23 +643,24 @@ public class HTMLAServProfile implements AlignmentServiceProfile { // =============================================== // Util - public Response wsdlAnswer(String uri, String perf, Properties header, Parameters params ) { - String msg = ""; - try { - FileReader fr = null; - String temp; - // JE: I would not... but absolutely not do this - fr = new FileReader ("WSAlignSVC.wsdl"); - BufferedReader inFile = new BufferedReader( fr ); - while ((temp = inFile.readLine()) != null) { - //msg = msg + line + "\n"; - msg =msg + temp; - } - if (fr != null) fr.close(); - } catch (IOException e) { e.printStackTrace(); } - return new Response( HTTP_OK, MIME_XML, msg ); - } - + public Response wsdlAnswer(String uri, String perf, Properties header, Parameters params ) { + /* + String msg = ""; + try { + FileReader fr = null; + String temp; + // JE: I would not... but absolutely not do this + fr = new FileReader ("WSAlignSVC.wsdl"); + BufferedReader inFile = new BufferedReader( fr ); + while ((temp = inFile.readLine()) != null) { + //msg = msg + line + "\n"; + msg =msg + temp; + } + if (fr != null) fr.close(); + } catch (IOException e) { e.printStackTrace(); } + */ + return new Response( HTTP_OK, MIME_XML, WSAServProfile.wsdlAnswer() ); + } private String testErrorMessages( Message answer ) { return "<h1>Alignment error</h1>"+answer.HTMLString(); @@ -671,510 +672,25 @@ public class HTMLAServProfile implements AlignmentServiceProfile { private int newId() { return localId++; } - private void decodeParms( String parms, Properties p ) throws InterruptedException { - if ( parms == null ) return; - - StringTokenizer st = new StringTokenizer( parms, "&" ); - while ( st.hasMoreTokens()) { - String next = st.nextToken(); - int sep = next.indexOf( '=' ); - if ( sep >= 0 ) - - try { - p.put( URLDecoder.decode( next.substring( 0, sep ), "iso-8859-1" ).trim(), - URLDecoder.decode( next.substring( sep+1 ), "iso-8859-1" )); - } catch (Exception e) {}; //never thrown - } - } - // ================================================== - // HTTP Machinery - - /** - * Handles one session, i.e. parses the HTTP request - * and returns the response. - */ - private class HTTPSession implements Runnable { - public HTTPSession( Socket s ) { - mySocket = s; - Thread t = new Thread( this ); - t.setDaemon( true ); - t.start(); - } - - public void run() { - try { - InputStream is = mySocket.getInputStream(); - if ( is == null) return; - BufferedReader in = new BufferedReader( new InputStreamReader( is )); - - // Read the request line - StringTokenizer st = new StringTokenizer( in.readLine()); - if ( !st.hasMoreTokens()) - sendError( HTTP_BADREQUEST, "BAD REQUEST: Syntax error. Usage: GET /example/file.html" ); - - String method = st.nextToken(); - - if ( !st.hasMoreTokens()) - sendError( HTTP_BADREQUEST, "BAD REQUEST: Missing URI. Usage: GET /example/file.html" ); - - String uri = null; - try { - uri = URLDecoder.decode( st.nextToken(), "iso-8859-1" ); - } catch (Exception e) {}; //never thrown - //String uri = decodePercent( st.nextToken()); - - // Decode parameters from the URI - Properties parms = new Properties(); - int qmi = uri.indexOf( '?' ); - if ( qmi >= 0 ) { - decodeParms( uri.substring( qmi+1 ), parms ); - try { - uri = URLDecoder.decode( uri.substring( 0, qmi ), "iso-8859-1" ); - } catch (Exception e) {}; //never thrown - //uri = decodePercent( uri.substring( 0, qmi )); - } - - // If there's another token, it's protocol version, - // followed by HTTP headers. Ignore version but parse headers. - Properties header = new Properties(); - if ( st.hasMoreTokens()) { - String line = in.readLine(); - while ( line.trim().length() > 0 ) { - int p = line.indexOf( ':' ); - header.put( line.substring(0,p).trim(), line.substring(p+1).trim()); - line = in.readLine(); - } - } - - // If the method is POST, there may be parameters - // in data section, too, read it: - if ( method.equalsIgnoreCase( "POST" )) { - long size = 0x7FFFFFFFFFFFFFFFl; - String contentLength = header.getProperty("Content-Length"); - if (contentLength != null) { - try { size = Integer.parseInt(contentLength); } - catch (NumberFormatException ex) {} - } - String postLine = ""; - char buf[] = new char[512]; - int read = in.read(buf); - while ( read >= 0 && size > 0 && !postLine.endsWith("\r\n") ) { - size -= read; - postLine += String.valueOf(buf); - if ( size > 0 ) read = in.read(buf); - } - postLine = postLine.trim(); - // JE: it should not decode... - //decodeParms( postLine, parms ); - // JE: Display the parameters to know what we have - //System.err.println("POST detected at "+uri); - //System.err.println(method+" [ "+header+" ] "); - Enumeration e = header.propertyNames(); - while ( e.hasMoreElements()) { - String value = (String)e.nextElement(); - //System.err.println( " HDR: '" + value + "' = '" + - // header.getProperty( value ) + "'" ); - } - e = parms.propertyNames(); - while ( e.hasMoreElements()) { - String value = (String)e.nextElement(); - //System.err.println( " PRM: '" + value + "' = '" +parms.getProperty( value ) + "'" ); - } - //System.err.println("The content is\n"+postLine); - parms.put( "content", postLine ); - } - - // Ok, now do the serve() - Response r = serve( uri, method, header, parms ); - if ( r == null ) - sendError( HTTP_INTERNALERROR, "SERVER INTERNAL ERROR: Serve() returned a null response." ); - else - sendResponse( r.status, r.mimeType, r.header, r.data ); - in.close(); - } catch ( IOException ioe ) { - try { - sendError( HTTP_INTERNALERROR, "SERVER INTERNAL ERROR: IOException: " + ioe.getMessage()); - } catch ( Throwable t ) {} - } catch ( InterruptedException ie ) { - // Thrown by sendError, ignore and exit the thread. - } - } - - /** - * Decodes the percent encoding scheme. <br/> - * For example: "an+example%20string" -> "an example string" - private String decodePercent( String str ) throws InterruptedException { - try { - StringBuffer sb = new StringBuffer(); - for( int i=0; i<str.length(); i++ ) { - char c = str.charAt( i ); - switch ( c ) { - case '+': - sb.append( ' ' ); - break; - case '%': - sb.append((char)Integer.parseInt( str.substring(i+1,i+3), 16 )); - i += 2; - break; - default: - sb.append( c ); - break; - } - } - return new String( sb.toString().getBytes()); - } catch( Exception e ) { - sendError( HTTP_BADREQUEST, "BAD REQUEST: Bad percent-encoding." ); - return null; - } - } - */ - - /** - * Decodes parameters in percent-encoded URI-format - * ( e.g. "name=Jack%20Daniels&pass=Single%20Malt" ) and - * adds them to given Properties. - */ - private void decodeParms( String parms, Properties p ) throws InterruptedException { - if ( parms == null ) return; - - StringTokenizer st = new StringTokenizer( parms, "&" ); - while ( st.hasMoreTokens()) { - String next = st.nextToken(); - int sep = next.indexOf( '=' ); - if ( sep >= 0 ) - + private void decodeParms( String parms, Properties p ) throws InterruptedException { + if ( parms == null ) return; + + StringTokenizer st = new StringTokenizer( parms, "&" ); + while ( st.hasMoreTokens()) { + String next = st.nextToken(); + int sep = next.indexOf( '=' ); + if ( sep >= 0 ){ try { p.put( URLDecoder.decode( next.substring( 0, sep ), "iso-8859-1" ).trim(), URLDecoder.decode( next.substring( sep+1 ), "iso-8859-1" )); } catch (Exception e) {}; //never thrown } } - - /** - * Returns an error message as a HTTP response and - * throws InterruptedException to stop furhter request processing. - */ - private void sendError( String status, String msg ) throws InterruptedException { - sendResponse( status, MIME_PLAINTEXT, null, new ByteArrayInputStream( msg.getBytes())); - throw new InterruptedException(); - } - - /** - * Sends given response to the socket. - */ - private void sendResponse( String status, String mime, Properties header, InputStream data ) { - try { - if ( status == null ) - throw new Error( "sendResponse(): Status can't be null." ); - - OutputStream out = mySocket.getOutputStream(); - PrintWriter pw = new PrintWriter( out ); - pw.print("HTTP/1.0 " + status + " \r\n"); - - if ( mime != null ) - pw.print("Content-Type: " + mime + "\r\n"); - - if ( header == null || header.getProperty( "Date" ) == null ) - pw.print( "Date: " + gmtFrmt.format( new Date()) + "\r\n"); - - if ( header != null ) { - Enumeration e = header.keys(); - while ( e.hasMoreElements()) { - String key = (String)e.nextElement(); - String value = header.getProperty( key ); - pw.print( key + ": " + value + "\r\n"); - } - } - - pw.print("\r\n"); - pw.flush(); - - if ( data != null ) { - byte[] buff = new byte[2048]; - while (true) { - int read = data.read( buff, 0, 2048 ); - if (read <= 0) - break; - out.write( buff, 0, read ); - } - } - out.flush(); - out.close(); - if ( data != null ) data.close(); - } catch( IOException ioe ) { - // Couldn't write? No can do. - try { mySocket.close(); } catch( Throwable t ) {} - } - } - - private Socket mySocket; - }; - - /** - * URL-encodes everything between "/"-characters. - * Encodes spaces as '%20' instead of '+'. - */ - private String encodeUri( String uri ) { - String newUri = ""; - StringTokenizer st = new StringTokenizer( uri, "/ ", true ); - try { - while ( st.hasMoreTokens()) { - String tok = st.nextToken(); - if ( tok.equals( "/" )) - newUri += "/"; - else if ( tok.equals( " " )) - newUri += "%20"; - else - newUri += URLEncoder.encode( tok, "iso-8859-1" ); - } - } catch (Exception e) {}; // never reported exception - return newUri; - } - - /* - protected String file loadFile( req ){ - DiskFileItemFactory factory = new DiskFileItemFactory(); - //factory.setSizeThreshold(XXX); - //factory.setRepository("/tmp"); // System dependent - ServletFileUpload upload = new ServletFileUpload( factory ); - //upload.setSizeMax(XXX); - List items = upload.parseRequest( req ); - } - - String mimetype=httpRequest.getMimeType(); - HashMap multipartNVP=null; - if (mimetype!=null) - { if(mimetype.equals("multipart/form-data")) - { MultiPartRequest mpr=new MultiPartRequest(httpRequest); - String[] names=mpr.getPartNames(); - multipartNVP=new HashMap(names.length); - for(int i=0; i<names.length;i++) - { String filename=mpr.getFilename(names[i]); - if(filename!=null) - { // uploaded file - URIdentifier partURI = new URIdentifier(URI_UPLOAD+Integer.toString(i)); - requestURI.addArg(names[i],partURI.toString()); - requestArguments.put( partURI, ParameterUploadAspect.create(new AlwaysExpiredMeta("type/unknown",0), mpr,names[i], filename) ); - multipartNVP.put(names[i], new ByteArrayInputStream(filename.getBytes())); - } - else //Must be form data so add to NVP - { multipartNVP.put(names[i], mpr.getInputStream(names[i])); - } - } - } - } - */ - // From Jetty - private String value(String nameEqualsValue) { - String value=nameEqualsValue.substring(nameEqualsValue.indexOf('=')+1).trim(); - int i=value.indexOf(';'); - if(i>0) value=value.substring(0,i); - if(value.startsWith("\"")) { - value=value.substring(1,value.indexOf('"',1)); - } else { - i=value.indexOf(' '); - if(i>0) value=value.substring(0,i); - } - return value; - } - - // ================================================== - // File browsing stuff - // JE: MOST OF THIS CODE WILL BE USELESS - - File myFileDir; - - /** - * Serves file from homeDir and its' subdirectories (only). - * Uses only URI, ignores all headers and HTTP parameters. - */ - public Response serveFile( String uri, Properties header, File homeDir, - boolean allowDirectoryListing ) { - //System.err.println("SANDBOX"); - // Make sure we won't die of an exception later - if ( !homeDir.isDirectory()) - return new Response( HTTP_INTERNALERROR, MIME_PLAINTEXT, - "INTERNAL ERRROR: serveFile(): given homeDir is not a directory." ); - - // Remove URL arguments - uri = uri.trim().replace( File.separatorChar, '/' ); - if ( uri.indexOf( '?' ) >= 0 ) - uri = uri.substring(0, uri.indexOf( '?' )); - - // Prohibit getting out of current directory - if ( uri.startsWith( ".." ) || uri.endsWith( ".." ) || uri.indexOf( "../" ) >= 0 ) - return new Response( HTTP_FORBIDDEN, MIME_PLAINTEXT, - "FORBIDDEN: Won't serve ../ for security reasons." ); - - File f = new File( homeDir, uri ); - if ( !f.exists()) - return new Response( HTTP_NOTFOUND, MIME_PLAINTEXT, - "Error 404, file not found." ); - - // List the directory, if necessary - if ( f.isDirectory()) { - // Browsers get confused without '/' after the - // directory, send a redirect. - if ( !uri.endsWith( "/" )) { - uri += "/"; - Response r = new Response( HTTP_REDIRECT, MIME_HTML, - "<html><body>Redirected: <a href=\""+uri+"\">" +uri+"</a></body></html>"); - r.addHeader( "Location", uri ); - return r; - } - - // First try index.html and index.htm - if ( new File( f, "index.html" ).exists()) - f = new File( homeDir, uri + "/index.html" ); - else if ( new File( f, "index.htm" ).exists()) - f = new File( homeDir, uri + "/index.htm" ); - - // No index file, list the directory - else if ( allowDirectoryListing ) { - String[] files = f.list(); - String msg = "<html><body><h1>Directory " + uri + "</h1><br/>"; - - if ( uri.length() > 1 ) { - String u = uri.substring( 0, uri.length()-1 ); - int slash = u.lastIndexOf( '/' ); - if ( slash >= 0 && slash < u.length()) - msg += "<b><a href=\"" + uri.substring(0, slash+1) + "\">..</a></b><br/>"; - } - - for ( int i=0; i<files.length; ++i ) { - File curFile = new File( f, files[i] ); - boolean dir = curFile.isDirectory(); - if ( dir ) { - msg += "<b>"; - files[i] += "/"; - } - - msg += "<a href=\"" + encodeUri( uri + files[i] ) + "\">" + - files[i] + "</a>"; - - // Show file size - if ( curFile.isFile()) { - long len = curFile.length(); - msg += " <font size=2>("; - if ( len < 1024 ) - msg += curFile.length() + " bytes"; - else if ( len < 1024 * 1024 ) - msg += curFile.length()/1024 + "." + (curFile.length()%1024/10%100) + " KB"; - else - msg += curFile.length()/(1024*1024) + "." + curFile.length()%(1024*1024)/10%100 + " MB"; - msg += ")</font>"; - } - msg += "<br/>"; - if ( dir ) msg += "</b>"; - } - return new Response( HTTP_OK, MIME_HTML, msg ); - } else { - return new Response( HTTP_FORBIDDEN, MIME_PLAINTEXT, - "FORBIDDEN: No directory listing." ); - } - } - - try { - // Get MIME type from file name extension, if possible - String mime = null; - int dot = f.getCanonicalPath().lastIndexOf( '.' ); - if ( dot >= 0 ) - mime = (String)theMimeTypes.get( f.getCanonicalPath().substring( dot + 1 ).toLowerCase()); - if ( mime == null ) - mime = MIME_DEFAULT_BINARY; - - // Support (simple) skipping: - long startFrom = 0; - String range = header.getProperty( "Range" ); - if ( range != null ) { - if ( range.startsWith( "bytes=" )) { - range = range.substring( "bytes=".length()); - int minus = range.indexOf( '-' ); - if ( minus > 0 ) range = range.substring( 0, minus ); - try { - startFrom = Long.parseLong( range ); - } catch ( NumberFormatException nfe ) {} - } - } - - FileInputStream fis = new FileInputStream( f ); - fis.skip( startFrom ); - Response r = new Response( HTTP_OK, mime, fis ); - r.addHeader( "Content-length", "" + (f.length() - startFrom)); - r.addHeader( "Content-range", "" + startFrom + "-" + - (f.length()-1) + "/" + f.length()); - return r; - } catch( IOException ioe ) { - return new Response( HTTP_FORBIDDEN, MIME_PLAINTEXT, "FORBIDDEN: Reading file failed." ); - } - } - - /** - * Hashtable mapping (String)FILENAME_EXTENSION -> (String)MIME_TYPE - */ - private static Hashtable theMimeTypes = new Hashtable(); - static { - StringTokenizer st = new StringTokenizer( - "htm text/html "+ - "html text/html "+ - "txt text/plain "+ - "asc text/plain "+ - "gif image/gif "+ - "jpg image/jpeg "+ - "jpeg image/jpeg "+ - "png image/png "+ - "mp3 audio/mpeg "+ - "m3u audio/mpeg-url " + - "pdf application/pdf "+ - "doc application/msword "+ - "ogg application/x-ogg "+ - "zip application/octet-stream "+ - "exe application/octet-stream "+ - "class application/octet-stream " ); - while ( st.hasMoreTokens()) - theMimeTypes.put( st.nextToken(), st.nextToken()); } // ================================================== - // License - - /** - * GMT date formatter - */ - private static java.text.SimpleDateFormat gmtFrmt; - static { - gmtFrmt = new java.text.SimpleDateFormat( "E, d MMM yyyy HH:mm:ss 'GMT'", Locale.US); - gmtFrmt.setTimeZone(TimeZone.getTimeZone("GMT")); - } + // HTTP Machinery - /** - * The distribution licence - */ - private static final String LICENCE = - "Copyright (C) 2001,2005 by Jarno Elonen <elonen@iki.fi>\n"+ - "\n"+ - "Redistribution and use in source and binary forms, with or without\n"+ - "modification, are permitted provided that the following conditions\n"+ - "are met:\n"+ - "\n"+ - "Redistributions of source code must retain the above copyright notice,\n"+ - "this list of conditions and the following disclaimer. Redistributions in\n"+ - "binary form must reproduce the above copyright notice, this list of\n"+ - "conditions and the following disclaimer in the documentation and/or other\n"+ - "materials provided with the distribution. The name of the author may not\n"+ - "be used to endorse or promote products derived from this software without\n"+ - "specific prior written permission. \n"+ - " \n"+ - "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n"+ - "IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n"+ - "OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n"+ - "IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n"+ - "INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n"+ - "NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n"+ - "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n"+ - "THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n"+ - "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n"+ - "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."; /** * HTTP response. * Return one of these from serve(). diff --git a/src/fr/inrialpes/exmo/align/service/Message.java b/src/fr/inrialpes/exmo/align/service/Message.java index 6b45049f..88fabc44 100644 --- a/src/fr/inrialpes/exmo/align/service/Message.java +++ b/src/fr/inrialpes/exmo/align/service/Message.java @@ -48,9 +48,9 @@ public class Message { return "<h1>Message</h1><dl><dt>id:</dt><dd>"+surrogate+"</dd><dt>sender:</dt><dd>"+sender+"</dd><dt>receiver:</dt><dd>"+receiver+"</dd><dt>in-reply-to:</dt><dd>"+inReplyTo+"</dd><dt>content:</dt><dd>"+content+"</dd></dl>"; } - public String SOAPString(){ + public String SOAPString(){ return "<id>"+surrogate+"</id>"+"<sender>"+sender+"</sender>" + "<receiver>"+receiver+"</receiver>" + "<in-reply-to>" + inReplyTo+ "</in-reply-to>" + "<content>" + content + "</content>"; - } + } public int getId () { return surrogate; diff --git a/src/fr/inrialpes/exmo/align/service/WSAServProfile.java b/src/fr/inrialpes/exmo/align/service/WSAServProfile.java index f6a395be..2d8d2187 100644 --- a/src/fr/inrialpes/exmo/align/service/WSAServProfile.java +++ b/src/fr/inrialpes/exmo/align/service/WSAServProfile.java @@ -26,34 +26,45 @@ import org.semanticweb.owl.align.Alignment; import org.semanticweb.owl.align.Parameters; import java.io.File; -import java.io.IOException; -import java.io.FileInputStream; -import java.io.PrintWriter; +import java.io.FileReader; import java.io.InputStream; +import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.ByteArrayInputStream; -import java.io.OutputStream; -import java.util.StringTokenizer; -import java.util.Locale; -import java.util.TimeZone; import java.util.Hashtable; import java.util.Properties; -import java.util.Date; import java.util.Enumeration; import java.util.Iterator; +import java.util.jar.JarFile; + +import java.lang.NullPointerException; -import java.net.Socket; -import java.net.ServerSocket; -import java.net.URLEncoder; -import java.net.URLDecoder; +// For message parsing +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; -import java.lang.Integer; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; /** - * HTMLAServProfile: an HTML provile for the Alignment server - * It embeds an HTTP server. + * WSAServProfile: a SOAP over HTTP provile for the Alignment server + * It uses the HTTP server of HTTPAServProfile + * + * Improvements to come: + * - provide WSDL from that channel as well + * - implement request_id management (fully missing here) + * - use XML/Xpath parsers [Make it namespace aware please] + * - clean up */ public class WSAServProfile implements AlignmentServiceProfile { @@ -62,32 +73,14 @@ public class WSAServProfile implements AlignmentServiceProfile { private String tcpHost; private int debug = 0; private AServProtocolManager manager; + private static String wsdlSpec = ""; private String myId; private String serverId; private int localId = 0; - /** - * Some HTTP response status codes - */ - public static final String - HTTP_OK = "200 OK", - HTTP_REDIRECT = "301 Moved Permanently", - HTTP_FORBIDDEN = "403 Forbidden", - HTTP_NOTFOUND = "404 Not Found", - HTTP_BADREQUEST = "400 Bad Request", - HTTP_INTERNALERROR = "500 Internal Server Error", - HTTP_NOTIMPLEMENTED = "501 Not Implemented"; + private static DocumentBuilder BUILDER = null; - /** - * Common mime types for dynamic content - */ - public static final String - MIME_PLAINTEXT = "text/plain", - MIME_HTML = "text/html", - MIME_DEFAULT_BINARY = "application/octet-stream"; - - public static final int MAX_FILE_SIZE = 10000; // ================================================== // Socket & server code @@ -96,10 +89,34 @@ public class WSAServProfile implements AlignmentServiceProfile { public void init( Parameters params, AServProtocolManager manager ) throws AServException { this.manager = manager; // This may register the WSDL file to some directory - myId = "LocalHTMLInterface"; + myId = "SOAPoverHTTPInterface"; serverId = "dummy"; localId = 0; + + // New XML parsing stuff + final DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance(); + fac.setValidating(false); + fac.setNamespaceAware(false); // Change this! + try { BUILDER = fac.newDocumentBuilder(); } + catch (ParserConfigurationException e) { + throw new AServException( "Cannot initialize SOAP message parsing", e ); } + // Read the WSDL specification + try { + // JE: This is to be modified so that we look for this file in the + // classpath + JarFile archive = new JarFile ( "/Java/alignapi/lib/alignsvc.jar" ); + InputStream is = archive.getInputStream( archive.getJarEntry("fr/inrialpes/exmo/align/service/aserv.wsdl") ); + BufferedReader in = new BufferedReader(new InputStreamReader(is)); + String line; + while ((line = in.readLine()) != null) { + wsdlSpec += line + "\n"; + } + if (in != null) in.close(); + } catch (IOException ioex) { + ioex.printStackTrace(); + } + } public void close(){ // This may unregister the WSDL file to some directory @@ -118,16 +135,29 @@ public class WSAServProfile implements AlignmentServiceProfile { */ public String protocolAnswer( String uri, String perf, Properties header, Parameters param ) { String method = header.getProperty("SOAPAction"); - String message = (String)param.getParameter("content"); + String message = ((String)param.getParameter("content")).trim(); + + // Create the DOM tree for the message + Document domMessage = null; + try { + domMessage = BUILDER.parse( new ByteArrayInputStream( message.getBytes()) ); + // DECIDE WHAT TO DO WITH THESE ERRORS + // CERTAINLY RETURN A "CANNOT PARSE REQUEST" + } catch ( IOException ioex ) { + ioex.printStackTrace(); + } catch ( SAXException saxex ) { + saxex.printStackTrace(); + } String msg = "<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance' xmlns:xsd='http://www.w3.org/1999/XMLSchema'> <SOAP-ENV:Body>"; - if ( perf.equals("WSDL") ) { - } else if ( method.equals("listalignment") ) { - for( Enumeration e = manager.alignments(); e.hasMoreElements(); ){ + if ( perf.equals("WSDL") || method.equals("wsdl") ) { + msg += wsdlAnswer(); + } else if ( method.equals("listalignments") ) { + for( Enumeration e = manager.alignments(); e.hasMoreElements(); ){ String id = ((Alignment)e.nextElement()).getExtension("id"); msg += "<uri>"+id+"</uri>"; } - // -> List of URI + // -> List of URI } else if ( method.equals("listmethods") ) { // -> List of String for( Iterator it = manager.listmethods().iterator(); it.hasNext(); ) { msg += "<method>"+it.next()+"</method>"; @@ -141,215 +171,174 @@ public class WSAServProfile implements AlignmentServiceProfile { msg += "<service>"+it.next()+"</service>"; } } else if ( method.equals("store") ) { // URI -> URI - int start; - int end; - String request_id; - String request_uri; - Parameters params; - - params = new BasicParameters(); - - start = message.indexOf("<id>"); - end = message.indexOf("</id>"); - request_id = message.substring(start+4, end); - start = message.indexOf("<uri>"); - end = message.indexOf("</uri>"); - request_uri = message.substring(start+5, end); - - params.setParameter("id", request_id); - params.setParameter("uri", request_uri); - - if ( request_uri != null && !request_uri.equals("") ) { // Load the URL - Message answer = manager.load( new Message(newId(),(Message)null,myId,serverId,"", params) ); - if ( answer instanceof ErrorMsg ) { - msg = testErrorMessagesSOAP( answer ); - } else { - request_id = answer.getContent(); - } + Parameters params = new BasicParameters(); + Message answer = null; + + getParameter( domMessage, message, params, "id", "id" ); + if ( params.getParameter( "id" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); } - if ( request_id != null ){ // Store it - Message answer = manager.store( new Message(newId(),(Message)null,myId,serverId, request_id, params) ); - - if ( answer instanceof ErrorMsg ) { - msg += testErrorMessagesSOAP( answer ); - } else { - msg += displayAnswerSOAP( answer ); - } + + if ( answer == null ) + answer = manager.store( new Message(newId(),(Message)null,myId,serverId,(String)params.getParameter( "id" ), params) ); + if ( answer instanceof ErrorMsg ) { + msg += displayError( answer ); + } else { + msg += displayAnswer( answer ); } - } else if ( method.equals("cut") ) { // URI * string * float -> URI - int start; - int end; - String request_id; - String request_uri; - String request_threshold; - Parameters params; - - params = new BasicParameters(); - - start = message.indexOf("<id>"); - end = message.indexOf("</id>"); - request_id = message.substring(start+4, end); - start = message.indexOf("<uri>"); - end = message.indexOf("</uri>"); - request_uri = message.substring(start+5, end); - start = message.indexOf("<threshold>"); - end = message.indexOf("</threshold>"); - request_threshold = message.substring(start+11, end); - - params.setParameter("id", request_id); - params.setParameter("uri", request_uri); - params.setParameter("threshold", request_threshold); - - if ( request_id != null && !request_id.equals("") && request_threshold != null && !request_threshold.equals("") ){ // Trim it - Message answer = manager.cut( new Message(newId(),(Message)null,myId,serverId, request_id, params) ); - if ( answer instanceof ErrorMsg ) { - msg = testErrorMessagesSOAP( answer ); - } else { - msg += displayAnswerSOAP( answer ); - } + } else if ( method.equals("invert") ) { // URI -> URI + Parameters params = new BasicParameters(); + Message answer = null; + + getParameter( domMessage, message, params, "id", "id" ); + if ( params.getParameter( "id" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); } - } else if ( method.equals("align") ) { // URL * URL * URI * String * boolean * (params) -> URI - int start; - int end; - - - String request_url1; - String request_url2; - String request_method; - String request_force; - Parameters params; - - params = new BasicParameters(); - - start = message.indexOf("<url1>"); - end = message.indexOf("</url1>"); - request_url1 = message.substring(start+6, end); - System.out.println(request_url1); - - - start = message.indexOf("<url2>"); - end = message.indexOf("</url2>"); - request_url2 = message.substring(start+6, end); - - start = message.indexOf("<method>"); - end = message.indexOf("</method>"); - request_method = message.substring(start+8, end); - - start = message.indexOf("<force>"); - end = message.indexOf("</force>"); - request_force = message.substring(start+7, end); - - params.setParameter("onto1", request_url1); - params.setParameter("onto2", request_url2); - params.setParameter("method", request_method); - params.setParameter("force", request_force); - - Message answer = manager.align( new Message(newId(),(Message)null,myId,serverId,"", params) ); + + if ( answer == null ) + answer = manager.inverse( new Message(newId(),(Message)null,myId,serverId, (String)params.getParameter( "id" ), params) ); if ( answer instanceof ErrorMsg ) { - msg = testErrorMessagesSOAP( answer ); + msg += displayError( answer ); } else { - msg += displayAnswerSOAP( answer ); + msg += displayAnswer( answer ); } - } else if ( method.equals("find") ) { // URI * URI -> List of URI - int start; - int end; + } else if ( method.equals("cut") ) { // URI * string * float -> URI + Parameters params = new BasicParameters(); + Message answer = null; - String request_url1; - String request_url2; - Parameters params; + getParameter( domMessage, message, params, "id", "id" ); + if ( params.getParameter( "id" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); + } - params = new BasicParameters(); + getParameter( domMessage, message, params, "method", "method" ); + if ( params.getParameter( "method" ) == null ) { + params.setParameter( "method", "hard" ); + } - start = message.indexOf("<url1>"); - end = message.indexOf("</url1>"); - request_url1 = message.substring(start+6, end); + getParameter( domMessage, message, params, "threshold", "threshold" ); + if ( params.getParameter( "threshold" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); + } - start = message.indexOf("<url2>"); - end = message.indexOf("</url2>"); - request_url2 = message.substring(start+6, end); + if ( answer == null ) + answer = manager.cut( new Message(newId(),(Message)null,myId,serverId,(String)params.getParameter( "id" ), params) ); + if ( answer instanceof ErrorMsg ) { + msg += displayError( answer ); + } else { + msg += displayAnswer( answer ); + } + } else if ( method.equals("align") ) { // URL * URL * URI * String * boolean * (params) -> URI + Parameters params = new BasicParameters(); + Message answer = null; - params.setParameter("onto1", request_url1); - params.setParameter("onto2", request_url2); + getParameter( domMessage, message, params, "url1", "onto1" ); + if ( params.getParameter( "onto1" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); + } + + getParameter( domMessage, message, params, "url2", "onto2" ); + if ( params.getParameter( "onto2" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); + } - - Message answer = manager.existingAlignments( new Message(newId(),(Message)null,myId,serverId,"", params) ); + getParameter( domMessage, message, params, "method", "method" ); + getParameter( domMessage, message, params, "force", "force" ); + + if ( answer == null ) + answer = manager.align( new Message(newId(),(Message)null,myId,serverId,"", params) ); if ( answer instanceof ErrorMsg ) { - msg = testErrorMessagesSOAP( answer ); + msg += displayError( answer ); } else { - msg += displayAnswerSOAP( answer ); + msg += displayAnswer( answer ); + } + } else if ( method.equals("find") ) { // URI * URI -> List of URI + Parameters params = new BasicParameters(); + Message answer = null; + + getParameter( domMessage, message, params, "uri1", "onto1" ); + if ( params.getParameter( "onto1" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); + } + + getParameter( domMessage, message, params, "uri2", "onto2" ); + if ( params.getParameter( "onto2" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); } - } else if ( method.equals("retrieve") ) { // URI -> XML - int start; - int end; - String request_id; - Parameters params; - - params = new BasicParameters(); - - start = message.indexOf("<id>"); - end = message.indexOf("</id>"); - request_id = message.substring(start+4, end); - - params.setParameter("id", request_id); - - Message answer = manager.render( new Message(newId(),(Message)null,myId,serverId,"", params) ); + + if ( answer == null ) + answer = manager.existingAlignments( new Message(newId(),(Message)null,myId,serverId,"", params) ); if ( answer instanceof ErrorMsg ) { - msg += testErrorMessagesSOAP( answer ); + msg += displayError( answer ); } else { - // Depending on the type we should change the MIME type - // This should be returned in answer.getParameters() - msg += "<result>" + answer.getContent() + "</result>"; - } - } else if ( method.equals("metadata") ) { // URI -> XML - int start; - int end; - String request_id; - Parameters params; - - params = new BasicParameters(); - - start = message.indexOf("<id>"); - end = message.indexOf("</id>"); - request_id = message.substring(start+4, end); - - params.setParameter("id", request_id); - - Message answer = manager.render( new Message(newId(),(Message)null,myId,serverId,"", params) ); + msg += displayAnswer( answer ); + } + } else if ( method.equals("retrieve") ) { // URI * method -> XML + Parameters params = new BasicParameters(); + Message answer = null; + + getParameter( domMessage, message, params, "id", "id" ); + if ( params.getParameter( "id" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); + } + + getParameter( domMessage, message, params, "method", "method" ); + if ( params.getParameter( "method" ) == null ) + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); + + if ( answer == null ) + answer = manager.render( new Message(newId(),(Message)null,myId,serverId, "", params) ); if ( answer instanceof ErrorMsg ) { - msg += testErrorMessagesSOAP( answer ); + msg += displayError( answer ); } else { - // Depending on the type we should change the MIME type + // JE: Depending on the type we should change the MIME type // This should be returned in answer.getParameters() + // JE: This should also suppress the <?xml... statement msg += "<result>" + answer.getContent() + "</result>"; - } + } + } else if ( method.equals("metadata") ) { // URI -> XML + // Not done yet } else if ( method.equals("load") ) { // URL -> URI - int start; - int end; - String request_url; - Parameters params; - - params = new BasicParameters(); - - start = message.indexOf("<url>"); - end = message.indexOf("</url>"); - request_url = message.substring(start+5, end); - - params.setParameter("url", request_url); - - Message answer = manager.load( new Message(newId(),(Message)null,myId,serverId,"", params) ); + Parameters params = new BasicParameters(); + Message answer = null; + + getParameter( domMessage, message, params, "url", "url" ); + if ( params.getParameter( "url" ) == null ) { + getParameter( domMessage, message, params, "content", "content" ); + if ( params.getParameter( "content" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); + } else { + // Save the content as a temporary file (gensym) + // Set the URI as the file:// uri for that file + // Set it in the "url" parameter + // Call load as below + // Take care somehow to discard the temporary file + } + } + if ( answer == null ) + answer = manager.load( new Message(newId(),(Message)null,myId,serverId,"", params) ); if ( answer instanceof ErrorMsg ) { - msg = testErrorMessagesSOAP( answer ); + msg += displayError( answer ); } else { - msg += displayAnswerSOAP( answer ); + msg += displayAnswer( answer ); } } else if ( method.equals("loadfile") ) { // XML -> URI - Message answer = manager.load( new Message(newId(),(Message)null,myId,serverId,"", param) ); + Parameters params = new BasicParameters(); + Message answer = null; + + getParameter( domMessage, message, params, "url", "url" ); + if ( params.getParameter( "url" ) == null ) { + answer = new NonConformParameters(0,(Message)null,myId,"",message,(Parameters)null); + } + if ( answer == null ) + answer = manager.load( new Message(newId(),(Message)null,myId,serverId,"", params) ); if ( answer instanceof ErrorMsg ) { - msg = testErrorMessagesSOAP( answer ); + msg += displayError( answer ); } else { - msg += displayAnswerSOAP( answer ); + msg += displayAnswer( answer ); } } else if ( method.equals("translate") ) { // XML * URI -> XML + // Not done yet } else { msg += "<UnRecognizedAction />"; } @@ -357,11 +346,28 @@ public class WSAServProfile implements AlignmentServiceProfile { return msg; } - private String displayAnswerSOAP ( Message answer ) { + public static String wsdlAnswer() { return wsdlSpec; } + + private void getParameter( Document dom, String message, Parameters p, String tag, String key ){ + XPath XPATH = XPathFactory.newInstance().newXPath(); + String result = null; + try { + // The two first elements are prefixed by: "SOAP-ENV:" + result = ((Node)(XPATH.evaluate("/Envelope/Body/" + tag, dom, XPathConstants.NODE))).getTextContent().trim(); + // Whatever error is NOTHING FOUND + } catch (XPathExpressionException e) { + } catch (NullPointerException e) { + } + if ( result != null && !result.equals("") ){ + p.setParameter( key, result); + } + } + + private String displayAnswer ( Message answer ) { return answer.SOAPString(); } - private String testErrorMessagesSOAP( Message answer ) { + private String displayError( Message answer ) { return answer.SOAPString(); } diff --git a/src/fr/inrialpes/exmo/align/service/aserv.wsdl b/src/fr/inrialpes/exmo/align/service/aserv.wsdl new file mode 100644 index 00000000..6deb0b72 --- /dev/null +++ b/src/fr/inrialpes/exmo/align/service/aserv.wsdl @@ -0,0 +1,267 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Id$ --> + +<wsdl:definitions targetNamespace="urn:http://exmo.inrialpes.fr/align/service" xmlns:impl="urn:http://exmo.inrialpes.fr/align/service" xmlns:intf="urn:http://exmo.inrialpes.fr/align/service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <wsdl:message name="listmethodsRequest"> + </wsdl:message> + <wsdl:message name="listalignmentsResponse"> + <wsdl:part name="listalignmentsReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="listrenderersResponse"> + <wsdl:part name="listrenderersReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="metadataRequest"> + <wsdl:part name="uri" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="loadfileRequest"> + <wsdl:part name="filecontents" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="retrieveRequest"> + <wsdl:part name="uri" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="listservicesResponse"> + <wsdl:part name="listservicesReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="alignResponse"> + <wsdl:part name="alignReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="findResponse"> + <wsdl:part name="findReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="listrenderersRequest"> + </wsdl:message> + <wsdl:message name="metadataResponse"> + <wsdl:part name="metadataReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="storeRequest"> + <wsdl:part name="uri" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="listservicesRequest"> + </wsdl:message> + <wsdl:message name="alignRequest"> + <wsdl:part name="url1" type="xsd:string"/> + <wsdl:part name="url2" type="xsd:string"/> + <wsdl:part name="uri" type="xsd:string"/> + <wsdl:part name="id" type="xsd:string"/> + <wsdl:part name="flag" type="xsd:boolean"/> + <wsdl:part name="params" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="cutResponse"> + <wsdl:part name="cutReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="retrieveResponse"> + <wsdl:part name="retrieveReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="translateResponse"> + <wsdl:part name="translateReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="loadResponse"> + <wsdl:part name="loadReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="translateRequest"> + <wsdl:part name="contents" type="xsd:string"/> + <wsdl:part name="uri" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="cutRequest"> + <wsdl:part name="uri" type="xsd:string"/> + <wsdl:part name="id" type="xsd:string"/> + <wsdl:part name="threshold" type="xsd:float"/> + </wsdl:message> + <wsdl:message name="storeResponse"> + <wsdl:part name="storeReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="listalignmentsRequest"> + </wsdl:message> + <wsdl:message name="listmethodsResponse"> + <wsdl:part name="listmethodsReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="findRequest"> + <wsdl:part name="uri1" type="xsd:string"/> + <wsdl:part name="uri2" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="loadfileResponse"> + <wsdl:part name="loadfileReturn" type="xsd:string"/> + </wsdl:message> + <wsdl:message name="loadRequest"> + <wsdl:part name="url" type="xsd:string"/> + </wsdl:message> + <wsdl:portType name="WSAlignSVC"> + <wsdl:operation name="listalignments"> + <wsdl:input message="impl:listalignmentsRequest" name="listalignmentsRequest"/> + <wsdl:output message="impl:listalignmentsResponse" name="listalignmentsResponse"/> + </wsdl:operation> + <wsdl:operation name="listmethods"> + <wsdl:input message="impl:listmethodsRequest" name="listmethodsRequest"/> + <wsdl:output message="impl:listmethodsResponse" name="listmethodsResponse"/> + </wsdl:operation> + <wsdl:operation name="listrenderers"> + <wsdl:input message="impl:listrenderersRequest" name="listrenderersRequest"/> + <wsdl:output message="impl:listrenderersResponse" name="listrenderersResponse"/> + </wsdl:operation> + <wsdl:operation name="listservices"> + <wsdl:input message="impl:listservicesRequest" name="listservicesRequest"/> + <wsdl:output message="impl:listservicesResponse" name="listservicesResponse"/> + </wsdl:operation> + <wsdl:operation name="metadata" parameterOrder="uri"> + <wsdl:input message="impl:metadataRequest" name="metadataRequest"/> + <wsdl:output message="impl:metadataResponse" name="metadataResponse"/> + </wsdl:operation> + <wsdl:operation name="loadfile" parameterOrder="filecontents"> + <wsdl:input message="impl:loadfileRequest" name="loadfileRequest"/> + <wsdl:output message="impl:loadfileResponse" name="loadfileResponse"/> + </wsdl:operation> + <wsdl:operation name="find" parameterOrder="uri1 uri2"> + <wsdl:input message="impl:findRequest" name="findRequest"/> + <wsdl:output message="impl:findResponse" name="findResponse"/> + </wsdl:operation> + <wsdl:operation name="load" parameterOrder="url"> + <wsdl:input message="impl:loadRequest" name="loadRequest"/> + <wsdl:output message="impl:loadResponse" name="loadResponse"/> + </wsdl:operation> + <wsdl:operation name="store" parameterOrder="uri"> + <wsdl:input message="impl:storeRequest" name="storeRequest"/> + <wsdl:output message="impl:storeResponse" name="storeResponse"/> + </wsdl:operation> + <wsdl:operation name="translate" parameterOrder="contents uri"> + <wsdl:input message="impl:translateRequest" name="translateRequest"/> + <wsdl:output message="impl:translateResponse" name="translateResponse"/> + </wsdl:operation> + <wsdl:operation name="align" parameterOrder="url1 url2 uri id flag params"> + <wsdl:input message="impl:alignRequest" name="alignRequest"/> + <wsdl:output message="impl:alignResponse" name="alignResponse"/> + </wsdl:operation> + <wsdl:operation name="cut" parameterOrder="uri id threshold"> + <wsdl:input message="impl:cutRequest" name="cutRequest"/> + <wsdl:output message="impl:cutResponse" name="cutResponse"/> + </wsdl:operation> + <wsdl:operation name="retrieve" parameterOrder="uri"> + <wsdl:input message="impl:retrieveRequest" name="retrieveRequest"/> + <wsdl:output message="impl:retrieveResponse" name="retrieveResponse"/> + </wsdl:operation> + </wsdl:portType> + <wsdl:binding name="WShttp://exmo.inrialpes.fr/align/serviceSoapBinding" type="impl:WShttp://exmo.inrialpes.fr/align/service"> + <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + <wsdl:operation name="listalignments"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="listalignmentsRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="listalignmentsResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="listmethods"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="listmethodsRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="listmethodsResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="listrenderers"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="listrenderersRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="listrenderersResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="listservices"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="listservicesRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="listservicesResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="metadata"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="metadataRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="metadataResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="loadfile"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="loadfileRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="loadfileResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="find"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="findRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="findResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="load"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="loadRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="loadResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="store"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="storeRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="storeResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="translate"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="translateRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="translateResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="align"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="alignRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="alignResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="cut"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="cutRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="cutResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + <wsdl:operation name="retrieve"> + <wsdlsoap:operation soapAction=""/> + <wsdl:input name="retrieveRequest"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:input> + <wsdl:output name="retrieveResponse"> + <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:http://exmo.inrialpes.fr/align/service" use="encoded"/> + </wsdl:output> + </wsdl:operation> + </wsdl:binding> + <wsdl:service name="WSAlignSVCService"> + <wsdl:port binding="impl:WSSoapBinding" name="asrv"> + <wsdlsoap:address location="http://localhost:8089/aserv"/> + </wsdl:port> + </wsdl:service> +</wsdl:definitions> -- GitLab