Advertisement

08.26.2008 at 04:01AM PDT, ID: 23678007 | Points: 500
[x]
Attachment Details

WSDL and perl service help

Asked by Neville_Chinan in Perl Programming Language, SOAP

Tags: , ,

Iam having a problem with the permissions to a web service that I have created
I have the directory setup /var/www/cgi-bin and /var/www/html
In the cgi-bin directory I have a perl module Demo2.pm

package Demo2;
use strict;
use warnings;

=begin WSDL
        _IN hi $string
        _DOC This is a test soap web service that prints hi
        _RETURN $string Returns a string containing hi
=end WSDL

sub hi {
        my $out_xml = "hi";
        return $out_xml;
}

1;

I am using Pod::WSDL to create a wsdl markup [wsdl.pl] contained in the same directory

#!/usr/bin/perl

use strict;
use warnings;

use Pod::WSDL;
my $pod = new Pod::WSDL(source => "./Demo2.pm",
        location => 'http://localhost/cgi-bin/',
        pretty => 1,
        withDocumentation => 1);
print( $pod->WSDL );

When I run this file it gives me the wsdl output

<?xml version="1.0" encoding="UTF-8"?>
<!-- WSDL for http://localhost/cgi-bin/ created by Pod::WSDL version: 0.05 on Mon Aug 25 21:55:05 2008 -->
<wsdl:definitions targetNamespace="http://localhost/Demo2" xmlns:impl="http://localhost/Demo2" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns1="http://localhost/Demo2">

      <wsdl:message name="hiRequest">
            <wsdl:part name="hi" type="xsd:string" />
      </wsdl:message>

      <wsdl:message name="hiResponse">
            <wsdl:part name="hiReturn" type="xsd:string">
                  <wsdl:documentation>Returns a string containing hi</wsdl:documentation>
            </wsdl:part>
      </wsdl:message>

      <wsdl:portType name="Demo2Handler">
            <wsdl:operation name="hi" parameterOrder="hi">
                  <wsdl:documentation>This is a test soap web service that prints hi</wsdl:documentation>
                  <wsdl:input message="impl:hiRequest" name="hiRequest" />
                  <wsdl:output message="impl:hiResponse" name="hiResponse" />
            </wsdl:operation>

      </wsdl:portType>

      <wsdl:binding name="Demo2SoapBinding" type="impl:Demo2Handler">
            <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />

            <wsdl:operation name="hi">
                  <wsdlsoap:operation soapAction="" />
                  <wsdl:input name="hiRequest">
                        <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost/Demo2" use="encoded" />
                  </wsdl:input>
                  <wsdl:output name="hiResponse">
                        <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost/Demo2" use="encoded" />
                  </wsdl:output>
            </wsdl:operation>

      </wsdl:binding>

      <wsdl:service name="Demo2HandlerService">
            <wsdl:port binding="impl:Demo2SoapBinding" name="Demo2">
                  <wsdlsoap:address location="http://localhost/cgi-bin/" />
            </wsdl:port>
      </wsdl:service>

</wsdl:definitions>

I store this in a directory as /var/www/html/service.wsdl

Now I create a SOAP::Lite client [wsdltest.cgi] in the /var/www/cgi-bin directory
 that tries to retrieve the function

#!/usr/bin/perl -w
use SOAP::Lite;
my $wsdl = SOAP::Lite -> service("http://localhost/service.wsdl");
my $result = $wsdl -> hi();
print $result;
print "\n";

If I type http://localhost/service.wsdl it gives me the XML output that
describes the module.

When I run wsdltest.cgi it gives me the error
403 Forbidden at ./wsdltest.cgi line 4

This is odd because cgi/perl scripts do run fine in this directory.
The solution probably lies in where to put the Demo2.pm file in an
apache web server however I'm not sure.
ThanksStart Free Trial
[+][-]08.26.2008 at 06:15AM PDT, ID: 22314222

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 07:04AM PDT, ID: 22314772

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 07:37AM PDT, ID: 22315190

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 07:38AM PDT, ID: 22315221

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 07:44AM PDT, ID: 22315315

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 08:24AM PDT, ID: 22315804

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 08:26AM PDT, ID: 22315840

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 08:30AM PDT, ID: 22315880

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 08:48AM PDT, ID: 22316063

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 08:50AM PDT, ID: 22316094

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 08:51AM PDT, ID: 22316120

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 10:07AM PDT, ID: 22316956

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 10:40AM PDT, ID: 22317240

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 12:16PM PDT, ID: 22318318

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 01:04PM PDT, ID: 22318802

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 01:08PM PDT, ID: 22318859

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.26.2008 at 03:43PM PDT, ID: 22320483

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.27.2008 at 06:24AM PDT, ID: 22324453

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628