Introduction

An iceLogo SOAP (Simple Object Access Protocol) server can be accessed via http://iomics.ugent.be/icelogoserver/services/icelogo. This SOAP server provides access to the different iceLogo visualization options, see below for the different methods. These different methods all create a string of SVG content as a result. The iceLogo server and SOAP client examples can be found here.

WSDL

A WS-I compliant document/literal-wrapped WSDL (Web Services Description Language) can be found here. This file defines the different services and methods.

Creating a client, a java example

Different methods exist for creating SOAP client applications in java. The wsdl2java tool is an easy and useful tool for the fast creation of a java client. However, a client call can also manually be created. Here we will give an example on how to create a client that gets a filled logo (the code can be found here). More examples can be found in the iceLogo server source.

  • First, we will create the url.
  • // Create the url, this url point to the location of the webservice
    URL lIcelogoUrl = new URL("http://iomics.ugent.be/icelogoserver/services/icelogo");
  • Next, a String deserializer will be set to the created SOAPMappingRegistry.
  • // Set a String Deserializer for the Responsee ("getFilledLogoReturn")
    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    Deserializer stringDser = new StringDeserializer();
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,new QName("urn:IceLogoFetcher","getFilledLogoReturn"),null,null,stringDser);
  • Now we will create the call.
  • // Create and build the call.
    Call call = new Call();
    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI("urn:IceLogoFetcher");
    call.setMethodName("getFilledLogo");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
  • Next, the different parameters will be added to the call.
  • 
    // Create the parameters
    VectorParameter params = new VectorParameter();
    String[] lHumanGranzymeBSubstrates = newString[]{"GHISVKEPTPSIASDISLPIATQELRQRLR",... ,...,"LERDDGSTMMEIDGDKGKQGGPTYYIDTNA","SAGYGGYEEYSGLSDGYGFTTDLFGRDLSY"};
    params.addElement(new Parameter("lExperimentalSet", String[].class,lHumanGranzymeBSubstrates,null));
    params.addElement(new Parameter("lStartPosition", Integer.class, new Integer(0),null));
    params.addElement(new Parameter("lHeight", Integer.class, new Integer(600), null));
    params.addElement(new Parameter("lWidth", Integer.class, new Integer(800), null));
    call.setParams(params);
  • Finally, we will invoke the call and get the Responsee.
  • 
    // Invoke the call ...
    Response lIceLogoResponse;
    try{
        // ... and get the Response
        lIceLogoResponsee = call.invoke(lIcelogoUrl, "");
    } catch (SOAPException e) {
        // ... or print an error if something went wrong
        System.err.println("Caught SOAPException (" + e.getFaultCode() + "): " +
    e.getMessage());
        return;
    }
  • At this point, we should have a correct Response. This Response is used to extract a String with the SVG.
  • //get the result
    Parameter ret = lIceLogoResponse.getReturnValue();
    String lSVGResult = (String) ret.getValue();
  • This String with the svg content can be converted to images via the apache batik library. Here we will give a brief example of how the result can be converted to a jpeg image. More different image types are covered in the icelogoserver code.
  • //create an svg document
    String parser = XMLResourceDescriptor.getXMLParserClassName();
    SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
    InputStream is = new ByteArrayInputStream(lSVGResult.getBytes("UTF-8"));
    SVGDocument lSVGDocument = (SVGDocument) f.createDocument(null, is);
    //create the input
    TranscoderInput input = new TranscoderInput(lSVGDocument);
    //create an output and an outputstream
    OutputStream lOutstream = new FileOutputStream(lFilename);
    TranscoderOutput lOutput = new TranscoderOutput(lOutstream);
    //do the transcoding
    //we need a jpeg figure
    Transcoder lJPEGTranscoder = new JPEGTranscoder();
    lJPEGTranscoder.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(1.0));
    lJPEGTranscoder.transcode(input, lOutput);
    //close the stream
    lOutstream.flush();
    lOutstream.close();
    

Methods

For the full list of all possible methods and their parameters, please refer to the wsdl file.