Re: [Nusoap-general] Java hashtable: array serialized into 2 strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I believe the WSDL has the information required.

The getGenes operation is defined as
 
      <wsdl:operation name="getGenes" parameterOrder="in0">
         <wsdl:input name="getGenesRequest" message="impl:getGenesRequest"/>
         <wsdl:output name="getGenesResponse" message="impl:getGenesResponse"/>
         <wsdl:fault name="SOAPException" message="impl:SOAPException"/>
      </wsdl:operation>

The getGenesRequest message is defined as
 
   <wsdl:message name="getGenesRequest">
      <wsdl:part name="in0" type="apachesoap:Map"/>
   </wsdl:message>

The apachesoap:Map type is defined as

   <complexType name="Map">
    <sequence>
     <element name="item" minOccurs="0" maxOccurs="unbounded" type="apachesoap:mapItem"/>
    </sequence>
   </complexType>

The apachesoap:mapItem type is defined as

   <complexType name="mapItem">
    <sequence>
     <element name="key" nillable="true" type="xsd:string"/>
     <element name="value" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>

This means that each element of a Map looks like a PHP associative array with two elements

  $mapItem = array('key'=>'symbol', 'value' => $symbol);

To create a Map, you would do something like

  $items[] = array('key'=>'symbol1', 'value' => $symbol1);
  $items[] = array('key'=>'symbol2', 'value' => $symbol2);
  $items[] = array('key'=>'symbol3', 'value' => $symbol3);
  $map = array('item' => $items);

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: "Ivan Porro" <pivan@bio.dist.unige.it>
To: <nusoap-general@lists.sourceforge.net>
Cc: <soap@lists.php.net>
Sent: Tuesday, September 14, 2004 11:34 AM
Subject: [Nusoap-general] Java hashtable: array serialized into 2 strings


> Hi,
> 
> I'm usign NuSOAP but I think the question is general.
> 
> I'm writing a client to consume a webservice provided by caBIO (it's a 
> repository of web services dedicated to gene, proteine, mutation and similar 
> stuff involved in cancer research)
> 
> There are SOAP Lite Perl client, java client. The service is exposed as SOAP, 
> WSDL available. My problem is that a method I'm calling require a Java 
> hashtable, as one can see on:
>  http://ncicb.nci.nih.gov/NCICB/content/ncicblfs/caBIO2-1-1_JavaDocs
> 
> 
> getGenes:
> 
> public java.lang.String getGenes(java.util.Hashtable criteria)
>                           throws org.apache.soap.SOAPException
> 
>     Returns the string representation of the XML showing the requested Gene, 
> as specified by the provided search criteria (a Hashtable)
> 
> Parameters:
>     criteria - Hashtable containing the criteria to search for 
> Returns:
>     the String containing the XML result of the search 
> Throws:
>     org.apache.soap.SOAPException
> 
> 
> I know that a java hashtable is what PHP call an indexed array, i.e.
> 
> $query = array('key'=>'symbol', value => $symbol);
> 
> but this throw an exception and related error, because of array serialization 
> produce two strings, I think.
> 
> error available at:
>  http://www.bio.dist.unige.it/nusoap/cabio.php
> 
> web service WSDL available at:
>  http://www.bio.dist.unige.it/caBIO/web/wsdl/Gene.wsdl
> 
> client source available at:
>  http://www.bio.dist.unige.it/nusoap/cabio.phps
> 
> In fact, the step I'm missing is, given a WSDL description of a web service, 
> parse (in my mind :-) it and found what I've to do to call this.
> I'm trying with creation of a new soapvalue to pass during method invocation, 
> but I'm blowing my mind due to the fact I've found not too much docs on this 
> particular topics
> 
> thanks in advance,
> 
> Ivan
> 
> 
> 
> 
> -- 
> tel. +39 010 3532789
> fax. +39 010 3532948
> 
> _________________________________
>   www.bio.dist.unige.it/~pivan
> _________________________________
> A bus station is where a bus stops.
> A train station is where a train stops.
> On your desk, you have a workstation...
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
> Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
> Camcorder. More prizes in the weekly Lunch Hour Challenge.
> Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
> _______________________________________________
> Nusoap-general mailing list
> Nusoap-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nusoap-general
> 

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux