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

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

Expand Messages
  • Jim Hebert
    ... I ve read the links posted, and now I have my own twist on the question: Seems like many people have the problem where, they make a relatively simple
    Message 1 of 6 , Dec 16, 2003
    • 0 Attachment
      On Fri, 12 Dec 2003, Byrne Reese wrote:

      > Such a common problem. I really must post something about this on the
      > SOAP::Lite web site. In fact I will, but for now:

      I've read the links posted, and now I have my own twist on the question:

      Seems like many people have the problem where, they make a relatively
      simple request from an Apache SOAP for Java client, the SOAP::Lite-based
      service returns a SOAPStruct, and now they want to deserialize it.

      I have an opposite problem: I want an Apache SOAP for Java client to pass
      a SOAPStruct IN to the SOAP::Lite-based service. The service returns an
      integer, so deserializing from SOAPStruct isn't of interest, it's
      serializing TO it in Java that I need.

      You might suggest, as an alternative, change my service's API to make it
      accept something less crazy, but in this case that defeats the purpose.
      I've got an existing perl-based web service and I'm trying to write a
      unit tester in Java.

      I realize this is as much a Apache SOAP question as it is a SOAP::Lite
      question, but since SOAPStruct seems to be a SOAP::Lite invention I assume
      my chances of someone knowing the answer here are greather than someone
      knowing the answer on the java soap lists.

      jim

      (I suppose, as an OT alternative, if someone wanted to show me something
      as powerful as JWebUnit, for perl, I'd stop trying to write this unit
      tester in Java, since I prefer Perl anyhow. :-)
    • jpeyser
      Scott, Your Perl Server should be returning something similar to this. return SOAP::Data- value( SOAP::Data- name( admin = 1), SOAP::Data- name( guest =
      Message 2 of 6 , Dec 19, 2003
      • 0 Attachment
        Scott,

        Your Perl Server should be returning something similar to this.

        return SOAP::Data->value(
        SOAP::Data->name('admin' => 1),
        SOAP::Data->name('guest' => 2),
        );


        See http://majordojo.com/soaplite/

        Jonathan

        --- In soaplite@yahoogroups.com, "scottalodar" <scott@a...> wrote:
        > Hi, all.
        >
        > I am having a problem, and I have not been able to solve it. I
        have read the docs
        > extensively, but I am a perl newbie, and thus probably missed some
        important stuff.
        >
      • 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 3 of 6 , Jan 9, 2004
        • 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.