Re: Soap Server in perl



Kuna wrote:
Ian Wilson wrote:
Kuna wrote:
Ian Wilson wrote:
Kuna wrote:

I want to create a SOAP server in perl so have gone through web
but thatr was not satisfactory. If any body will give sample
codes or some well defined link then that will be helpfull to
me.

http://www.soaplite.com/
The quickstart guide and cookbook have examples.

Hi Ian thanks a lot for replying but this link is not opening and
apart of that I want to say that I have tried many links but
those are having fundamental ideas but I need to reate soap
server in perl which will invoke some methods and show me the
responce from the server. So if possible then suggest me some
sample codes for some advanced operation.


That URL works fine here. If my Internet connection was broken, the
way yours is, I'd phone my ISP and complain!


Sorry Ian I donot mean to say like that but actually I am new to perl
and I have given this task to be done so as per my little knowledge I
am not able to get these examples from the web so I want that some
one will guide me and by which I can able to get some knowledge and
get my to be done. Again sorry if I have asked something worng to
you.

Its not that simple. If you don't have a web-server with support for CGI and Perl in which you can install SOAP::Lite then you'll have to implement the SOAP support some other way. The SOAP::Lite documentation covers various ways.

Here's an example of server code (soaptemp.pl)

#!/usr/bin/perl -w

use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI
-> dispatch_to('Temperatures')
-> handle;

package Temperatures;

sub f2c {
my ($class, $f) = @_;
return 5/9*($f-32);
}

sub c2f {
my ($class, $c) = @_;
return 32+$c*9/5;
}

Here's the corresponding client code (soaptempclient.pl)

#!/usr/bin/perl -w

use SOAP::Lite;

$c = shift @ARGV;
$c = 37.5 unless $c;

print
"$c C = ",
SOAP::Lite
-> uri('http://your.server.name/Temperatures')
-> proxy ('https://your.server.name/cgi-bin/soaptemp.pl')
-> c2f($c)
-> result,
" F\n";

Note: this is old code, you should use warnings; use strict; There are lots of different ways of writing soap clients and soap servers using SOAP::Lite. There is a feature that lets you call remote subroutines exactly the way you would if they were local subroutines. There's no substitute for reading the documentation.

If you are new to Perl you may find the examples hard to understand. If this is so then you need to practice Perl on some simpler problems before you move onto SOAP.

I suggest this:

1) Write a simple Perl program with a subroutine,

2) Move the subroutine to a module. Alter the main program to use that module.

3) Move your module unchanged to your web server and write a generic SOAP dispatcher (designated by the proxy in the client) that hands off SOAP requests to modules (designated by the URI provided by the client) There's an example in the docs, it is 4 lines long plus shebang, comments and spacing.

Use autodispach in the client so that your client only needs a couple of lines adding to it.
.



Relevant Pages

  • Re: Formatting ASCII to be read by Windows NotePad
    ... No need to shout - neither Perl nor Cisco are acronyms. ... I've had issues in the past uploading to a MacOS based ftp server ... I've been using a Mac for ten years, ... different ftp clients, including the command line ftp client, so I ...
    (comp.lang.perl.misc)
  • Re: SOAP Webservice C# / Axis2
    ... I'm trying to code a simple C# SOAP client wich query an Axis2 Java SOAP ... Server side code has been generated from a WSDL file. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Soap Server in perl
    ... Ian Wilson wrote: ... I want to create a SOAP server in perl so have gone through web ...
    (comp.lang.perl.misc)
  • Re: Sending compressed XML over the internet?
    ... In the client side im using mssoap.soapclient30 and on the server an IIS ... Yes compression on the soap client and web server sounds good. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: How to embed javascript functionality into a Perl CGI script?
    ... Perl code does not run on clients, ... >> browser itself...such as JavaScript. ... JSP executes on server side and Javascript on the client. ...
    (comp.lang.perl.misc)

Loading