Loading ...
Sorry, an error occurred while loading the content.

denied access to method

Expand Messages
  • dahven
    Hi, I hope someone can help. Error I m getting: SOAP-ENV:Client
    Message 1 of 1 , Sep 17 9:13 AM
    • 0 Attachment
      Hi,

      I hope someone can help.

      Error I'm getting:

      <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
      <faultcode xsi:type="xsd:string">SOAP-ENV:Client
      </faultcode>
      <faultstring xsi:type="xsd:string">
      Denied access to method (findNumbers) in class at (main)
      usr/lib/perl5/site_perl/5.6.0/SOAP/Lite.pm line 2128.
      </faultstring>
      <faultactor xsi:type="xsd:string">http://test.com:8080/
      </faultactor>
      </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      I have see simular problems on this list and others but none of the
      work arounds have produced results.

      my client.pl program:

      #!/usr/bin/perl

      use SOAP::Lite + trace => qw(debug);

      my @params = qw(book1 book2);

      my $s = SOAP::Lite
      -> uri('http://test.com/BookList')
      -> service('file:./BookList.wsdl')
      ;

      my $r = $s->findNumbers(@params);

      -----------------------------------
      BookList.wsdl:

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions
      name="BookList"
      targetNamespace="http://test.com:8080/BookList.wsdl"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://test.com:8080/BookList.wsdl"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsd1="http://test.ocm:8080/BookList.xsd1">
      <types>
      <xsd:schema
      targetNamespace="http://test.com:8080/BookList.xsd1"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://test.com:8080/BookList.wsdl"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsd1="http://test.com:8080/BookList.xsd1">
      <xsd:complexType name="BookType">
      <xsd:all>
      <xsd:element maxOccurs="1" minOccurs="0"
      name="bookNumber" type="xsd:string"/>
      <xsd:element maxOccurs="1" minOccurs="0"
      name="bookStatus" type="xsd:string"/>
      </xsd:all>
      </xsd:complexType>
      </xsd:schema>
      </types>
      <message name="findNumbersRequest">
      <part name="book1" type="xsd:string"/>
      <part name="author" type="xsd:string"/>
      </message>
      <message name="findNumbersResponse">
      <part name="bookList" type="xsd1:BookTypeArray"/>
      </message>
      <portType name="BookListPortType">
      <operation name="findNumbers">
      <input message="tns:findNumbersRequest"/>
      <output message="tns:findNumbersResponse"/>
      </operation>
      </portType>
      <binding name="BookListBinding" type="tns:BookListPortType">
      <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="findNumbers">
      <soap:operation

      soapAction="capeconnect:BookList:BookListPortType#findNumbers"/>
      <input>
      <soap:body use="literal"/>
      </input>
      <output>
      <soap:body use="literal"/>
      </output>
      </operation>
      </binding>
      <service name="BookList">
      <port binding="tns:BookListBinding" name="BookListPort">
      <soap:address location="http://test.com:8000/BookList"/>
      </port>
      </service>
      </definitions>


      --------------------------------------------

      on server test.com:
      my daemon.pl program:

      #!/usr/bin/perl -w

      use SOAP::Transport::HTTP;
      $SIG{PIPE} = $SIG{INT} = 'IGNORE';

      my $daemon = SOAP::Transport::HTTP::Daemon
      -> new (LocalPort => 8080)
      -> dispatch_to('/modules')
      ;

      print "Contact to soap server at ", $daemon->url, "\n";
      $daemon->handle;


      #### other lines that wre tried with same result
      # -> dispatch_to('/modules', 'BookList')
      # -> dispatch_to('/modules/','[\w:]+')
      # -> on_action(sub {})

      -----------------------------------------

      the BookList.pm module

      package BookList;

      sub findNumbers(@) {
      print "@_ \n";

      return @_;
      }
      1;
    Your message has been successfully submitted and would be delivered to recipients shortly.