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

Serializer question (prevent c-gensymNN node)

Expand Messages
  • Ajit Deshpande
    Is there a way to not allow the serializer to add the c-gensumNN top-level node while serializing a hash? I really do not want to create a custom Serializer.
    Message 1 of 4 , Mar 3, 2003
    • 0 Attachment
      Is there a way to not allow the serializer to add the
      "c-gensumNN" top-level node while serializing a hash?

      I really do not want to create a custom Serializer. I am sure
      others have run into a similar problem while writing
      SOAP::Lite clients that talk to MS SOAP services.

      To demonstrate the problem:

      my $args = {
      'key1' => 'val1',
      'key2' => 'val2',
      };

      my $service = SOAP::Lite
      -> uri($ns)
      -> proxy($server)
      ;

      my $som = $service->myRequest($args);

      The above results in the following XML message string to be
      sent to the server:

      <SOAP-ENV:Body>
      <namesp1:MyRequest>
      <c-gensym3 xsi:type="namesp2:SOAPStruct">
      <key1 xsi:type="xsd:string">val1</key1>
      <key2 xsi:type="xsd:string">val2</key2>
      </c-gensym3>
      </namesp1:EchoRequest>
      </SOAP-ENV:Body>

      I would prefer that the "<c-gensym>" node not be generated.

      Is there a way I can do this w/o creating a custom Serializer?

      If not, will Paul be interested in a patch that will allow the
      hash serializer to take in a parameter that will determine
      whether to create an enclosing node?

      Thanks,
      Ajit
    • Byrne Reese
      Let me direct you to this handy HOWTO: http://soapenv.org/article.pl?sid=02/02/11/1740229&mode=thread
      Message 2 of 4 , Mar 3, 2003
      • 0 Attachment
        Let me direct you to this handy HOWTO:

        http://soapenv.org/article.pl?sid=02/02/11/1740229&mode=thread

        On Mon, 2003-03-03 at 09:13, Ajit Deshpande wrote:
        > Is there a way to not allow the serializer to add the
        > "c-gensumNN" top-level node while serializing a hash?
        >
        > I really do not want to create a custom Serializer. I am sure
        > others have run into a similar problem while writing
        > SOAP::Lite clients that talk to MS SOAP services.
        >
        > To demonstrate the problem:
        >
        > my $args = {
        > 'key1' => 'val1',
        > 'key2' => 'val2',
        > };
        >
        > my $service = SOAP::Lite
        > -> uri($ns)
        > -> proxy($server)
        > ;
        >
        > my $som = $service->myRequest($args);
        >
        > The above results in the following XML message string to be
        > sent to the server:
        >
        > <SOAP-ENV:Body>
        > <namesp1:MyRequest>
        > <c-gensym3 xsi:type="namesp2:SOAPStruct">
        > <key1 xsi:type="xsd:string">val1</key1>
        > <key2 xsi:type="xsd:string">val2</key2>
        > </c-gensym3>
        > </namesp1:EchoRequest>
        > </SOAP-ENV:Body>
        >
        > I would prefer that the "<c-gensym>" node not be generated.
        >
        > Is there a way I can do this w/o creating a custom Serializer?
        >
        > If not, will Paul be interested in a patch that will allow the
        > hash serializer to take in a parameter that will determine
        > whether to create an enclosing node?
        >
        > Thanks,
        > Ajit
        >
        > Yahoo! Groups Sponsor
        > ADVERTISEMENT
        >
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      • Ajit Deshpande
        ... Thats indeed helpful. Thanks! Ajit
        Message 3 of 4 , Mar 3, 2003
        • 0 Attachment
          On Mon, Mar 03, 2003 at 10:40:41AM -0800, Byrne Reese wrote:
          > Let me direct you to this handy HOWTO:
          >
          > http://soapenv.org/article.pl?sid=02/02/11/1740229&mode=thread

          Thats indeed helpful. Thanks!

          Ajit
        • Ajit Deshpande
          Forwarded for Duncan (with his permission) so that we have his response in the archives.. ... Envelope-to: ajit@localhost From: Duncan Cameron
          Message 4 of 4 , Mar 4, 2003
          • 0 Attachment
            Forwarded for Duncan (with his permission) so that we have his response
            in the archives..

            ----- Forwarded message from Duncan Cameron <duncan_cameron2002@...> -----

            Envelope-to: ajit@localhost
            From: Duncan Cameron <duncan_cameron2002@...>
            Reply-To: dcameron@...
            Subject: Re: [soaplite] Serializer question (prevent c-gensymNN node)
            To: Ajit Deshpande <ajit@...>

            --- Ajit Deshpande <ajit@...> wrote: >
            > Is there a way to not allow the serializer to add the
            > "c-gensumNN" top-level node while serializing a hash?
            > [..]

            What you are suggesting seems wrong. In your example you are asking for
            a hash to be serialised and that is why you get the outer element. If
            you want a number of individual arguments to be serialised then does
            something like this give you what you want (untested)?

            my $som = $service->myRequest(
            map {SOAP::Data->name($_, $args->{$_})} keys %$args
            );

            Duncan Cameron

            ----- End forwarded message -----
          Your message has been successfully submitted and would be delivered to recipients shortly.