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

Re: [soaplite] Beginner question

Expand Messages
  • Josh Narins
    I admit to being confused by your question, but perhaps you want XML::Writer? It s good for generating XML. ...
    Message 1 of 4 , Dec 8, 2002
    • 0 Attachment
      I admit to being confused by your question, but
      perhaps you want XML::Writer?

      It's good for generating XML.


      --- absolsp <absolsp@...> wrote:
      > Hello,
      >
      > I justed started using SOAP::Lite and I have a
      > basic question.
      > How do I create a simple structure like the
      > following
      >
      > @data = (['Data Segment', 'Payload segment']);
      >
      > into
      >
      > <refseg href="ref-12345"/>
      > <data id="ref-12345" SOAP-ENC:root="0">
      > <segment1> Data segment </segment1>
      > <segment2> Payload segment </segment2>
      > </data>
      >
      >
      > Does SOAP Lite automatically create the "ref-12345"
      > id's or do I need
      > to supply them? Is it possible to create the
      > structure as
      >
      > <refseg>
      > <data id="ref-12345" SOAP-ENC:root="0">
      > <segment1> Data segment </segment1>
      > <segment2> Payload segment </segment2>
      > </data>
      > </refseg>
      >
      >
      > In the second case, the tag <data> is now embedded
      > inside the
      > <refseg> tag. Does SOAP give you control on which
      > type of xml is
      > output (referenced data or embedded data). Any
      > pointers to help me
      > create the both the first and second type of output
      > will be highly
      > appreciated.
      >
      > thanks,
      > Thomas
      >
      >


      __________________________________________________
      Do you Yahoo!?
      Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
      http://mailplus.yahoo.com
    • Paul Kulchenko
      Hi Thomas, ... I m not sure that this code returns the structure you want to have. Probably you need to use: $data = [ Data Segment , Payload segment ]; -OR-
      Message 2 of 4 , Dec 8, 2002
      • 0 Attachment
        Hi Thomas,


        --- absolsp <absolsp@...> wrote:
        > How do I create a simple structure like the following
        >
        > @data = (['Data Segment', 'Payload segment']);
        I'm not sure that this code returns the structure you want to have.
        Probably you need to use:

        $data = ['Data Segment', 'Payload segment'];

        -OR-

        @data = ('Data Segment', 'Payload segment');

        > into
        >
        > <refseg href="ref-12345"/>
        > <data id="ref-12345" SOAP-ENC:root="0">
        > <segment1> Data segment </segment1>
        > <segment2> Payload segment </segment2>
        > </data>
        >
        >
        > Does SOAP Lite automatically create the "ref-12345" id's or do I
        > need to supply them?
        You don't need to do anything special. SOAP::Lite will generate
        multireferences for you if there is more than one reference to the
        same variable.

        > Is it possible to create the structure as
        >
        > <refseg>
        > <data id="ref-12345" SOAP-ENC:root="0">
        > <segment1> Data segment </segment1>
        > <segment2> Payload segment </segment2>
        > </data>
        > </refseg>
        >
        >
        > In the second case, the tag <data> is now embedded inside the
        > <refseg> tag. Does SOAP give you control on which type of xml is
        > output (referenced data or embedded data). Any pointers to help me
        > create the both the first and second type of output will be highly
        > appreciated.
        As far as I understand, second structure is NOT the same as the first
        one. Yes, SOAP::Lite allows you to specify how multiple references
        have to be encoded: inline or separate. multirefinplace() method of
        serializes makes all multireferences inlined. Keep in mind that not
        all SOAP implementations can deal with it (even though there is some
        ambiguity around it, most people believe that it's disallowed by SOAP
        spec; that's why it's turned off by default in SOAP::Lite).

        Best wishes, Paul.

        __________________________________________________
        Do you Yahoo!?
        Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
        http://mailplus.yahoo.com
      • Paul Kulchenko
        ... I should have mentioned that this paragraph is about SOAP 1.1 spec. SOAP 1.2 is more flexible about that. Best wishes, Paul.
        Message 3 of 4 , Dec 8, 2002
        • 0 Attachment
          > serializes makes all multireferences inlined. Keep in mind that not
          > all SOAP implementations can deal with it (even though there is
          > some
          > ambiguity around it, most people believe that it's disallowed by
          > SOAP spec; that's why it's turned off by default in SOAP::Lite).
          I should have mentioned that this paragraph is about SOAP 1.1 spec.
          SOAP 1.2 is more flexible about that.

          Best wishes, Paul.


          __________________________________________________
          Do you Yahoo!?
          Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
          http://mailplus.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.