Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I was going to finalize my response with an example that actually read from the WSDL file and called the service but there is apparently a problem with SOAP::Lite just working with the WSDL file (as described here) and I don't have another SOAP client handy. Since you are not going to use a SOAP::Lite-based client anyway though that should not affect you.

As others have anonymously responded, it is true, the Pod::WSDL just creates the WSDL file. It kind of says this in the pod, "Pod::WSDL will output the WSDL document. That's it." You know, you don't really need a WSDL file to have a webservice written in Perl (as shown below). If you insist on using the WSDL you'll have to change it to describe something else that will actually respond to the incoming SOAP packet with your WebServiceFunctions methods. Here's a crude example calling a webservice written in Perl that uses your WebServiceFunctions class:

use SOAP::Lite +trace=>'all'; #removing tracing later my $soap_resp = SOAP::Lite->uri('http://localhost/WebServiceFunctions' +)->proxy('http://localhost/cgi-bin/soap-cooltest.pl')->Hello('world') +; print $soap_resp->result; if ($soap_resp->fault){print $soap_resp->faultstring}
Here's the web service that loads your class and will fire off its methods when requested:
#!/usr/bin/perl -w + use strict; use WebServiceFunctions; print "Content-type: application/soap\n"; use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI->dispatch_to('WebServiceFunctions')->h +andle; 1;

I renamed the class to WebServiceFunctions and I added '=cut' after the '=end WSDL' pod tags as SOAP::Transport::HTTP doesn't like it.

Celebrate Intellectual Diversity


In reply to Re: Using Pod::WSDL and getting error 301 when calling any method by InfiniteSilence
in thread Using Pod::WSDL and getting error 301 when calling any method by Max_Kooler

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (13)
    As of 2014-12-19 13:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (82 votes), past polls