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

soap client gets permission denied

Expand Messages
  • prami_22
    Hello, I am writing a web service to return contents of a file At server side I can open a file & read contents but when client calls same method, I get
    Message 1 of 8 , Oct 5, 2010
    • 0 Attachment
      Hello,

      I am writing a web service to return contents of a file
      At server side I can open a file & read contents but when client calls same method, I get permission denied error.
      Please explain why am I getting this error & how to avoid it

      -Thanks
      Pramila
    • Dave Howorth
      ... You re getting it because you ve done something wrong and you could avoid it either by fixing it or by using a different solution. If you want some more
      Message 2 of 8 , Oct 5, 2010
      • 0 Attachment
        prami_22 wrote:
        > I am writing a web service to return contents of a file
        > At server side I can open a file & read contents but when client calls same method, I get permission denied error.
        > Please explain why am I getting this error & how to avoid it

        You're getting it because you've done something wrong and you could
        avoid it either by fixing it or by using a different solution.

        If you want some more specific help, posting your code and the actual
        messages you see will help people to help you.

        Cheers, Dave
      • prami_22
        here is my server & client code #-------------------server.cgi---------------------- #!/usr/bin/perl -w use SOAP::Transport::HTTP; SOAP::Transport::HTTP::CGI
        Message 3 of 8 , Oct 5, 2010
        • 0 Attachment
          here is my server & client code
          #-------------------server.cgi----------------------
          #!/usr/bin/perl -w

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

          package Demo;
          sub topic_list {
          $config_path ="/home/pramila/config";
          open(CONFIG, "< $config_path") or die "can't open $config_path: $!";
          my @lines = <CONFIG>;
          my @topics;
          foreach $line (@lines){
          if ($line =~ /keywords/){
          chomp $line;
          my ($key,$value) = split(/ /,$line);
          my @temp = split(/,/,$value);
          push (@topics,@temp);
          }
          }
          return @topics;
          }
          close(CONFIG);

          #--------------------------my_soap_client.pl-----------------
          #!/usr/bin/perl -w

          use SOAP::Lite;

          my $soap = SOAP::Lite
          ->uri('Demo')
          ->proxy('http://10.77.97.204/soap/server.cgi');
          my $result =$soap->topic_list();
          unless ($result->fault) {
          print $result->result();
          } else {
          print join ', ',
          $result->faultcode,
          $result->faultstring;
          }

          #------------------------------------------------------
          here is output after executing my_soap_client.pl

          soap:Server, can't open /home/pramila/config: Permission denied at /var/www/html/soap/server.cgi line 13.

          -Regards,
          Pramila

          --- In soaplite@yahoogroups.com, Dave Howorth <dhoworth@...> wrote:
          >
          > prami_22 wrote:
          > > I am writing a web service to return contents of a file
          > > At server side I can open a file & read contents but when client calls same method, I get permission denied error.
          > > Please explain why am I getting this error & how to avoid it
          >
          > You're getting it because you've done something wrong and you could
          > avoid it either by fixing it or by using a different solution.
          >
          > If you want some more specific help, posting your code and the actual
          > messages you see will help people to help you.
          >
          > Cheers, Dave
          >
        • Chris Woodfield
          Please tell me that you ve already verified that server.cgi is readable and executable by the (most likely unprivileged) UID that your apache daemon runs as...
          Message 4 of 8 , Oct 5, 2010
          • 0 Attachment
            Please tell me that you've already verified that server.cgi is readable and executable by the (most likely unprivileged) UID that your apache daemon runs as...

            -C

            On Oct 5, 2010, at 10:43 55PM, prami_22 wrote:

             

            here is my server & client code
            #-------------------server.cgi----------------------
            #!/usr/bin
            soap:Server, can't open /home/pramila/config: Permission denied at /var/www/html/soap/server.cgi line 13.

            -Regards,
            Pramila

            --- In soaplite@yahoogroups.com, Dave Howorth <dhoworth@...> wrote:
            >
            > prami_22 wrote:
            > > I am writing a web service to return contents of a file
            > > At server side I can open a file & read contents but when client calls same method, I get permission denied error.
            > > Please explain why am I getting this error & how to avoid it
            >
            > You're getting it because you've done something wrong and you could
            > avoid it either by fixing it or by using a different solution.
            >
            > If you want some more specific help, posting your code and the actual
            > messages you see will help people to help you.
            >
            > Cheers, Dave
            >


          • Dave Howorth
            prami_22 wrote: [snip] ... and so ... ???? what have you done to investigate????? Does /home/pramila/config exist? What are its permissions? What user is your
            Message 5 of 8 , Oct 6, 2010
            • 0 Attachment
              prami_22 wrote:
              [snip]
              > #------------------------------------------------------
              > here is output after executing my_soap_client.pl
              >
              > soap:Server, can't open /home/pramila/config: Permission denied at /var/www/html/soap/server.cgi line 13.

              and so ... ????

              what have you done to investigate?????

              Does /home/pramila/config exist?
              What are its permissions?
              What user is your script running as?
            • Dave Howorth
              ... I don t think it would get to line 13 if it wasn t accessible! :)
              Message 6 of 8 , Oct 6, 2010
              • 0 Attachment
                Chris Woodfield wrote:
                > Please tell me that you've already verified that server.cgi is readable
                > and executable by the (most likely unprivileged) UID that your apache
                > daemon runs as...

                I don't think it would get to line 13 if it wasn't accessible! :)
              • Chris Woodfield
                Correction: /home/pramila/config needs to be reachable by apache, not server.cgi... -C
                Message 7 of 8 , Oct 6, 2010
                • 0 Attachment
                  Correction: /home/pramila/config needs to be reachable by apache, not server.cgi...

                  -C

                  On Oct 6, 2010, at 8:07 38AM, Dave Howorth wrote:

                   

                  Chris Woodfield wrote:
                  > Please tell me that you've already verified that server.cgi is readable
                  > and executable by the (most likely unprivileged) UID that your apache
                  > daemon runs as...

                  I don't think it would get to line 13 if it wasn't accessible! :)


                • prami_22
                  Yes , that was the problem. Though my file had 644 rights, it was not readable by apache. After I added user apache to my group, client could read it Thanks
                  Message 8 of 8 , Oct 6, 2010
                  • 0 Attachment
                    Yes , that was the problem. Though my file had 644 rights, it was not readable by apache. After I added user apache to my group, client could read it

                    Thanks Chris, & all others who replied

                    -Regards,
                    Pramila


                    --- In soaplite@yahoogroups.com, Chris Woodfield <rekoil@...> wrote:
                    >
                    > Correction: /home/pramila/config needs to be reachable by apache, not server.cgi...
                    >
                    > -C
                    >
                    > On Oct 6, 2010, at 8:07 38AM, Dave Howorth wrote:
                    >
                    > > Chris Woodfield wrote:
                    > > > Please tell me that you've already verified that server.cgi is readable
                    > > > and executable by the (most likely unprivileged) UID that your apache
                    > > > daemon runs as...
                    > >
                    > > I don't think it would get to line 13 if it wasn't accessible! :)
                    > >
                    >
                  Your message has been successfully submitted and would be delivered to recipients shortly.