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

Help sending Array argument from soap::lite client

Expand Messages
  • DougGa
    I m trying to call a WebService written in Java from a perl client using SOAP::Lite. I used the wscompile tool to create my WSDL and mapping.xml files in the
    Message 1 of 1 , Jul 12, 2006
    View Source
    • 0 Attachment
      I'm trying to call a WebService written in Java from a perl client
      using SOAP::Lite. I used the wscompile tool to create my WSDL and
      mapping.xml files in the RPC/encoded format.

      In the client, I create my soap service directly from the wsdl via

      $soapService = SOAP::Lite->service($wsdl_url);

      I can call methods in the WebService that use simple types, but when I
      try and send arrays I get the fault of "No such operation
      'completeTask'", yet the completeTask method is definitely there. So
      - I imagine it's in how the arguments are getting set/passed.

      I set up an array like
      @array = (3000,4000,5000);
      and before calling the $service->completeTask(....args...) I set the
      variable to a SOAP datatype via
      @arrayForSoap = SOAP::Data->type("soap11-enc:arrayType"=>@array);

      I turned on trace and can see that the SOAP getting sent has the
      arrays looking like:
      <List_5 xsi:type="soap11-enc:arrayType">3000</List5>
      <List_5 xsi:type="soap11-enc:arrayType">4000</List5>
      <List_5 xsi:type="soap11-enc:arrayType">5000</List5>

      The complexType in the wsdl looks like:
      (fyi, it was build from the Java classes where the "array" I'm using
      is a List object)

      <types>
      <schema targetNamespace="http://java.sun.com/jax-rpc-ri/internal"
      xmlns:tns="http://java.sun.com/jax-rpc-ri/internal"
      xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <complexType name="list">
      <complexContent>
      <extension base="tns:collection">
      <sequence/>
      </extension>
      </complexContent>
      </complexType>
      <complexType name="collection">
      <complexContent>
      <restriction base="soap11-enc:Array">
      <attribute ref="soap11-enc:arrayType"
      wsdl:arrayType="anyType[]"/>
      </restriction>
      </complexContent>
      </complexType>
      </schema>
      </types>

      -----------

      So... what am I doing wrong here? Why can't it find the desired
      operation 'completeTask'??

      Thanks much-
      -doug.
    Your message has been successfully submitted and would be delivered to recipients shortly.