jfroebe has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm trying to get the Pod::WSDL to produce a WSDL file. Specifically the attributes aren't being inserted into the WSDL file. I know I'm missing something simple.

wsdl.pl script:

#!/usr/bin/perl use strict; use warnings; use Pod::WSDL; my $pod = new Pod::WSDL(source => "./Demo2.pm", location => 'http://localhost/test/soap', pretty => 1, withDocumentation => 1); print( $pod->WSDL );

Demo2.pm

package Demo2; use XML::Generator::DBI; use XML::Handler::YAWriter; use DBI; =begin WSDL _IN hi $string A foo _DOC This is a test soap web service that prints a list of the + current DBAs _RETURN $string Returns a string containing the current DBAs =end WSDL sub hi { my $out_xml = "hi"; my $ya = XML::Handler::YAWriter->new(); # Stuff return $out_xml; } 1;

WSDL file that is generated:

<?xml version="1.0" encoding="UTF-8"?> <!-- WSDL for http://localhost/test/soap created by Pod::WSDL version: + 0.05 on Tue Jul 17 20:51:42 2007 --> <wsdl:definitions targetNamespace="http://localhost/Demo" xmlns:impl=" +http://localhost/Demo" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsd +l/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc= +"http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3. +org/2001/XMLSchema" xmlns:tns1="http://localhost/Demo"> <wsdl:portType name="DemoHandler"> </wsdl:portType> <wsdl:binding name="DemoSoapBinding" type="impl:DemoHandler"> <wsdlsoap:binding style="rpc" transport="http://schema +s.xmlsoap.org/soap/http" /> </wsdl:binding> <wsdl:service name="DemoHandlerService"> <wsdl:port binding="impl:DemoSoapBinding" name="Demo"> <wsdlsoap:address location="http://localhost/t +est/soap" /> </wsdl:port> </wsdl:service> </wsdl:definitions>

Notice that the WSDL file doesn't include the "_IN", "_DOC" or "_RETURN" information. I know it is just something simple I'm missing. Ideas?

Jason L. Froebe

Help find a cure for breast cancer! Net proceeds benefit the Susan G. Komen Breast Cancer Foundation and the National Philanthropic Trust. Help by donating - I'm walking 60 miles in 3 days in August 2007. (The day I return from TechWave is the first day of the Walk).

Blog, Tech Blog

Replies are listed 'Best First'.
Re: Having trouble with Pod::WSDL and need a brain
by GrandFather (Saint) on Jul 18, 2007 at 02:33 UTC

    Do you really have a space in front of =begin and =end? That may be acceptable to POD::WDSL, but it ain't POD.


    DWIM is Perl's answer to Gödel
Re: Having trouble with Pod::WSDL and need a brain
by Anonymous Monk on Jul 18, 2007 at 06:47 UTC
    Once upon a time, in a kingdom deep in the deepest forest, the king thought it was unfair that people should have to use the brains they were born with. He ordered all the brains to be put on market, where people would bid for the brain they wanted and multiple bids settled by a committee of the wise. It turned out, however, that there were no multiple bids at all. Everybody bid for his own brain.