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

3353Re: [soapbuilders] Re: Element name escaping

Expand Messages
  • Paul Kulchenko
    May 18, 2001
    • 0 Attachment
      Hi, Graham!

      > Can you post an actual example of what the XML looks like for the
      > first case of using Map structure. Having trouble finding any

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      xmlns:xmlsoap="http://xml.apache.org/xml-soap">
      <SOAP-ENV:Body>
      <something>
      <map 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>
      </map>
      </something>
      </SOAP-ENV:Body></SOAP-ENV:Envelope>

      > can't easily get SOAP-Lite to a state that it would run and have it
      > produce output to look at and reading Perl code isn't something I
      > am good at.

      Here is the actual code you may use to produce Map:

      use SOAP::Lite;

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

      print SOAP::Serializer->readable(1)->envelope(method =>
      something => SOAP::Data->name(map => {a => 123, $key => $value})
      );

      > I believe they support any type as the key and not just string.
      > This
      > is more generic than using an attribute, as an attribute would only
      > allow a string key.
      Looks very similar to what Map does.

      > Does this Map type only allow string key or any type?
      Any type. My example has binary string as the key, so it's encoded as
      base64.

      > mechanism. Only difference is I use "name" instead of "realname". I
      > have found in the past that using an attribute is the simplest way
      > of
      > doing it. You are limited to key being a string however.
      I agree. attributes has their own limitations, but it seems like most
      flexible solution. I would be glad to implement any of them, I just
      want to settle on something.

      Best wishes, Paul.

      --- grahamd@... wrote:
      > --- In soapbuilders@y..., paulclinger@y... wrote:
      > > Hi, All!
      > >
      > > I hope previous message [1] was just lost in number if posts,
      > because
      > > nobody responded and I can't believe that nobody cares. I would
      > like
      > > to know other opinions on encoding elements with XML-invalid
      > names.
      > >
      > > Best wishes, Paul.
      > >
      > > [1] http://groups.yahoo.com/group/soapbuilders/message/2909
      >
      > Can you post an actual example of what the XML looks like for the
      > first case of using Map structure. Having trouble finding any
      > documentation in SOAP-Lite or ApacheSoap which gives an example. I
      > can't easily get SOAP-Lite to a state that it would run and have it
      > produce output to look at and reading Perl code isn't something I
      > am
      > good at.
      >
      > The third case is basically the same thing I do now in an XML
      > format
      > I use in MOM style distributed messaging system and RPC over HTTP
      > mechanism. Only difference is I use "name" instead of "realname". I
      > have found in the past that using an attribute is the simplest way
      > of
      > doing it. You are limited to key being a string however.
      >
      > I too would like to see this issue discussed further, as without an
      >
      > accepted means of doing this, I can't put together a gateway for
      > SOAP
      > for the systems I have. If I just come up with my own way, chances
      > are that nothing could then ever talk to it except clients I
      > produce
      > myself.
      >
      > BTW, the PythonWare SOAP library defines a type which is possibly
      > similar to Map. Reading the code, they encode Python dictionaries
      > as:
      >
      > <tag xsi:type='lab:PythonDict'>
      > <k xsi:type="xsd:string">key1</k>
      > <v xsi:type="xsd:int">1</k>
      > <k xsi:type="xsd:string">key2</k>
      > <v xsi:type="xsd:int">2</k>
      > </tag>
      >
      > I believe they support any type as the key and not just string.
      > This
      > is more generic than using an attribute, as an attribute would only
      >
      > allow a string key.
      >
      > Does this Map type only allow string key or any type?
      >
      >
      >
      > 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/
    • Show all 11 messages in this topic