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

How to change default namespace and name

Expand Messages
  • allierogers@yahoo.com
    Using SOAP::Lite as a server, is there any easy way to hook into the XML generation and change the default namespace and name generation. Right now, they re
    Message 1 of 2 , Feb 6, 2001
    • 0 Attachment
      Using SOAP::Lite as a server, is there any easy way to hook into the
      XML generation and change the default namespace and name generation.
      Right now, they're controlled by the gen_ns() and gen_name()
      functions and result in constantly changing namespaces and names
      like "namesp1", "namesp2", etc., and "c-gensym1", "c-gensym2", etc.

      I would like some control over the namespace and symbol names so that
      I can create more sensible ones. But I don't see how (or see
      examples of how) to modify this as a server. Using SOAP::Data, I can
      see how parameters can be named from the client side, but this does
      not work at the server end. And I see no way of modifying the
      namespace.

      On the server, once you call "handle()", there seem to be no other
      hooks.

      Ideas or some sample server code?
    • Paul Kulchenko
      Hi, allierogers@yahoo.com! Yes, you may return SOAP::Data object exactly as you do on client side and it ll affect name (and namespace) of created element. For
      Message 2 of 2 , Feb 6, 2001
      • 0 Attachment
        Hi, allierogers@...!

        Yes, you may return SOAP::Data object exactly as you do on client
        side and it'll affect name (and namespace) of created element. For
        example:

        sub something_on_server_side {
        return SOAP::Data->name(myresult => 25);
        }

        will make element myresult. Using ->uri() method or ->attr() in
        general you can change namespace of this element.

        Details about fault could be modified in similar way:

        sub something_on_server_side {
        my $self = shift;
        die SOAP::Data->name(subdetails => 'Where are parameters?')
        unless @_;
        }

        should generate object as Faul detail. Hope it helps.

        Best wishes, Paul.

        P.S. Please, address your questions directly to me, because purpose
        of this list is discussion of future versions, announces of releases
        and ongoing development.

        --- allierogers@... wrote:
        > Using SOAP::Lite as a server, is there any easy way to hook into
        > the
        > XML generation and change the default namespace and name
        > generation.
        > Right now, they're controlled by the gen_ns() and gen_name()
        > functions and result in constantly changing namespaces and names
        > like "namesp1", "namesp2", etc., and "c-gensym1", "c-gensym2", etc.
        >
        > I would like some control over the namespace and symbol names so
        > that
        > I can create more sensible ones. But I don't see how (or see
        > examples of how) to modify this as a server. Using SOAP::Data, I
        > can
        > see how parameters can be named from the client side, but this does
        >
        > not work at the server end. And I see no way of modifying the
        > namespace.
        >
        > On the server, once you call "handle()", there seem to be no other
        > hooks.
        >
        > Ideas or some sample server code?
        >
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >


        __________________________________________________
        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.