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

Autogenerating WSDL

Expand Messages
  • Chris Davies
    What I would like in SOAP::Lite is a simple way of defining my functions, parameters, and data types, so that a WSDL file can be automatically generated. The
    Message 1 of 4 , May 4, 2001
    • 0 Attachment
      What I would like in SOAP::Lite is a "simple" way of defining my functions,
      parameters, and data types, so that a WSDL file can be automatically
      generated. The syntax seems straightforward enough; the fundamental problem
      is interpreting the argument lists in the perl subroutines - obviously
      impossible as perl doesn't use function prototypes.

      Perhaps one could create a hash that you register with the SOAP::Lite
      server, something like,
      %WSDL = (
      NAMESPACE => "http://my.namespace.here",
      ENCODING => "...",

      MyFunc => {
      IN => { Arg1 => string, Arg2 => int }
      OUT => { ReturnValue => int }
      },
      AnotherFunc => {
      IN => { Param1 => int }
      },
      };
      SOAP::Transport::HTTP::CGI
      -> dispatch_to ('/home/soap/web_modules')
      -> register_wsdl (\%WSDL)
      -> handle;


      Note, I've invented this structure "on the fly", so it's going to need some
      revisions.
      Chris
      --
      Chris Davies, Manheim Interactive (Europe)
      Tel. 0870 444-0450 Fax. 0870 444-0482 Email. MOL@...
    • paulclinger@yahoo.com
      Hi, Chris! That s interesting. What I m thinking about is some internal representation of service description, so you can get it from WSDL, or generate WSDL
      Message 2 of 4 , May 4, 2001
      • 0 Attachment
        Hi, Chris!

        That's interesting. What I'm thinking about is some internal
        representation of service description, so you can get it from WSDL,
        or generate WSDL from it on the fly if required and at the same time
        it'll allow you DO NOT name/type all parameters explicitly on client
        side. I see it as:

        WSDL (or any other service description)
        ^
        |
        |
        v
        internal representation <------- POD doc (=for soaplite)
        |
        |
        |
        v
        method call information

        Internal representation could be similar to what we have now in stub
        (take a look into teh result of stubmaker.pl)

        At the same time I'd like to be able to apply it to ANY data
        structure, for example I want to generate XML and don't want to
        type/name/attr all element, so I can define/create those structure
        and APPLY it toward my Perl data. WSDL or XML Schema can be generated
        from those descriptions and vice versa. That's the goal according to
        my understanding. It's only draft on paper for now, but that's how I
        see it. Any comments are greatly appreciated.

        Best wishes, Paul.

        --- In soaplite@y..., "Chris Davies" <Chris.Davies@M...> wrote:
        > What I would like in SOAP::Lite is a "simple" way of defining my
        functions,
        > parameters, and data types, so that a WSDL file can be automatically
        > generated. The syntax seems straightforward enough; the fundamental
        problem
        > is interpreting the argument lists in the perl subroutines -
        obviously
        > impossible as perl doesn't use function prototypes.
        >
        > Perhaps one could create a hash that you register with the
        SOAP::Lite
        > server, something like,
        > %WSDL = (
        > NAMESPACE => "http://my.namespace.here",
        > ENCODING => "...",
        >
        > MyFunc => {
        > IN => { Arg1 => string, Arg2 => int }
        > OUT => { ReturnValue => int }
        > },
        > AnotherFunc => {
        > IN => { Param1 => int }
        > },
        > };
        > SOAP::Transport::HTTP::CGI
        > -> dispatch_to ('/home/soap/web_modules')
        > -> register_wsdl (\%WSDL)
        > -> handle;
        >
        >
        > Note, I've invented this structure "on the fly", so it's going to
        need some
        > revisions.
        > Chris
        > --
        > Chris Davies, Manheim Interactive (Europe)
        > Tel. 0870 444-0450 Fax. 0870 444-0482 Email. MOL@M...
      • Garrett Goebel
        From: paulclinger@yahoo.com [mailto:paulclinger@yahoo.com] ... Have you looked at Damian Conway s Attribute::Handlers module? You could use attribute handlers
        Message 3 of 4 , May 4, 2001
        • 0 Attachment
          RE: [soaplite] Re: Autogenerating WSDL

          From: paulclinger@... [mailto:paulclinger@...]
          >
          > That's interesting. What I'm thinking about is some internal
          > representation of service description, so you can get it from WSDL,
          > or generate WSDL from it on the fly if required and at the same time
          > it'll allow you DO NOT name/type all parameters explicitly on client
          > side. I see it as:

          Have you looked at Damian Conway's Attribute::Handlers module? You could use attribute handlers to generate your internal representation...

          package main;
          use SOAP::Transport::HTTP;
          SOAP::Transport::HTTP::...->handle;


          package MyClass;
          use base SOAP::Lite::Attributes;

          $VERSION : NameSpace('http://my.namespace.here')
                   : Encoding('...') = '0.01';

          sub hi : Signature(string, void)
                 : Purpose("Example method call") { "hello world" }


          package SOAP::Lite::Attributes;

          # Generate Handler routines...
          sub NameSpace : ATTR(SCALAR) { ... }
          sub Encoding  : ATTR(SCALAR) { ... }
          sub Signature : ATTR(CODE) { ... }
          sub Purpose   : ATTR { ... }

          1;
          __END__

        • paulclinger@yahoo.com
          Hi, Garrett! Looks interesting. I wish I knew it six month ago :). It seems like it doesn t provide any fallbacks on old Perls, but I ll try to use it
          Message 4 of 4 , May 4, 2001
          • 0 Attachment
            Hi, Garrett!

            Looks interesting. I wish I knew it six month ago :). It seems like
            it doesn't provide any fallbacks on "old" Perls, but I'll try to use
            it anyway. Thanks for the hint.

            Best wishes, Paul.

            --- In soaplite@y..., Garrett Goebel <garrett@s...> wrote:
            > From: paulclinger@y... [mailto:paulclinger@y...]
            > >
            > > That's interesting. What I'm thinking about is some internal
            > > representation of service description, so you can get it from
            WSDL,
            > > or generate WSDL from it on the fly if required and at the same
            time
            > > it'll allow you DO NOT name/type all parameters explicitly on
            client
            > > side. I see it as:
            >
            > Have you looked at Damian Conway's Attribute::Handlers module? You
            could use
            > attribute handlers to generate your internal representation...
            >
            > package main;
            > use SOAP::Transport::HTTP;
            > SOAP::Transport::HTTP::...->handle;
            >
            >
            > package MyClass;
            > use base SOAP::Lite::Attributes;
            >
            > $VERSION : NameSpace('http://my.namespace.here')
            > : Encoding('...') = '0.01';
            >
            > sub hi : Signature(string, void)
            > : Purpose("Example method call") { "hello world" }
            >
            >
            > package SOAP::Lite::Attributes;
            >
            > # Generate Handler routines...
            > sub NameSpace : ATTR(SCALAR) { ... }
            > sub Encoding : ATTR(SCALAR) { ... }
            > sub Signature : ATTR(CODE) { ... }
            > sub Purpose : ATTR { ... }
            >
            > 1;
            > __END__
          Your message has been successfully submitted and would be delivered to recipients shortly.