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

Re: [soaplite] Re: Soaplite server, Axis client, no deserializer for SoapStruct

Expand Messages
  • Scott Ellsworth
    Hi, Jonathan. Thank you for the help. I got a chance to try this again. Your hint, and a bit of mucking about, made things work the way I wanted them to. The
    Message 1 of 6 , Jan 9, 2004
    View Source
    • 0 Attachment
      Hi, Jonathan.

      Thank you for the help. I got a chance to try this again. Your hint,
      and a bit of mucking about, made things work the way I wanted them to.

      The code:
      my %users = %{get_user_ids_by_name(config_name => $config_name)};

      my @entries = ();
      foreach my $username (sort keys %users){
      my $entry =
      SOAP::Data->name('mapItem' =>
      \SOAP::Data->value(
      SOAP::Data->name('key' => $username),
      SOAP::Data->name('value' => $users{$username}),
      )
      );
      $entries[$#entries+1]=$entry;
      }

      return SOAP::Data->value(
      SOAP::Data->name('map' =>
      \SOAP::Data->value(
      @entries
      ),
      )->type('gbibns:map')->attr( { 'xmlns:gbibns' =>
      'http://feature.alodar.com/Alodar/GBIB/' } ),
      );

      successfully returns the XML:

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
      <namesp1:typed_get_user_ids_by_nameResponse
      xmlns:namesp1="http://feature.alodar.com/Alodar/GBIB/SOAPUtils">
      <map xsi:type="gbibns:map"
      xmlns:gbibns="http://feature.alodar.com/Alodar/GBIB/">
      <mapItem>
      <key xsi:type="xsd:string">
      admin
      </key>
      <value xsi:type="xsd:int">
      1
      </value>
      </mapItem>
      <mapItem>
      <key xsi:type="xsd:string">
      guest
      </key>
      <value xsi:type="xsd:int">
      2
      </value>
      </mapItem>
      </map>
      </namesp1:typed_get_user_ids_by_nameResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      required by the wsdl

      <types>
      <schema
      xmlns="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://feature.alodar.com/Alodar/GBIB/"
      >
      <!-- import namespace="http://schemas.xmlsoap.org/soap/encoding/" /
      -->

      <complexType name="mapItem">
      <sequence>
      <element name="key" nillable="true" type="anyType" />
      <element name="value" nillable="true" type="anyType" />
      </sequence>
      </complexType>

      <complexType name="map">
      <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="mapItem"
      type="tns:mapItem" />
      </sequence>
      </complexType>
      </schema>
      </types>

      I still have a number of issues to figure out, such as how to get a
      perl example that can use this wsdl and the like, but this solves the
      main problem I was running into.

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