Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Using Pod::WSDL and getting error 301 when calling any method

by InfiniteSilence (Curate)
on May 03, 2013 at 21:40 UTC ( #1031961=note: print w/ replies, xml ) Need Help??


in reply to Using Pod::WSDL and getting error 301 when calling any method

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


Comment on Re: Using Pod::WSDL and getting error 301 when calling any method
Select or Download Code
Re^2: Using Pod::WSDL and getting error 301 when calling any method
by Anonymous Monk on May 03, 2013 at 21:49 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031961]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2014-09-21 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (165 votes), past polls