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

Re: [soaplite] SOAP::Lite and Java String-Array

Expand Messages
  • Mikel Salaberria
    Hi kai!! I have worked with String Arrays in Perl, and I didn t have any problem. Try with this: use SOAP::Lite; my @result = @ { SOAP::Lite
    Message 1 of 2 , Jan 24, 2005
    • 0 Attachment
      Hi kai!!

      I have worked with String Arrays in Perl, and I
      didn't have any problem. Try with this:

      use SOAP::Lite;

      my @result = @ { SOAP::Lite
      ->service('http://localhost:8080/axis/services/BookServiceEAR?wsdl')
      ->listBooks(5) } ;

      and then you probably will have the list of the books
      in:

      $result[0], $result[1], ...

      Best regards,
      Xala



      --- kaidaniel2 <kai_ernst@...> escribió:

      ---------------------------------

      Hi!

      I've seen some postings from you in a yahoo-group
      where you'are trying
      so solve the same problems wich are similar to mine.

      I'm writing a diploma-thesis about Java Web Services.
      Everythings
      works fine so far. But for the evidence of
      interoperability i need to
      write serveral Clients in different programming
      languages. Right now
      I've the problem to access my J2EE-Web Service with
      SOAP:Lite.

      Here's the Java-Datatype I want to access via
      SOAP::Lite:

      public String [] listBooks(Integer rate) {
      ...
      String [] list = new String[vect.size()];
      vect.copyInto(list);

      return list;

      The following code-frag. belongs to the SOAP::Lite
      client:

      use SOAP::Lite;
      use Data::Dumper;

      use SOAP::Lite;
      use Data::Dumper;

      my $server =
      SOAP::Lite->service('http://localhost:8080/axis/services/BookServiceEAR?wsdl');
      my $result = $server->listBooks(5);
      my $hash = $result;
      my $soapHash = ( [ map {SOAP::Data -> value($_) ->type
      ( 'string' )}
      $hash] );


      for($i=0;$i<=$#soapHash;$i++) {
      print "Following books where rated:
      $soapHash[$i] \n";
      }

      #print Dumper ($soapHash);

      Maybe I should mention that I'm fairly new with
      Perl...

      The SOAP::Lite Dumper output is as follows:
      $VAR1 = [
      bless( {
      '_type' => 'string',
      '_signature' => [],
      '_value' => [
      [
      '0,Title: Java
      Servlet
      Programming,price: 32.
      95',
      '1,Title: Java
      I/O,price: 32.95',
      '2,Title: Java 2D
      Graphics,price:
      29.95',
      '3,Title: Creating
      Effective
      JavaHelp,price:
      29.95'
      ]
      ],
      '_attr' => {}
      }, 'SOAP::Data' )
      ];

      Finallaly my WSDL-File:

      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions
      targetNamespace="http://localhost:8080/axis/services/BookServiceEAR"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:apachesoap="http://xml.apache.org/xml-soap"
      xmlns:impl="http://localhost:8080/axis/services/BookServiceEAR"
      xmlns:intf="http://localhost:8080/axis/services/BookServiceEAR"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"><wsdl:types><schema
      targetNamespace="http://localhost:8080/axis/services/BookServiceEAR"
      xmlns="http://www.w3.org/2001/XMLSchema"><import
      namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType
      name="ArrayOf_xsd_string"><complexContent><restriction
      base="soapenc:Array"><attribute
      ref="soapenc:arrayType"
      wsdl:arrayType="xsd:string[]"/></restriction></complexContent></complexType></schema></wsdl:types>
      <wsdl:message name="listBooksResponse">
      <wsdl:part name="listBooksReturn"
      type="impl:ArrayOf_xsd_string"/>
      </wsdl:message>
      <wsdl:message name="listBooksRequest">
      <wsdl:part name="in0" type="xsd:int"/>
      </wsdl:message>
      <wsdl:message name="testResponse">
      <wsdl:part name="testReturn" type="xsd:string"/>
      </wsdl:message>
      <wsdl:message name="testRequest">
      <wsdl:part name="in0" type="xsd:string"/>
      </wsdl:message>
      <wsdl:portType name="BookSessionLocal">
      <wsdl:operation name="test" parameterOrder="in0">
      <wsdl:input message="impl:testRequest"
      name="testRequest"/>
      <wsdl:output message="impl:testResponse"
      name="testResponse"/>
      </wsdl:operation>
      <wsdl:operation name="listBooks"
      parameterOrder="in0">
      <wsdl:input message="impl:listBooksRequest"
      name="listBooksRequest"/>
      <wsdl:output message="impl:listBooksResponse"
      name="listBooksResponse"/>
      </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="BookServiceEARSoapBinding"
      type="impl:BookSessionLocal">
      <wsdlsoap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="test">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="testRequest">
      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="http://booksession.trier.de"
      use="encoded"/>
      </wsdl:input>
      <wsdl:output name="testResponse">
      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="http://localhost:8080/axis/services/BookServiceEAR"
      use="encoded"/>
      </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="listBooks">
      <wsdlsoap:operation soapAction=""/>
      <wsdl:input name="listBooksRequest">
      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="http://booksession.trier.de"
      use="encoded"/>
      </wsdl:input>
      <wsdl:output name="listBooksResponse">
      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      namespace="http://localhost:8080/axis/services/BookServiceEAR"
      use="encoded"/>
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="BookSessionLocalService">
      <wsdl:port
      binding="impl:BookServiceEARSoapBinding"
      name="BookServiceEAR">
      <wsdlsoap:address
      location="http://localhost:8080/axis/services/BookServiceEAR"/>
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>

      Would be very appreciated for any help.

      thanks in advance,

      kai.







      ---------------------------------
      Yahoo! Groups Links

      To visit your group on the web, go to:
      http://groups.yahoo.com/group/soaplite/

      To unsubscribe from this group, send an email to:
      soaplite-unsubscribe@yahoogroups.com

      Your use of Yahoo! Groups is subject to the Yahoo!
      Terms of Service.




      ______________________________________________
      Renovamos el Correo Yahoo!: ¡250 MB GRATIS!
      Nuevos servicios, más seguridad
      http://correo.yahoo.es
    Your message has been successfully submitted and would be delivered to recipients shortly.