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

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

Expand Messages
  • nate_bowler
    Jul 9, 2002
      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
    • Show all 4 messages in this topic