Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: SOAP/RPC - whats the latest?

by zer (Deacon)
on Jul 17, 2007 at 20:56 UTC ( [id://627128]=note: print w/replies, xml ) Need Help??


in reply to SOAP/RPC - whats the latest?

Quick Start with SOAP
I hope this can help

Replies are listed 'Best First'.
Re^2: SOAP/RPC - whats the latest?
by ethrbunny (Monk) on Jul 17, 2007 at 22:46 UTC
    Right - I read that series early on. I don't understand Apache well enough to know how to use the sample code. Clearly it's something *so* trivial that they don't get into it.

    Is the implication that one could use any app server?

    edit: I did find this site. Is this the correct combination? mod_perl + soap::lite + apache?

      That's one way :) Another way would be to use Apache2::SOAP.

      In my /etc/httpd/conf.d/perl.conf file:

      LoadModule perl_module modules/mod_perl.so PerlRequire "/etc/httpd/conf.d/startup.pl" <Location /soap> SetHandler perl-script PerlResponseHandler Apache2::SOAP PerlSetVar dispatch_to "/var/www/html/soap" PerlSetVar options "compress_threshold => 10000" </Location>

      perl_startup.pl file (this includes the modules that you will be accessing - note that you will still have to do the "use MODULE" in the (service).pm files):

      use ModPerl::Util (); #for CORE::GLOBAL::exit use Apache2::Request; use Apache2::RequestRec (); use Apache2::RequestIO (); use Apache2::RequestUtil (); use Apache2::ServerUtil (); use Apache2::ServerRec (); use Apache2::Connection (); use Apache2::Log (); use Apache::Session (); use Apache::DBI; use CGI (); use CGI::Cookie (); use APR::Table (); use ModPerl::Registry (); use Apache2::Const -compile => ':common'; use APR::Const -compile => ':common'; use DBI; use XML::Handler::YAWriter; use XML::Generator::DBI; use File::Basename; 1;

      Example soap service (/var/www/html/soap/Demo2.pm):

      package Demo2; use XML::Generator::DBI; use XML::Handler::YAWriter; use DBI; =begin WSDL _IN hi $string A foo _DOC This is a test soap web service that prints a list of the + current DBAs _RETURN $string Returns a string containing the current DBAs =end WSDL sub hi { my $out_xml = "hi"; my $ya = XML::Handler::YAWriter->new(); # Stuff return $out_xml; } 1;

      demo.pl: access the Demo2 web service (example soap client):

      #!/usr/bin/perl use strict; use warnings; use SOAP::Lite; my $soap = SOAP::Lite->uri('urn:Demo2'); my $proxy = $soap->proxy("http://localhost/soap/"); my $obj = $proxy->hi(); print $obj->result . "\n";

      This will make any calls to http://localhost/soap be handled by perl. Changing this to work for Apache on windows should be a simple matter :)

      Jason L. Froebe

      Help find a cure for breast cancer! Net proceeds benefit the Susan G. Komen Breast Cancer Foundation and the National Philanthropic Trust. Help by donating - I'm walking 60 miles in 3 days in August 2007. (The day I return from TechWave is the first day of the Walk).

      Blog, Tech Blog

        Wow! Awesome! So all I need is an Apache2 server for this? No Tomcat / Resin / somethingorother? No *J*A*V*A*?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2024-03-28 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found