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

complexType

Expand Messages
  • xiaoling_leng
    Dear all, I am new user of SOAP::Lite, and have a lot of problem with complexType data structure. Would anyone out there help please. I have a wsdl file with
    Message 1 of 3 , Oct 29, 2004
    • 0 Attachment
      Dear all,

      I am new user of SOAP::Lite, and have a lot of problem with
      complexType data structure. Would anyone out there help please.

      I have a wsdl file with complexType data structure as shown below:


      <types>

      <schema targetNamespace="http://npc57.hopewiser.com/TableService"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:table="http://npc57.hopewiser.com/TableService"
      xmlns="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="qualified"
      attributeFormDefault="qualified">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <complexType name="Field">
      <sequence>
      <element name="name" type="xsd:string" minOccurs="0"
      maxOccurs="1" nillable="true"/>
      <element name="type" type="xsd:string" minOccurs="0"
      maxOccurs="1" nillable="true"/>
      <element name="value" type="xsd:string" minOccurs="0"
      maxOccurs="1" nillable="true"/>
      </sequence>
      </complexType>
      <complexType name="ArrayOfField">
      <sequence>
      <element name="tablename" type="xsd:string" minOccurs="0"
      maxOccurs="1" nill able="true"/>
      <element name="fld" type="table:Field" minOccurs="1"
      maxOccurs="unbounded"/>
      </sequence>
      </complexType>
      </schema>
      </types>
      <message name="insertRecRequest">
      <part name="TableDef" type="table:ArrayOfField"/>
      </message>


      And part of my SOAP::Lite client program looks like:
      my $tabname = 'PROV';
      my $arrfld = SOAP::Data
      -> name (fld =>
      [map{
      SOAP::Data->name(item => $_)->type('name')
      } @name],
      [map{
      SOAP::Data->name(item => $_)->type('type')
      } @type],
      [map{
      SOAP::Data->name(item => $_)->type('value')
      } @value]
      );
      my $params = SOAP::Data
      ->name("TableDef" =>
      \SOAP::Data->value(
      SOAP::Data->name(tablename => $tabname),
      SOAP::Data->name(ArrayofField =>
      [map {
      SOAP::Data->name(item => $_)->type('fld')
      } @arrfld
      ])));


      my $tir = $table->insertRec($params);



      All I get in server side is the table name.
    Your message has been successfully submitted and would be delivered to recipients shortly.