Sponsored Content
Top Forums Shell Programming and Scripting How to call perl web service from javascript? Post 302725219 by liyakathali on Friday 2nd of November 2012 12:32:10 AM
Old 11-02-2012
How to call perl web service from javascript?

Hi,

I would like to call the below perl web service from javascript .Any help would be appreciated.I am new to web services.Please do the needful.

Server Program(Perl Web Service)
Code:
#!/usr/bin/perl
use lib '/usr/lib/perl5/5.8.8/SOAP-Lite-0.65_3/lib';
use SOAP::Transport::HTTP;
use Demo;
  SOAP::Transport::HTTP::CGI
    -> dispatch_to('Demo')
    -> handle;


Demo.pm program
Code:
#!/usr/bin/perl
package Demo;
  sub hi {
    return "hello, world";
  }
  sub bye {
    return "goodbye, cruel world";
  }
1;

Thanks,
Liyakath.

Last edited by Franklin52; 11-02-2012 at 04:44 AM.. Reason: Please use code tags for data and code samples
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need to Call Web Service from Unix

I'm a Unix and C programming newbie, and I've been tasked with calling a web service from a legacy Unix app... I've come across libxml2 and libsoup, gnome's libraries for XML/SOAP processing... But I'm seeking guidance on the development process... :o (0 Replies)
Discussion started by: jahooper
0 Replies

2. Shell Programming and Scripting

How to call a web service using perl

Hello to all, What i would like to know is how to call a web service using perl. Where can i find documentation that easy describes this procedure? Any advices will be more tha welcome. Thank you. Best Regards, Chriss_58 (3 Replies)
Discussion started by: chriss_58
3 Replies

3. Shell Programming and Scripting

Call web service from Shell

Hello All, I have to import data from xml file to mysql database multi-time a day. I think it is better to write a tool to help this. So I write a web service in php. I don't know that if we can call a web service via shell script. If it can, I think we can create a cron job to help run it... (2 Replies)
Discussion started by: hapytran
2 Replies

4. Web Development

chrome window.parent call javascript func fail

Hi Everyone, Please refer to attached test.zip. Open a.htm, tested under IE, Safari, Firefox no problem, but ONLY google chrome fail, seems cannot use call parent javascript function under the child iframe. Please advice. Thanks (1 Reply)
Discussion started by: jimmy_y
1 Replies

5. Shell Programming and Scripting

web service call: curl output to xsltproc input

I need to invoke a web service and extract what I need from the response using a combination of curl and xsltproc. However, any file-based parameters that must be supplied to both these programs must be from stdin and not actual files. At least with curl, it seems to think that I am supplying a... (3 Replies)
Discussion started by: webuser
3 Replies

6. Shell Programming and Scripting

Web Service in Perl CGI scripting

Hi, I have a requirement to write web service in Perl CGi scripting.The web service will be called by some external programs.Any help would be appreciated.Sample hello world program will be more helpful. Thanks, Liyakath Ali. (1 Reply)
Discussion started by: liyakathali
1 Replies

7. Shell Programming and Scripting

Working web service call not working with curl

Hello, Newbie here, I have a perfectly well working web service call I can issue from chrome (PC Windows 10) and get the results I want (a dimmer being turned on in Fibaro Home Center 2 at level 40) I am not allowed to post urls but the below works with http and :// and... (3 Replies)
Discussion started by: abigbear
3 Replies
SOAP::WSDL::Factory::Transport(3pm)			User Contributed Perl Documentation		       SOAP::WSDL::Factory::Transport(3pm)

NAME
SOAP::WSDL::Factory::Transport - Factory for retrieving transport objects SYNOPSIS
# from SOAP::WSDL::Client: $transport = SOAP::WSDL::Factory::Transport->get_transport( $url, @opt ); # in transport class: package MyWickedTransport; use SOAP::WSDL::Factory::Transport; # register class as transport module for httpr and https # (httpr is "reliable http", a protocol developed by IBM). SOAP::WSDL::Factory::Transport->register( 'httpr' , __PACKAGE__ ); SOAP::WSDL::Factory::Transport->register( 'https' , __PACKAGE__ ); DESCRIPTION
SOAP::WSDL::Transport serves as factory for retrieving transport objects for SOAP::WSDL. The actual work is done by specific transport classes. SOAP::WSDL::Transport tries to load one of the following classes: o the class registered for the scheme via register() o the SOAP::Lite class matching the scheme o the SOAP::WSDL class matching the scheme METHODS
register SOAP::WSDL::Transport->register('https', 'MyWickedTransport'); Globally registers a class for use as transport class. proxy $trans->proxy('http://soap-wsdl.sourceforge.net'); Sets the proxy (endpoint). Returns the transport for this protocol. set_transport Sets the current transport object. get_transport Gets the current transport object. WRITING YOUR OWN TRANSPORT CLASS
Registering a transport class Transport classes must be registered with SOAP::WSDL::Factory::Transport. This is done by executing the following code where $scheme is the URL scheme the class should be used for, and $module is the class' module name. SOAP::WSDL::Factory::Transport->register( $scheme, $module); To auto-register your transport class on loading, execute register() in your tranport class (see SYNOPSIS above). Multiple protocols or multiple classes are registered by multiple calls to register(). Transport plugin package layout You may only use transport classes whose name is either the module name or the module name with '::Client' appended. Methods to implement Transport classes must implement the interface required for SOAP::Lite transport classes (see SOAP::Lite::Transport for details, SOAP::WSDL::Transport::HTTP for an example). To provide this interface, transport modules must implement the following methods: o new o send_receive Dispatches a request and returns the content of the response. o code Returns the status code of the last send_receive call (if any). o message Returns the status message of the last send_receive call (if any). o status Returns the status of the last send_receive call (if any). o is_success Returns true after a send_receive was successful, false if it was not. SOAP::Lite requires transport modules to pack client and server classes in one file, and to follow this naming scheme: Module name: "SOAP::Transport::" . uc($scheme) Client class (additional package in module): "SOAP::Transport::" . uc($scheme) . "::Client" Server class (additional package in module): "SOAP::Transport::" . uc($scheme) . "::Client" SOAP::WSDL does not require you to follow these restrictions. There is only one restriction in SOAP::WSDL: You may only use transport classes whose name is either the module name or the module name with '::Client' appended. SOAP::WSDL will try to instantiate an object of your transport class with '::Client' appended to allow using transport classes written for SOAP::Lite. This may lead to errors when a different module with the name of your transport module suffixed with ::Client is also loaded. LICENSE AND COPYRIGHT
Copyright 2004-2007 Martin Kutter. All rights reserved. This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself AUTHOR
Martin Kutter <martin.kutter fen-net.de> REPOSITORY INFORMATION
$Rev: 851 $ $LastChangedBy: kutterma $ $Id: Transport.pm 851 2009-05-15 22:45:18Z kutterma $ $HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Transport.pm $ perl v5.10.1 2010-12-21 SOAP::WSDL::Factory::Transport(3pm)
All times are GMT -4. The time now is 08:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy