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

Client handling of lists ?

Expand Messages
  • dfrankow
    Folks, I am just starting out with SOAP, Apache Axis (Java version), and SOAP::Lite. I am trying some simple things, and one is confusing me. I took
    Message 1 of 3 , Aug 12, 2005
    • 0 Attachment
      Folks,

      I am just starting out with SOAP, Apache Axis (Java version), and
      SOAP::Lite. I am trying some simple things, and one is confusing me.

      I took axis-1_2_1/webapps/axis/EchoHeaders.jws, and dropped it into
      the root of my web application. The relevant portion is:

      public class EchoHeaders {
      public String[] list();
      public String whoami();
      public String echo(String param);
      ...
      }

      I include the full WSDL for EchoHeaders below.

      Now I have a Perl test program written with SOAP::Lite (see
      soap-test.pl below), and it gets whoami and echo just great. However,
      with list() it gives an error. It looks like the list of results
      confuses it.

      I looked around the soaplite.org, in the cookbook, in the quick-start,
      and saw nothing appropriate. I saw in the quick-start the paramsout()
      function (hence put it in below), but it's dying on the call, before
      getting to that.

      Any suggestions?

      Dan

      P.S. Running on some version of ubuntu:

      % uname -a
      Linux gibson 2.4.27-5-686-smp #1 SMP Fri Oct 15 10:00:54 CDT 2004 i686
      unknown

      Perl 5.8
      SOAP::Lite 0.60
      XML::Parser 2.34

      ======================================================

      soap-test.pl

      % cat webapps/root/misc/soap-test.pl
      #!/soft/perl5.8/bin/perl -w

      use strict;
      use SOAP::Lite;

      my $mlServer = SOAP::Lite -> service("file:EchoServer.wsdl");
      my $result = $mlServer -> whoami();
      print "result: $result\n";


      $result = $mlServer -> echo("foo");

      print "result: $result\n";

      #foreach my $key (keys %$result) {
      # print "$key $$result{$key}\n";
      #}


      my $response = $mlServer -> list();

      print "hello";

      my @result = $response->paramsout;

      print "result: @result\n";

      =====================================================

      soap-test.pl output:

      % perl soap-test.pl
      result: Hello caller from gibson.cs.umn.edu
      result: foo

      duplicate attribute at line 1, column 410, byte 410 at
      /soft/perl5.8/lib/site_perl/5.8.0/i686-linux-ld/XML/Parser.pm line 187
      <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope
      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instan
      ce"><soapenv:Body><ns1:listResponse
      soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:ns1="urn:EchoHeaders"><listReturn
      soapenc:arrayType="ns2:string[8]" xsi:type="soapenc:Array"
      xsi:type="soapenc:Array" xmlns:ns2="http://www.w3.org/2001/XMLSchema"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><listReturn
      xsi:type="ns2:string">te:deflate,gzip;q=0.3</listReturn><listReturn
      xsi:type="ns2:string">connection:TE, close</listReturn><listReturn
      xsi:type="ns2:string">accept:text/xml</listReturn><listReturn
      xsi:type="ns2:string">host:gibson.cs.umn.edu:8201<
      /listReturn><listReturn
      xsi:type="ns2:string">user-agent:SOAP::Lite/Perl/0
      .60</listReturn><listReturn
      xsi:type="ns2:string">content-length:439</listReturn><listReturn
      xsi:type="ns2:string">content-type:text/xml;
      charset=utf-8</listReturn><listReturn
      xsi:type="ns2:string">soapaction:""</lis
      tReturn></listReturn></ns1:listResponse></soapenv:
      Body></soapenv:Envelope>
      at soap-test.pl line 20

      ==========================================================

      EchoHeaders.wsdl

      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions targetNamespace="urn:EchoHeaders"
      xmlns:apachesoap="http://xml
      .apache.org/xml-soap" xmlns:impl="urn:EchoHeaders"
      xmlns:intf="urn:EchoHeaders"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:wsdl="http://sch
      emas.xmlsoap.org/wsdl/"
      xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" x
      mlns:xsd="http://www.w3.org/2001/XMLSchema">
      <!--WSDL created by Apache Axis version: 1.2.1
      Built on Jun 14, 2005 (09:15:57 EDT)-->
      <wsdl:types>
      <schema targetNamespace="urn:EchoHeaders"
      xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <complexType name="ArrayOf_soapenc_string">
      <complexContent>
      <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType"
      wsdl:arrayType="soapenc:string[]"/>
      </restriction>
      </complexContent>
      </complexType>
      </schema>
      </wsdl:types>

      <wsdl:message name="whoamiResponse">

      <wsdl:part name="whoamiReturn" type="soapenc:string"/>

      </wsdl:message>

      <wsdl:message name="listResponse">

      <wsdl:part name="listReturn" type="impl:Arra
      yOf_soapenc_string"/>

      </wsdl:message>

      <wsdl:message name="whoamiRequest">

      </wsdl:message>

      <wsdl:message name="listRequest">

      </wsdl:message>

      <wsdl:message name="echoResponse">

      <wsdl:part name="echoReturn" type="soapenc:string"/>

      </wsdl:message>

      <wsdl:message name="echoRequest">

      <wsdl:part name="in0" type="soapenc:string"/>

      </wsdl:message>

      <wsdl:portType name="EchoHeaders">

      <wsdl:operation name="echo" parameterOrder="in0">

      <wsdl:input message="impl:echoRequest" name="echoRequest"/>

      <wsdl:output message="impl:echoResponse"
      name="echoResponse"/>

      </wsdl:operation>

      <wsdl:operation name="whoami">

      <wsdl:input message="impl:whoamiRequest"
      name="whoamiRequest"/>

      <wsdl:output message="impl:whoamiResponse"
      name="whoamiResponse"/>

      </wsdl:operation>

      <wsdl:operation name="list">

      <wsdl:input message="impl:listRequest" name="listRequest"/>

      <wsdl:output message="impl:listResponse"
      name="listResponse"/>

      </wsdl:operation>

      </wsdl:portType>

      <wsdl:binding name="EchoHeadersSoapBinding" typ
      e="impl:EchoHeaders">

      <wsdlsoap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/h
      ttp"/>

      <wsdl:operation name="echo">

      <wsdlsoap:operation soapAction=""/>

      <wsdl:input name="echoRequest">

      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encodi
      ng/" namespace="urn:EchoHeaders" use="encoded"/>

      </wsdl:input>

      <wsdl:output name="echoResponse">

      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encodi
      ng/" namespace="urn:EchoHeaders" use="encoded"/>

      </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="whoami">

      <wsdlsoap:operation soapAction=""/>

      <wsdl:input name="whoamiRequest">

      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encodi
      ng/" namespace="urn:EchoHeaders" use="encoded"/>

      </wsdl:input>

      <wsdl:output name="whoamiResponse">

      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encodi
      ng/" namespace="urn:EchoHeaders" use="encoded"/>

      </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="list">

      <wsdlsoap:operation soapAction=""/>

      <wsdl:input name="listRequest">

      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encodi
      ng/" namespace="urn:EchoHeaders" use="encoded"/>

      </wsdl:input>

      <wsdl:output name="listResponse">

      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encodi
      ng/" namespace="urn:EchoHeaders" use="encoded"/>

      </wsdl:output>

      </wsdl:operation>

      </wsdl:binding>

      <wsdl:service name="EchoHeadersService">

      <wsdl:port binding="impl:EchoHeadersSoapBinding"
      name="EchoHeaders">

      <wsdlsoap:address
      location="http://gibson.cs.umn.edu:8201/EchoHeaders.j
      ws"/>


      </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="list">

      <wsdlsoap:operation soapAction=""/>

      <wsdl:input name="listRequest">

      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encodi
      ng/" namespace="urn:EchoHeaders" use="encoded"/>

      </wsdl:input>

      <wsdl:output name="listResponse">

      <wsdlsoap:body
      encodingStyle="http://schemas.xmlsoap.org/soap/encodi
      ng/" namespace="urn:EchoHeaders" use="encoded"/>

      </wsdl:output>

      </wsdl:operation>

      </wsdl:binding>

      <wsdl:service name="EchoHeadersService">

      <wsdl:port binding="impl:EchoHeadersSoapBinding"
      name="EchoHeaders">

      <wsdlsoap:address
      location="http://gibson.cs.umn.edu:8201/EchoHeaders.j
      ws"/>

      </wsdl:port>

      </wsdl:service>

      </wsdl:definitions>
    • Duncan Cameron
      ... There are two xsi:type attributes present. I have no idea why that should be happening but suggest that you look at the Axis server code. Duncan
      Message 2 of 3 , Aug 12, 2005
      • 0 Attachment
        --- dfrankow <dfrankow@...> wrote:

        > Folks,
        >
        > I am just starting out with SOAP, Apache Axis (Java version), and
        > SOAP::Lite. I am trying some simple things, and one is confusing me.
        >
        > I took axis-1_2_1/webapps/axis/EchoHeaders.jws, and dropped it into
        > the root of my web application. The relevant portion is:
        >
        > public class EchoHeaders {
        > public String[] list();
        > public String whoami();
        > public String echo(String param);
        > ...
        > }
        >
        > I include the full WSDL for EchoHeaders below.
        >
        > Now I have a Perl test program written with SOAP::Lite (see
        > soap-test.pl below), and it gets whoami and echo just great.
        > However,
        > with list() it gives an error. It looks like the list of results
        > confuses it.
        >
        > I looked around the soaplite.org, in the cookbook, in the
        > quick-start,
        > and saw nothing appropriate. I saw in the quick-start the
        > paramsout()
        > function (hence put it in below), but it's dying on the call, before
        > getting to that.
        >
        > Any suggestions?
        >
        Well, this is what is causing the problem:

        > duplicate attribute at line 1, column 410, byte 410 at
        > /soft/perl5.8/lib/site_perl/5.8.0/i686-linux-ld/XML/Parser.pm line
        > 187


        > <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope
        > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
        > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instan
        > ce"><soapenv:Body><ns1:listResponse
        > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:ns1="urn:EchoHeaders"><listReturn
        > soapenc:arrayType="ns2:string[8]" xsi:type="soapenc:Array"
        > xsi:type="soapenc:Array" xmlns:ns2="http://www.w3.org/2001/XMLSchema"

        There are two xsi:type attributes present. I have no idea why that
        should be happening but suggest that you look at the Axis server code.

        Duncan





        ___________________________________________________________
        How much free photo storage do you get? Store your holiday
        snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
      • dfrankow
        ... I tried to post this response to the list twice. Yahoo says it s posted, but then it doesn t show up. Anyway, yep, this is an Axis bug. See
        Message 3 of 3 , Aug 12, 2005
        • 0 Attachment
          SOAP::Lite post:

          > There are two xsi:type attributes present. I have no idea why that
          > should be happening but suggest that you look at the Axis server code.

          I tried to post this response to the list twice. Yahoo says it's
          posted, but then it doesn't show up.

          Anyway, yep, this is an Axis bug. See

          http://issues.apache.org/jira/browse/AXIS-2100
          http://issues.apache.org/jira/browse/AXIS-2127

          Dan
        Your message has been successfully submitted and would be delivered to recipients shortly.