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

Map types

Expand Messages
  • Paul Kulchenko
    Hi, All! Given problem with encoding hashes/maps with arbitrary keys both ApacheSOAP and SOAP::Lite support Map type which encodes both key and value of the
    Message 1 of 71 , Apr 4, 2001
      Hi, All!

      Given problem with encoding hashes/maps with arbitrary keys both
      ApacheSOAP and SOAP::Lite support Map type which encodes both key and
      value of the hash as the content of XML elements. What is your
      opinion on supporting this type in other toolkits?

      Example:

      use SOAP::Lite;

      my $key = "\0\1";
      my $value = 456;

      print SOAP::Serializer->serialize({a => 123, $key => $value}));

      gives you:

      <c-gensym1 xsi:type="xmlsoap:Map">
      <item>
      <key xsi:type="SOAP-ENC:base64">AAE=</key>
      <value xsi:type="xsd:int">456</value></item>
      <item>
      <key xsi:type="xsd:string">a</key>
      <value xsi:type="xsd:int">123</value></item>
      </c-gensym1>

      Best wishes, Paul.


      __________________________________________________
      Do You Yahoo!?
      Get email at your own domain with Yahoo! Mail.
      http://personal.mail.yahoo.com/
    • Paul Kulchenko
      Hi, Jacek! I like it. Thanks :)). And I don t see why it can t settle all arguing sides :). Best wishes, Paul. ...
      Message 71 of 71 , Apr 17, 2001
        Hi, Jacek!

        I like it. Thanks :)). And I don't see why it can't settle all
        arguing sides :).

        Best wishes, Paul.

        --- Jacek Kopecky <jacek@...> wrote:
        > Hi guys and gals! 8-)
        >
        > I've read the whole back-and-forth thread now and this is my
        > opinion. If you see this as reiterating the wrong reasoning,
        > please don't reply, it's good the thread stopped a few days ago.
        > 8-)
        >
        > So: I support the "array of structs" type according to the
        > following schema (mostly copied from a different mail):
        >
        > <schema targetNamespace="to_be_determined"
        > xmlns:tns="to_be_determined">
        > <complexType name="Map" base="SOAP-ENC:Array">
        > <sequence>
        > <element name="item" minOccurs='0' maxOccurs='*'
        > type="tns:hash"/>
        > </sequence>
        > </complexType>
        > <complexType name="hash">
        > <sequence>
        > <element name="key" type="anyType"/>
        > <element name="value" type="anyType"/>
        > </sequence>
        > </complexType>
        > </schema>
        >
        > The map on-the-wire looks like (the xsi:type is optional):
        >
        > <foo xsi:type="tbd:Map" SOAP-ENC:arrayType="tbd:hash[]">
        > <item><key>a</key><value> 1</value></item>
        > <item><key>b</key><value>123</value></item>
        > </foo>
        >
        > Every toolkit can interpret this as an array of key-value pairs.
        > This is a safe fallback. Every toolkit knowing that elements of
        > type Map@to_be_determined are in fact maps can deserialize the
        > data as the type of choice for a map.
        >
        > We do the same trick in IdooXoap for service references - the
        > reference is in fact a struct whose special semantics are
        > triggered by the qname of its type. This qname can be present in
        > the xsi:type attribute or it can come from the WSDL description
        > of the service. Same for Map@to_be_determined.
        >
        > Finally, I _don't_ think such special-casing is necessarily
        > evil. 8-)
        >
        > Jacek Kopecky
        > Idoox
        >
        >
        >
        > On Thu, 5 Apr 2001, Paul Kulchenko wrote:
        >
        > > Hi, Simon!
        > >
        > > But how will I know that it's not usual array of structs? Again,
        > how
        > > do you send structs/hashes/maps/whatever with arbitrary keys
        > now? Do
        > > you encode it as arrays? No? Why? Point is if I have to do it on
        > SOAP
        > > level anyway, I'd like to do it rigth.
        > >
        > > Best wishes, Paul.
        > >
        > > --- Simon Fell <sfell@...> wrote:
        > > > but you can do that conversion in the soap level if you want,
        > even
        > > > with the
        > > > sec-5 based encoding.
        > > >
        > > > -----Original Message-----
        > > > From: Paul Kulchenko [mailto:paulclinger@...]
        > > > Sent: Thursday, April 05, 2001 7:31 PM
        > > > To: soapbuilders@yahoogroups.com
        > > > Subject: Re: [soapbuilders] Map types
        > > >
        > > >
        > > > Hi, Rich!
        > > >
        > > > --- Rich Salz <rsalz@...> wrote:
        > > > > I claim that saying "this is a Map" is useless -- the
        > receiving
        > > > > side
        > > > > (client or server) will already know it's a key/value map
        > based
        > > > on
        > > > > the fact that it already knows the semantics of the SOAP
        > > > operating
        > > > > being invoked.
        > > > It means pass all processing on application level instead of
        > SOAP
        > > > processor level. You may also send only string type and
        > convert to
        > > > other types "on demand", because application knows that this
        > > > parameter is int and convert it accordingly. I'd like to do as
        > much
        > > > work as possible on SOAP processor level, SOAP should be
        > simple not
        > > > only in implementation, but more on application level. It's
        > similar
        > > > to encoding/decoding entities in strings, you may live without
        > it
        > > > and
        > > > convert when necessary, but it's much more useful/convenient
        > when
        > > > toolkit will do it for you.
        > > >
        > > > > So the question is: add a new Map primitive, or use what's
        > > > already
        > > > > there.
        > > > It's already there.
        > > >
        > > > Best wishes, Paul.
        > > >
        > > >
        > > > __________________________________________________
        > > > Do You Yahoo!?
        > > > Get email at your own domain with Yahoo! Mail.
        > > > http://personal.mail.yahoo.com/
        > > >
        > > >
        > > > To unsubscribe from this group, send an email to:
        > > > soapbuilders-unsubscribe@yahoogroups.com
        > > >
        > > >
        > > >
        > > > Your use of Yahoo! Groups is subject to
        > > > http://docs.yahoo.com/info/terms/
        > > >
        > > >
        > > > ------------------------ Yahoo! Groups Sponsor
        > > >
        > > > To unsubscribe from this group, send an email to:
        > > > soapbuilders-unsubscribe@yahoogroups.com
        > > >
        > > >
        > > >
        > > > Your use of Yahoo! Groups is subject to
        > > > http://docs.yahoo.com/info/terms/
        > > >
        > > >
        > >
        > >
        > > __________________________________________________
        > > Do You Yahoo!?
        > > Get email at your own domain with Yahoo! Mail.
        > > http://personal.mail.yahoo.com/
        > >
        > >
        > > To unsubscribe from this group, send an email to:
        > > soapbuilders-unsubscribe@yahoogroups.com
        > >
        > >
        > >
        > > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        > >
        > >
        >
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        >
        > To unsubscribe from this group, send an email to:
        > soapbuilders-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Yahoo! Auctions - buy the things you want at great prices
        http://auctions.yahoo.com/
      Your message has been successfully submitted and would be delivered to recipients shortly.