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

SOAP::Lite Perl client connecting to Java JAX-RPC Ref Impl

Expand Messages
  • nate_bowler
    First of all, let me say that I have had great success using a Perl client to connect to my Java WS! I m running Perl on Win32 and the stubmaker.pl tool
    Message 1 of 4 , Jul 9, 2002
    • 0 Attachment
      First of all, let me say that I have had great success using a Perl
      client to connect to my Java WS! I'm running Perl on Win32 and the
      stubmaker.pl tool included in the <SOAP_LITE_HOME>/bin directory
      worked great at creating a class to use to connect to my server.

      However, arrays do not work.

      For my server I'm using Tomcat and Sun's JAX-RPC API found in the
      Java Web Services Dev Kit.

      Tomcat returns an error whenever I try to call any function that
      accepts/returns arrays because of what appears to be an older schema
      tag being sent.

      For example, a test function (Java) "public int addAll(int[] vals)"
      returns this error:

      [ERROR] server - -unexpected array element type: expected=
      {http://www.w3.org/2001/XMLSchema}int, actual={http://www.w3.o
      rg/1999/XMLSchema}int <unexpected array element type: expected=
      {http://www.w3.org/2001/XMLSchema}int, actual={http://www
      .w3.org/1999/XMLSchema}int>

      This is the actual XML being sent by the perl client to my server:

      <?xml version="1.0" encoding="UTF-8" ?>
      - <SOAP-ENV:Envelope xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      - <SOAP-ENV:Body>
      - <namesp5:addAll xmlns:namesp5="http://www.attask.com/api">
      - <arrayOfint_1 SOAP-ENC:arrayType="xsd:int[2]"
      xsi:type="tns:ArrayOfint">
      <item xsi:type="xsd:int">16</item>
      <item xsi:type="xsd:int">14</item>
      </arrayOfint_1>
      </namesp5:addAll>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>


      The actual XML response is:
      <?xml version="1.0" encoding="UTF-8"?>
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:ns0="http://www.attask.com/api"
      env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Bod
      y><env:Fault><faultcode>env:Server</faultcode><faultstring>Internal
      Server Error (unexpected array element type: expected=
      {http://www.w3.org/2001/XMLSchema}int, actual=
      {http://www.w3.org/1999/XMLSchema}int)
      </faultstring></env:Fault></env:Body></env:Envelope>

      I'm not an expert Perl programmer, and I tried changing different
      values in the Lite.pm file to see if I could get the client to send
      the http://www.w3.org/2001/XMLSchema header, but nothing I've tried
      works.

      Can anybody offer a suggestion that would help me to send/receive
      array types with this Java WS?

      Nate
    • nate_bowler
      BTW, without using the stubmaker.pl, I get the same error. Do I need to override a serializer or something? Everything else in the XML looks good, but the
      Message 2 of 4 , Jul 9, 2002
      • 0 Attachment
        BTW, without using the stubmaker.pl, I get the same error.

        Do I need to override a serializer or something? Everything else in
        the XML looks good, but the JAX-RPC implementation is picky about
        this.

        Nate

        <code>
        use SOAP::Lite;

        # using WSDL
        # THIS ONE WORKS. IT SIMPLY PASSES 2 INTS!!!
        print SOAP::Lite
        -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
        -> add( 10,20), "\n";


        # THIS ONE FAILS. IT PASSES AN ARRAY. THE ERROR IS THE SAME
        print SOAP::Lite
        -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
        -> addAll(SOAP::Data->value([10,20,50]))
        -> result;
        </code>

        --- In soaplite@y..., "nate_bowler" <nate_bowler@a...> wrote:
        > First of all, let me say that I have had great success using a Perl
        > client to connect to my Java WS! I'm running Perl on Win32 and the
        > stubmaker.pl tool included in the <SOAP_LITE_HOME>/bin directory
        > worked great at creating a class to use to connect to my server.
        >
        > However, arrays do not work.
        >
        > For my server I'm using Tomcat and Sun's JAX-RPC API found in the
        > Java Web Services Dev Kit.
        >
        > Tomcat returns an error whenever I try to call any function that
        > accepts/returns arrays because of what appears to be an older
        schema
        > tag being sent.
        >
        > For example, a test function (Java) "public int addAll(int[] vals)"
        > returns this error:
        >
        > [ERROR] server - -unexpected array element type: expected=
        > {http://www.w3.org/2001/XMLSchema}int, actual={http://www.w3.o
        > rg/1999/XMLSchema}int <unexpected array element type: expected=
        > {http://www.w3.org/2001/XMLSchema}int, actual={http://www
        > .w3.org/1999/XMLSchema}int>
        >
        > This is the actual XML being sent by the perl client to my server:
        >
        > <?xml version="1.0" encoding="UTF-8" ?>
        > - <SOAP-ENV:Envelope xmlns:SOAP-
        > ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
        > ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        > xmlns:xsd="http://www.w3.org/1999/XMLSchema">
        > - <SOAP-ENV:Body>
        > - <namesp5:addAll xmlns:namesp5="http://www.attask.com/api">
        > - <arrayOfint_1 SOAP-ENC:arrayType="xsd:int[2]"
        > xsi:type="tns:ArrayOfint">
        > <item xsi:type="xsd:int">16</item>
        > <item xsi:type="xsd:int">14</item>
        > </arrayOfint_1>
        > </namesp5:addAll>
        > </SOAP-ENV:Body>
        > </SOAP-ENV:Envelope>
        >
        >
        > The actual XML response is:
        > <?xml version="1.0" encoding="UTF-8"?>
        > <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
        > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        > xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:ns0="http://www.attask.com/api"
        >
        env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Bod
        > y><env:Fault><faultcode>env:Server</faultcode><faultstring>Internal
        > Server Error (unexpected array element type: expected=
        > {http://www.w3.org/2001/XMLSchema}int, actual=
        > {http://www.w3.org/1999/XMLSchema}int)
        > </faultstring></env:Fault></env:Body></env:Envelope>
        >
        > I'm not an expert Perl programmer, and I tried changing different
        > values in the Lite.pm file to see if I could get the client to send
        > the http://www.w3.org/2001/XMLSchema header, but nothing I've tried
        > works.
        >
        > Can anybody offer a suggestion that would help me to send/receive
        > array types with this Java WS?
        >
        > Nate
      • Paul Kulchenko
        Hi, Nate! ... try this: print SOAP::Lite - service( http://63.228.219.51:8080/attask/APIService.wsdl ) - xmlschema(2001) - addAll([10,20,50]) - result;
        Message 3 of 4 , Jul 9, 2002
        • 0 Attachment
          Hi, Nate!

          > # THIS ONE FAILS. IT PASSES AN ARRAY. THE ERROR IS THE SAME
          > print SOAP::Lite
          > -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
          > -> addAll(SOAP::Data->value([10,20,50]))
          > -> result;
          try this:

          print SOAP::Lite
          -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
          -> xmlschema(2001)
          -> addAll([10,20,50])
          -> result;

          Best wishes, Paul.

          --- nate_bowler <nate_bowler@...> wrote:
          > BTW, without using the stubmaker.pl, I get the same error.
          >
          > Do I need to override a serializer or something? Everything else in
          >
          > the XML looks good, but the JAX-RPC implementation is picky about
          > this.
          >
          > Nate
          >
          > <code>
          > use SOAP::Lite;
          >
          > # using WSDL
          > # THIS ONE WORKS. IT SIMPLY PASSES 2 INTS!!!
          > print SOAP::Lite
          > -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
          > -> add( 10,20), "\n";
          >
          >
          > # THIS ONE FAILS. IT PASSES AN ARRAY. THE ERROR IS THE SAME
          > print SOAP::Lite
          > -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
          > -> addAll(SOAP::Data->value([10,20,50]))
          > -> result;
          > </code>
          >
          > --- In soaplite@y..., "nate_bowler" <nate_bowler@a...> wrote:
          > > First of all, let me say that I have had great success using a
          > Perl
          > > client to connect to my Java WS! I'm running Perl on Win32 and
          > the
          > > stubmaker.pl tool included in the <SOAP_LITE_HOME>/bin directory
          > > worked great at creating a class to use to connect to my server.
          > >
          > > However, arrays do not work.
          > >
          > > For my server I'm using Tomcat and Sun's JAX-RPC API found in the
          >
          > > Java Web Services Dev Kit.
          > >
          > > Tomcat returns an error whenever I try to call any function that
          > > accepts/returns arrays because of what appears to be an older
          > schema
          > > tag being sent.
          > >
          > > For example, a test function (Java) "public int addAll(int[]
          > vals)"
          > > returns this error:
          > >
          > > [ERROR] server - -unexpected array element type: expected=
          > > {http://www.w3.org/2001/XMLSchema}int, actual={http://www.w3.o
          > > rg/1999/XMLSchema}int <unexpected array element type: expected=
          > > {http://www.w3.org/2001/XMLSchema}int, actual={http://www
          > > .w3.org/1999/XMLSchema}int>
          > >
          > > This is the actual XML being sent by the perl client to my
          > server:
          > >
          > > <?xml version="1.0" encoding="UTF-8" ?>
          > > - <SOAP-ENV:Envelope xmlns:SOAP-
          > > ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
          > > ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
          > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
          > > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
          > > xmlns:xsd="http://www.w3.org/1999/XMLSchema">
          > > - <SOAP-ENV:Body>
          > > - <namesp5:addAll xmlns:namesp5="http://www.attask.com/api">
          > > - <arrayOfint_1 SOAP-ENC:arrayType="xsd:int[2]"
          > > xsi:type="tns:ArrayOfint">
          > > <item xsi:type="xsd:int">16</item>
          > > <item xsi:type="xsd:int">14</item>
          > > </arrayOfint_1>
          > > </namesp5:addAll>
          > > </SOAP-ENV:Body>
          > > </SOAP-ENV:Envelope>
          > >
          > >
          > > The actual XML response is:
          > > <?xml version="1.0" encoding="UTF-8"?>
          > > <env:Envelope
          > xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
          > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          > > xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
          > > xmlns:ns0="http://www.attask.com/api"
          > >
          >
          env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Bod
          > >
          > y><env:Fault><faultcode>env:Server</faultcode><faultstring>Internal
          >
          > > Server Error (unexpected array element type: expected=
          > > {http://www.w3.org/2001/XMLSchema}int, actual=
          > > {http://www.w3.org/1999/XMLSchema}int)
          > > </faultstring></env:Fault></env:Body></env:Envelope>
          > >
          > > I'm not an expert Perl programmer, and I tried changing different
          >
          > > values in the Lite.pm file to see if I could get the client to
          > send
          > > the http://www.w3.org/2001/XMLSchema header, but nothing I've
          > tried
          > > works.
          > >
          > > Can anybody offer a suggestion that would help me to send/receive
          >
          > > array types with this Java WS?
          > >
          > > Nate
          >
          >
          > ------------------------ Yahoo! Groups Sponsor
          >
          > To unsubscribe from this group, send an email to:
          > soaplite-unsubscribe@yahoogroups.com
          >
          >
          >
          > Your use of Yahoo! Groups is subject to
          > http://docs.yahoo.com/info/terms/
          >
          >


          __________________________________________________
          Do You Yahoo!?
          Sign up for SBC Yahoo! Dial - First Month Free
          http://sbc.yahoo.com
        • Rick Nicoletti
          What does the xmlschema() method do? I can t find any reference to it in the man pages. -Rick
          Message 4 of 4 , Jul 15, 2002
          • 0 Attachment
            What does the xmlschema() method do? I can't find any reference to it
            in the man pages.

            -Rick

            Thus spake Paul Kulchenko (paulclinger@...):

            > Hi, Nate!
            >
            > > # THIS ONE FAILS. IT PASSES AN ARRAY. THE ERROR IS THE SAME
            > > print SOAP::Lite
            > > -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
            > > -> addAll(SOAP::Data->value([10,20,50]))
            > > -> result;
            > try this:
            >
            > print SOAP::Lite
            > -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
            > -> xmlschema(2001)
            > -> addAll([10,20,50])
            > -> result;
            >
            > Best wishes, Paul.
            >
            > --- nate_bowler <nate_bowler@...> wrote:
            > > BTW, without using the stubmaker.pl, I get the same error.
            > >
            > > Do I need to override a serializer or something? Everything else in
            > >
            > > the XML looks good, but the JAX-RPC implementation is picky about
            > > this.
            > >
            > > Nate
            > >
            > > <code>
            > > use SOAP::Lite;
            > >
            > > # using WSDL
            > > # THIS ONE WORKS. IT SIMPLY PASSES 2 INTS!!!
            > > print SOAP::Lite
            > > -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
            > > -> add( 10,20), "\n";
            > >
            > >
            > > # THIS ONE FAILS. IT PASSES AN ARRAY. THE ERROR IS THE SAME
            > > print SOAP::Lite
            > > -> service('http://63.228.219.51:8080/attask/APIService.wsdl')
            > > -> addAll(SOAP::Data->value([10,20,50]))
            > > -> result;
            > > </code>
            > >
            > > --- In soaplite@y..., "nate_bowler" <nate_bowler@a...> wrote:
            > > > First of all, let me say that I have had great success using a
            > > Perl
            > > > client to connect to my Java WS! I'm running Perl on Win32 and
            > > the
            > > > stubmaker.pl tool included in the <SOAP_LITE_HOME>/bin directory
            > > > worked great at creating a class to use to connect to my server.
            > > >
            > > > However, arrays do not work.
            > > >
            > > > For my server I'm using Tomcat and Sun's JAX-RPC API found in the
            > >
            > > > Java Web Services Dev Kit.
            > > >
            > > > Tomcat returns an error whenever I try to call any function that
            > > > accepts/returns arrays because of what appears to be an older
            > > schema
            > > > tag being sent.
            > > >
            > > > For example, a test function (Java) "public int addAll(int[]
            > > vals)"
            > > > returns this error:
            > > >
            > > > [ERROR] server - -unexpected array element type: expected=
            > > > {http://www.w3.org/2001/XMLSchema}int, actual={http://www.w3.o
            > > > rg/1999/XMLSchema}int <unexpected array element type: expected=
            > > > {http://www.w3.org/2001/XMLSchema}int, actual={http://www
            > > > .w3.org/1999/XMLSchema}int>
            > > >
            > > > This is the actual XML being sent by the perl client to my
            > > server:
            > > >
            > > > <?xml version="1.0" encoding="UTF-8" ?>
            > > > - <SOAP-ENV:Envelope xmlns:SOAP-
            > > > ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-
            > > > ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            > > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
            > > > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
            > > > xmlns:xsd="http://www.w3.org/1999/XMLSchema">
            > > > - <SOAP-ENV:Body>
            > > > - <namesp5:addAll xmlns:namesp5="http://www.attask.com/api">
            > > > - <arrayOfint_1 SOAP-ENC:arrayType="xsd:int[2]"
            > > > xsi:type="tns:ArrayOfint">
            > > > <item xsi:type="xsd:int">16</item>
            > > > <item xsi:type="xsd:int">14</item>
            > > > </arrayOfint_1>
            > > > </namesp5:addAll>
            > > > </SOAP-ENV:Body>
            > > > </SOAP-ENV:Envelope>
            > > >
            > > >
            > > > The actual XML response is:
            > > > <?xml version="1.0" encoding="UTF-8"?>
            > > > <env:Envelope
            > > xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
            > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            > > > xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
            > > > xmlns:ns0="http://www.attask.com/api"
            > > >
            > >
            > env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><env:Bod
            > > >
            > > y><env:Fault><faultcode>env:Server</faultcode><faultstring>Internal
            > >
            > > > Server Error (unexpected array element type: expected=
            > > > {http://www.w3.org/2001/XMLSchema}int, actual=
            > > > {http://www.w3.org/1999/XMLSchema}int)
            > > > </faultstring></env:Fault></env:Body></env:Envelope>
            > > >
            > > > I'm not an expert Perl programmer, and I tried changing different
            > >
            > > > values in the Lite.pm file to see if I could get the client to
            > > send
            > > > the http://www.w3.org/2001/XMLSchema header, but nothing I've
            > > tried
            > > > works.
            > > >
            > > > Can anybody offer a suggestion that would help me to send/receive
            > >
            > > > array types with this Java WS?
            > > >
            > > > Nate
            > >
            > >
            > > ------------------------ Yahoo! Groups Sponsor
            > >
            > > To unsubscribe from this group, send an email to:
            > > soaplite-unsubscribe@yahoogroups.com
            > >
            > >
            > >
            > > Your use of Yahoo! Groups is subject to
            > > http://docs.yahoo.com/info/terms/
            > >
            > >
            >
            >
            > __________________________________________________
            > Do You Yahoo!?
            > Sign up for SBC Yahoo! Dial - First Month Free
            > http://sbc.yahoo.com
            >
            >
            > To unsubscribe from this group, send an email to:
            > soaplite-unsubscribe@yahoogroups.com
            >
            >
            >
            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.