SOAP::Lite POD::WSDL and .NET clients

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Is it possible to use POD::WSDL to generate WSDL for a SOAP::Lite
service, such that the generated WSDL can be used to construct a .NET

A couple of things worry me ...
(Apart form RPC/Encoded vs Doc/Literal and SOAPAction tweaking)

1) The element names generated in the returned XML (c_gensym3 ...) don't
match the names mentioned in the WSDL (ArrayOfInt) - does this matter?

2) The WSDL seems to me to imply that the individual temperature
elements ought to be wrapped in an "ArrayOfInt" element (which I could
produce by returning an array ref instead of an array: `return
\@temperatures;`) - Is the WSDL wrong?

Off Topic question (sorry):
I don't know C# or have a C# devkit - what would the stubs look like
that C# developers generate from this WSDL? Would it be much work to
make a simple (command line) C# client?

------ Example service -----
use strict;
use warnings;
use SOAP::Transport::HTTP;

   -> dispatch_to('Temperatures')
   -> handle;

package Temperatures;

=begin WSDL

_RETURN @int Temperatures in three places


sub getTemperatures {
   my @temperatures = (31.1, 28.2, 34.5);
   return @temperatures
------ perl client ------
use strict;
use warnings;
use SOAP::Lite;
use XML;

my $Temperatures = SOAP::Lite
   -> uri(' ')
   -> proxy('http://localhost/cgi-bin/')
   -> on_fault(sub { my($soap, $res) = @_;
        die ref $res ? $res->faultstring : $soap->transport->status, "\n";

my @temperatures = $Temperatures->getTemperatures()->paramsall;
print join(', ', @temperatures), "\n";

my $xml = $Temperatures->outputxml(1)->getTemperatures();

------ -----
package XML;

sub print_indented {
   my $xml = shift;
   $xml =~ s/></>\n</g;

   my @lines = split(/\n/, $xml);

   my $indent = 0;
   for my $line(@lines) {
     if ($line =~ m(^</))    { $indent-- }
     print '  ' x $indent, $line, "\n";
     if ($line =~ m(^<[^/\?]))   { $indent++; }
     if ($line =~ m(>[^<]+</))  { $indent--; }

------ output from Perl client ------
31.1, 28.2, 34.5
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi=" "
OAP-ENC=" /"
xmlns:xsd=" " SOAP
-ENV:encodingStyle=" /">
xmlns:namesp1=" ">
       <s-gensym3 xsi:type="xsd:float">31.1</s-gensym3>
       <s-gensym5 xsi:type="xsd:float">28.2</s-gensym5>
       <s-gensym7 xsi:type="xsd:float">34.5</s-gensym7>

------ example WSDL generated by POD::WSDL ------
<?xml version="1.0" encoding="UTF-8"?>
<!-- WSDL for http://localhost/cgi-bin/ created by
Pod::WSDL version: 0.04 on Wed Apr 25 17:16:12 2007 -->
<wsdl:definitions targetNamespace="http://localhost/Temperatures"
xmlns:wsdlsoap=" /"
xmlns:wsdl=" /"
xmlns:soapenc=" /"
xmlns:xsd=" "

        <schema targetNamespace="http://localhost/Temperatures"
xmlns=" ">
            <import namespace=" /" />
            <complexType name="ArrayOfInt">
                    <restriction base="soapenc:Array">
                        <attribute ref="soapenc:arrayType" wsdl:arrayType="soapenc:int[]" />

    <wsdl:message name="getTemperaturesRequest">

    <wsdl:message name="getTemperaturesResponse">
        <wsdl:part name="getTemperaturesReturn" type="tns1:ArrayOfInt">
            <wsdl:documentation>Temperatures in three places</wsdl:documentation>

    <wsdl:portType name="myServiceHandler">
        <wsdl:operation name="getTemperatures" parameterOrder="">
            <wsdl:input message="impl:getTemperaturesRequest"
name="getTemperaturesRequest" />
            <wsdl:output message="impl:getTemperaturesResponse"
name="getTemperaturesResponse" />


    <wsdl:binding name="myServiceSoapBinding" type="impl:myServiceHandler">
        <wsdlsoap:binding style="rpc"
transport=" " />

        <wsdl:operation name="getTemperatures">
            <wsdlsoap:operation soapAction="" />
            <wsdl:input name="getTemperaturesRequest">
encodingStyle=" /"
namespace="http://localhost/Temperatures" use="encoded" />
            <wsdl:output name="getTemperaturesResponse">
encodingStyle=" /"
namespace="http://localhost/Temperatures" use="encoded" />


    <wsdl:service name="myServiceHandlerService">
        <wsdl:port binding="impl:myServiceSoapBinding" name="myService">
            <wsdlsoap:address location="http://localhost/cgi-bin/" />


Site Timeline