Changeset 9825


Ignore:
Timestamp:
2005-05-06T09:24:42+12:00 (19 years ago)
Author:
kjdon
Message:

fixed this up for use with axis - the process method signature has changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ant-install-branch/gsdl3/src/java/org/greenstone/gsdl3/SOAPServer.java.in

    r9506 r9825  
    1717 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    1818 */
     19
    1920package org.greenstone.gsdl3;
    2021
    2122import org.greenstone.gsdl3.core.*;
     23import org.greenstone.gsdl3.util.GSXML;
    2224import org.w3c.dom.Element;
    2325import java.io.File;
     
    3032 *
    3133 * @author <a href="mailto:[email protected]">Katherine Don</a>
    32  * @version $Revision$
    3334 * @see <a href="http://www.w3.org/TR/SOAP/">Simple Object Access Protocol (SOAP) 1.1 </a>
    3435 */
    3536
    36 public class SOAPServer@sitename@
    37     implements ModuleInterface {
    38  
     37public class SOAPServerlocalsite
     38{
    3939    private String config_file_name = "SOAPServer.cfg";
    4040   
     
    5454        return;
    5555    }
    56     String site_home=gsdl3_home+File.separator+"web"+File.separator+"sites"+File.separator+"@sitename@";
     56    String site_home=gsdl3_home+File.separator+"web"+File.separator+"sites"+File.separator+"localsite";
    5757   
    5858    File site_file = new File(site_home);
     
    6666    }
    6767   
    68    
    69     /** Process a String request */
    70     public String process(String xml_in) {
    71     return mr_.process(xml_in);
    72    
    73     }
    74 
    75     /** Process an Element request  */
    76     public Element process(Element xml_in) {
    77     return mr_.process(xml_in);
     68    public Element [] process (Element [] xml_in) {
     69    Element [] result = new Element[xml_in.length];
     70    for (int i=0; i<xml_in.length; i++) {
     71        Element req = xml_in[i];
     72        // get rid of the obligatory namespace that axis needs
     73        String tag_name = req.getTagName();
     74        String namespace="";
     75        if (tag_name.indexOf(':')!= -1) {
     76        namespace = tag_name.substring(0, tag_name.indexOf(':'));
     77        tag_name = tag_name.substring(tag_name.indexOf(':')+1);
     78        }
     79        Element new_req = GSXML.duplicateWithNewName(req.getOwnerDocument(), req, tag_name, true);
     80        Element r = mr_.process(new_req);
     81        // add the namespace back on
     82        //Element new_res = r;
     83        //if (!namespace.equals("")) {
     84        //  new_res = GSXML.duplicateWithNewName(r.getOwnerDocument(), r, namespace+r.getTagName(), true);
     85        //}
     86        result[i] = r;
     87    }
     88    return result;
    7889    }
    7990
     
    92103    return null;
    93104    }
    94 
     105   
    95106}
    96107
Note: See TracChangeset for help on using the changeset viewer.