Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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/')->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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031961]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2018-04-22 23:00 GMT
Find Nodes?
    Voting Booth?