Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: WSDL::Generator I can't see the wsdl from the client

by InfiniteSilence (Curate)
on May 02, 2013 at 17:31 UTC ( [id://1031786]=note: print w/replies, xml ) Need Help??


in reply to WSDL::Generator I can't see the wsdl from the client

The pod on WSDL::Generator says it has issues:
WSDL doesn’t works only on perl 5.6 and not 5.8. UNIVERSAL::AUTOLOAD i +s broken in perl 5.8 and it is used by Class::Hook upon wich WSDL::Ge +nerator depends.
You can use Pod::WSDL (update: wrong package name) instead though. Here's the package marked up with some pod and a different Perl script following it:
package WebserviceFunctions; sub new { bless {}, shift; } =begin WSDL _DOC Hello + =end WSDL sub Hello { my ($s, $name) = @_; return "Hello, $name".$/; } + =begin WSDL _DOC Goodbye =end WSDL sub Goodbye { my ($s, $name) = @_; return "Goodbye, $name".$/; }
and the script:
#!/usr/bin/perl -w use Pod::WSDL; use CGI; print CGI->header('text/xml'); my $pod = new Pod::WSDL(source=> 'WebServiceFunctions', location=>'http://localhost/webservice_pod.pl' +, pretty=>1, withDocumentation=>1); print $pod->WSDL; 1;

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re^2: WSDL::Generator I can't see the wsdl from the client
by Max_Kooler (Initiate) on May 02, 2013 at 20:32 UTC
    Thank you!

    I've used Pod::WSDL as you sugested but I still get the error, however I've managed to find something that I think might be the issue.
    First of all, this is my new code:

    WebserviceFunctions.pm
    package WebserviceFunctions; =begin WSDL _DOC Hello _IN name $string this is the name _OUT text $string return text =end WSDL sub Hello { my ($s, $name) = @_; return "Hello, $name".$/; } =begin WSDL _DOC Goodbye _IN name $string this is the name _OUT text $string return text =end WSDL sub Goodbye { my ($s, $name) = @_; return "Goodbye, $name".$/; } 1;

    webservice.cgi
    #!/usr/bin/perl -w use Pod::WSDL; use CGI; print CGI->header('text/xml'); my $pod = new Pod::WSDL(source=> 'WebserviceFunctions.pm', location=>'http://192.168.11.73/~efuentes/webs +ervice', pretty=>1, withDocumentation=>1); $pod->addNamespace('http://192.168.11.73/~efuentes/webservice/','Webse +rviceFunctions'); print $pod->WSDL;

    Now, you can see the full address where I generate the Webservice is "http://192.168.11.73/~efuentes/cgi-bin/webservice/webservice.cgi", if I put that on my browser I get my wsdl, but now, I've found in that wsdl this code "targetNamespace="http://192.168.11.73/WebserviceFunctions" wish differs from my full path, I've tried to change it with "$pod->addNamespace('http://192.168.11.73/~efuentes/webservice/','WebserviceFunctions');" as you can see in the code, but I get the same targetNamespace on the wsdl.
    Any suggestions to fix that?
Re^2: WSDL::Generator I can't see the wsdl from the client
by Max_Kooler (Initiate) on May 03, 2013 at 14:05 UTC
    After a lot of time searching for an answer, I finally fixed the error, it was in the client side on PHP where I had to specify the EndPoint. Thanks a lot for helping me, I'll keep using Pod::WSDL anyway, it works better than WSDL::Generator.

    Cheers!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-23 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found