Loading ...
Sorry, an error occurred while loading the content.

2700FW: At my wits end.

Expand Messages
  • Brian Gilman
    Jun 11, 2003
    • 0 Attachment
      Hello,

      My name is Brian Gilman. I am currently writing a book on XML and
      BioInformatics for O'Reilly that includes a section on SOAP::Lite and Apache
      Axis toolkits.

      I am also the Inventor of a BioInformatics Toolkit called OmniGene. This
      is a toolkit that exposes Bioinformatics services as web services. I am
      trying to write a simple Client for our analysis engine. The method
      signature in java is:

      public JobInfo submitJob(int taskID, ParameterInfo[] parameters,
      DataHandler[] files);

      This is serialized into the SOAP messages: request and response attached
      and shown below.

      I have read through the perdoc/your book/ and a few hundred other
      resources and do not quite know how to write the code to talk to this
      service. I would like to put this into the book but cannot due to this
      roadblock.

      Here is what I understand so far:

      In order to do attachments I use SOAP::MIME. I wrote the following code
      to handle this (please forgive the really bad Perl coding as this is not my
      native tongue):

      if(@Files){
      foreach my $file (@Files){
      my $fileCounter++;

      my $ent = build MIME::Entity
      Type => "text/plain",
      Encoding => "binary",
      Path => $file,
      'Content-Id' =>'<File' . $fileCounter . '>',
      Disposition => "attachment";

      push(@fileHolder, $ent);
      }
      }

      I pass this to a SOAP::Lite object using the ->parts(@fileHolder)
      method.

      Now here's where I get lost:

      I need to construct an array of objects called ParameterInfo and pass
      them to my service. How do I do this in SOAP::Lite? I've looked into
      SOAP::Data objects and they look promising but, I'm not sure how to get the
      SOAP::Lite toolkit to encode these as a Java Map (well in this case Axis
      serialized Map?). Do I need to make my own serializer here?

      I would really appreciate your help!

      Best,

      Brian Gilman




      ==============
      Listen Port: 9090
      Target Host: localhost
      Target Port: 8080
      ==== Request ====
      POST /axis/servlet/AxisServlet HTTP/1.0

      Content-Type: multipart/related; type="text/xml";
      start="<97C2115D38FF77499E2CA04BB838E901>";
      boundary="----=_Part_0_7089827.1055376896680"

      Accept: application/soap+xml, application/dime, multipart/related, text/*

      User-Agent: Axis/1.1RC2

      Host: localhost

      Cache-Control: no-cache

      Pragma: no-cache

      SOAPAction: ""

      Content-Length: 3796





      ------=_Part_0_7089827.1055376896680

      Content-Type: text/xml; charset=UTF-8

      Content-Transfer-Encoding: binary

      Content-Id: <97C2115D38FF77499E2CA04BB838E901>



      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <ns1:submitJob
      soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:ns1="Analysis">
      <arg0 xsi:type="xsd:int">0</arg0>
      <arg1 xsi:type="soapenc:Array" soapenc:arrayType="ns1:ParmInfo[2]"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <item href="#id0"/>
      <item href="#id1"/>
      </arg1>
      <arg2 href="#id2"/>
      </ns1:submitJob>
      <multiRef id="id0" soapenc:root="0"
      soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xsi:type="ns2:ParmInfo"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:ns2="Analysis">
      <attributes href="#id3"/>
      <description xsi:type="xsd:string">input file 1</description>
      <inputFile xsi:type="xsd:boolean">true</inputFile>
      <label xsi:type="xsd:string"></label>
      <name xsi:type="xsd:string">-f1</name>
      <outputFile xsi:type="xsd:boolean">false</outputFile>
      <value xsi:type="xsd:string">test1.txt</value>
      </multiRef>
      <multiRef id="id2" soapenc:root="0"
      soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xsi:type="ns3:Map" xmlns:ns3="http://xml.apache.org/xml-soap"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <item>
      <key xsi:type="xsd:string">test1.txt</key>
      <value href="cid:519D4713CAC92D0A55F7F849680F1D56"
      xmlns:ns4="Analysis"/>
      </item>
      <item>
      <key xsi:type="xsd:string">test2.txt</key>
      <value href="cid:4D580598F9E5C89FA1FD17407BADABF5"
      xmlns:ns5="Analysis"/>
      </item>
      </multiRef>
      <multiRef id="id1" soapenc:root="0"
      soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xsi:type="ns6:ParmInfo" xmlns:ns6="Analysis"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <attributes href="#id4"/>
      <description xsi:type="xsd:string">input file 2</description>
      <inputFile xsi:type="xsd:boolean">true</inputFile>
      <label xsi:type="xsd:string"></label>
      <name xsi:type="xsd:string">-f2</name>
      <outputFile xsi:type="xsd:boolean">false</outputFile>
      <value xsi:type="xsd:string">test2.txt</value>
      </multiRef>
      <multiRef id="id3" soapenc:root="0"
      soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xsi:type="ns7:Map" xmlns:ns7="http://xml.apache.org/xml-soap"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <item>
      <key xsi:type="xsd:string">MODE</key>
      <value xsi:type="xsd:string">IN</value>
      </item>
      <item>
      <key xsi:type="xsd:string">TYPE</key>
      <value xsi:type="xsd:string">FILE</value>
      </item>
      </multiRef>
      <multiRef id="id4" soapenc:root="0"
      soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xsi:type="ns8:Map" xmlns:ns8="http://xml.apache.org/xml-soap"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <item>
      <key xsi:type="xsd:string">MODE</key>
      <value xsi:type="xsd:string">IN</value>
      </item>
      <item>
      <key xsi:type="xsd:string">TYPE</key>
      <value xsi:type="xsd:string">FILE</value>
      </item>
      </multiRef>
      </soapenv:Body>
      </soapenv:Envelope>

      ------=_Part_0_7089827.1055376896680

      Content-Type: text/plain

      Content-Transfer-Encoding: binary

      Content-Id: <519D4713CAC92D0A55F7F849680F1D56>



      >Test1
      aaaaaaaaggggggtttttttttccccccc


      ------=_Part_0_7089827.1055376896680

      Content-Type: text/plain

      Content-Transfer-Encoding: binary

      Content-Id: <4D580598F9E5C89FA1FD17407BADABF5>



      >Test2
      aaaaaaaatttttttggggggggggggggggccccccccccc


      ------=_Part_0_7089827.1055376896680--

      ==== Response ====
      HTTP/1.1 200 OK

      Set-Cookie: JSESSIONID=DAA82FFC4487D346BC5FFF90B8278066; Path=/axis

      Content-Type: text/xml; charset=utf-8

      Date: Thu, 12 Jun 2003 00:14:58 GMT

      Server: Apache Coyote/1.0

      Connection: close



      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <ns1:submitJobResponse
      soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:ns1="Analysis">
      <submitJobReturn xsi:type="ns1:JobInfo">
      <dateCompleted xsi:type="xsd:dateTime" xsi:nil="true"/>
      <dateSubmitted
      xsi:type="xsd:dateTime">2003-06-12T00:14:57.876Z</dateSubmitted>
      <inputFileName xsi:type="xsd:string"></inputFileName>
      <jobNumber xsi:type="xsd:int">0</jobNumber>
      <parameterInfo xsi:type="xsd:string"><?xml version="1.0"
      encoding="UTF-8"?>

      <ANALYSISPARAMETERS>
      <PARAMETER name="-f1"
      value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
      rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_test1.txt&q
      uot;>
      <DESCRIPTION>input file 1</DESCRIPTION>
      <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
      <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
      <ATTRIBUTE
      key="LABEL"></ATTRIBUTE></PARAMETER>
      <PARAMETER name="-f2"
      value="/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/runtime/jaka
      rta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_test2.txt&q
      uot;>
      <DESCRIPTION>input file 2</DESCRIPTION>
      <ATTRIBUTE key="MODE">IN</ATTRIBUTE>
      <ATTRIBUTE key="TYPE">FILE</ATTRIBUTE>
      <ATTRIBUTE
      key="LABEL"></ATTRIBUTE></PARAMETER></ANALYSISPA
      RAMETERS>
      </parameterInfo>
      <parameterInfoArray xsi:type="soapenc:Array"
      soapenc:arrayType="ns1:ParmInfo[2]"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <item>
      <attributes xsi:type="ns2:Map"
      xmlns:ns2="http://xml.apache.org/xml-soap">
      <item>
      <key xsi:type="xsd:string">MODE</key>
      <value xsi:type="xsd:string">IN</value>
      </item>
      <item>
      <key xsi:type="xsd:string">TYPE</key>
      <value xsi:type="xsd:string">FILE</value>
      </item>
      <item>
      <key xsi:type="xsd:string">LABEL</key>
      <value xsi:type="xsd:string"></value>
      </item>
      </attributes>
      <description xsi:type="xsd:string">input file 1</description>
      <inputFile xsi:type="xsd:boolean">true</inputFile>
      <label xsi:type="xsd:string"></label>
      <name xsi:type="xsd:string">-f1</name>
      <outputFile xsi:type="xsd:boolean">false</outputFile>
      <value
      xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
      ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53370axis_t
      est1.txt</value>
      </item>
      <item>
      <attributes xsi:type="ns3:Map"
      xmlns:ns3="http://xml.apache.org/xml-soap">
      <item>
      <key xsi:type="xsd:string">MODE</key>
      <value xsi:type="xsd:string">IN</value>
      </item>
      <item>
      <key xsi:type="xsd:string">TYPE</key>
      <value xsi:type="xsd:string">FILE</value>
      </item>
      <item>
      <key xsi:type="xsd:string">LABEL</key>
      <value xsi:type="xsd:string"></value>
      </item>
      </attributes>
      <description xsi:type="xsd:string">input file 2</description>
      <inputFile xsi:type="xsd:boolean">true</inputFile>
      <label xsi:type="xsd:string"></label>
      <name xsi:type="xsd:string">-f2</name>
      <outputFile xsi:type="xsd:boolean">false</outputFile>
      <value
      xsi:type="xsd:string">/Users/gilmanb/sourceforge/omnigene2/omnigene-1.1.3/ru
      ntime/jakarta-tomcat-4.1.24/webapps/axis/WEB-INF/attachments/Axis53371axis_t
      est2.txt</value>
      </item>
      </parameterInfoArray>
      <resultFileName xsi:type="xsd:string" xsi:nil="true"/>
      <status xsi:type="xsd:string">Not Started</status>
      <taskID xsi:type="xsd:int">0</taskID>
      <userId xsi:type="xsd:string"></userId>
      </submitJobReturn>
      </ns1:submitJobResponse>
      </soapenv:Body>
      </soapenv:Envelope>
      ==============


      --
      Brian Gilman <gilmanb@...>
      Group Leader Medical & Population Genetics Dept.
      MIT/Whitehead Inst. Center for Genome Research
      One Kendall Square, Bldg. 300 / Cambridge, MA 02139-1561 USA
      phone +1 617 252 1069 / fax +1 617 252 1902

      ------ End of Forwarded Message
    • Show all 4 messages in this topic