Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by InfiniteSilence (Curate)
on May 03, 2013 at 21:40 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1031961]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-19 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found