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

Can't locate object method "headers"...

Expand Messages
  • go81816
    I ve tried to use the SOAP::Lite sample in mod_perl implementations on both a SunOS 5.8 box and an OpenBSD 3.6 box both with identical unsuccessful results.
    Message 1 of 3 , Jan 6, 2005
    • 0 Attachment
      I've tried to use the SOAP::Lite sample in mod_perl implementations
      on both a SunOS 5.8 box and an OpenBSD 3.6 box both with identical
      unsuccessful results.

      Stepping through the SOAP::Lite modules I can see that the SOAP
      object code is correctly being found and executed (e.g. the "hi"
      function in the "Demo" package is being correctly found and called
      and returned to the SOAP::Server->handle function). However, as
      this is a mod_perl implementation, in the
      SOAP::Transport::HTTP::Apache->handler function a call to $self-
      >response->headers->scan(sub { $r->header_out(@_) }); generates an
      internal server error and spits this message into my apache log:
      [error] Can't locate object method "headers" via
      package "HTTP::Headers"
      at /usr/local/apdm/lib/perl5/site_perl/5.8.0/HTTP/Message.pm line
      172.

      This "headers" method is being accessed elsewhere within SOAP::Lite,
      so I've seen, but why oh why does this call generate this error only
      in this particular instance?

      Help.
    • Tony Rose
      Hi, Sorry for the newbie question, and thanks for reading it :) I have been trying to do this for a few days and here is my cleanest approach for adding an
      Message 2 of 3 , Jan 6, 2005
      • 0 Attachment
        MIME::Entity to create SOAP::Lite attachment using parts() is failing with 500 Internal Server Error Hi,

        Sorry for the newbie question, and thanks for reading it :)  I have been trying to do this for a few days and here is my cleanest approach for adding an attachment to my SOAP request.  Unfortunately I keep getting an error from the Tomcat server that I am posting to.  This follows exactly the examples that I have found on the internet and I am not sure what else to try except to POST the request directly without using SOAP::Lite or MIME::Entity which I don’t want to do if I can get away with it!...

        Thanks for any tips!

        Tony

        <code snippet>

            my $attachment = build MIME::Entity
                Type => "text/plain",
                Encoding => "UTF-8",
                Path => "$file",
                Filename => "saveme.txt",
                Disposition => "attachment",
                ;

            my @attachment = ($attachment);

            my $soap = SOAP::Lite
                -> service("$service_wsdl")
                -> encoding("UTF-8")
                -> parts(@attachment)
                -> operationBulk(
                                 name(numberOfTasks => $numberOfTasks),
                                 name(vendorBulkIdentifier => $bulk_id),
                                 )
                ;

        </code snippet>


        </response snippet>

        HTTP/1.1 500 Internal Server Error
        Connection: close
        Date: Fri, 07 Jan 2005 01:56:34 GMT
        Server: Apache/2.0.50 (Unix) mod_ssl/2.0.50 OpenSSL/0.9.6b mod_jk/1.2.0
        Content-Language: en-US
        Content-Type: text/html;charset=ISO-8859-1
        Client-Date: Fri, 07 Jan 2005 01:56:35 GMT
        Client-Peer: 12.129.8.220:443
        Client-Response-Num: 1
        Client-SSL-Cert-Issuer: /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority
        Client-SSL-Cert-Subject: /C=US/ST=Washington/L=Seattle/O=Qpass Inc/OU=Operations/CN=triton-api-g3.qpass.com
        Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
        Client-SSL-Warning: Peer certificate not verified
        Client-Transfer-Encoding: chunked
        Title: Apache Tomcat/4.1.27 - Error report

        <html><head><title>Apache Tomcat/4.1.27 - Error report</title><STYLE><!--H1{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} H3{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color : black;background-color : white;} B{color : white;background-color : #0086b2;} HR{color : #0086b2;} --></STYLE> </head><body><h1>HTTP Status 500 - Internal Server Error</h1><HR size="1" noshade><p><b>type</b> Exception report</p><p><b>message</b> <u>Internal Server Error</u></p><p><b>description</b> <u>The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.lang.RuntimeException
                at org.apache.axis.Message.setup(Message.java:325)

        ...
        ...
        ...
        </response snippet>





        --
        Tony Rose   
        Carrier Integration Engineer                                                
        Danger, INC
        <T>  +1 650 289 5080     <hiptop>  +1 650 283 3661
        <F>  +1 650 289 5001     <AIM>     trosedanger
        <E>  trose@...    <hiplog>  hiptop.com/hiplog/read/5/3289/
      • Steve Piercey
        Not sure if this is your problem, but the - parts() argument takes an array reference. I m assuming you are using version 0.65 beta $ent = build MIME::Entity
        Message 3 of 3 , Jan 7, 2005
        • 0 Attachment
          Not sure if this is your problem, but the '->parts()' argument takes an
          array reference. I'm assuming you are using version 0.65 beta


          $ent = build MIME::Entity .....
          ... ->parts([$ent]);

          HTH,
          Steve Piercey




          Hi,

          Sorry for the newbie question, and thanks for reading it :) I have been
          trying to do this for a few days and here is my cleanest approach for adding
          an attachment to my SOAP request. Unfortunately I keep getting an error
          from the Tomcat server that I am posting to. This follows exactly the
          examples that I have found on the internet and I am not sure what else to
          try except to POST the request directly without using SOAP::Lite or
          MIME::Entity which I donĀ¹t want to do if I can get away with it!...

          Thanks for any tips!

          Tony

          <code snippet>

          my $attachment = build MIME::Entity
          Type => "text/plain",
          Encoding => "UTF-8",
          Path => "$file",
          Filename => "saveme.txt",
          Disposition => "attachment",
          ;

          my @attachment = ($attachment);

          my $soap = SOAP::Lite
          -> service("$service_wsdl")
          -> encoding("UTF-8")
          -> parts(@attachment)
          -> operationBulk(
          name(numberOfTasks => $numberOfTasks),
          name(vendorBulkIdentifier => $bulk_id),
          )
          ;

          </code snippet>


          </response snippet>

          HTTP/1.1 500 Internal Server Error
          Connection: close
          Date: Fri, 07 Jan 2005 01:56:34 GMT
          Server: Apache/2.0.50 (Unix) mod_ssl/2.0.50 OpenSSL/0.9.6b mod_jk/1.2.0
          Content-Language: en-US
          Content-Type: text/html;charset=ISO-8859-1
          Client-Date: Fri, 07 Jan 2005 01:56:35 GMT
          Client-Peer: 12.129.8.220:443
          Client-Response-Num: 1
          Client-SSL-Cert-Issuer: /C=US/O=RSA Data Security, Inc./OU=Secure Server
          Certification Authority
          Client-SSL-Cert-Subject: /C=US/ST=Washington/L=Seattle/O=Qpass
          Inc/OU=Operations/CN=triton-api-g3.qpass.com
          Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
          Client-SSL-Warning: Peer certificate not verified
          Client-Transfer-Encoding: chunked
          Title: Apache Tomcat/4.1.27 - Error report

          <html><head><title>Apache Tomcat/4.1.27 - Error
          report</title><STYLE><!--H1{font-family : sans-serif,Arial,Tahoma;color :
          white;background-color : #0086b2;} H3{font-family :
          sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;}
          BODY{font-family : sans-serif,Arial,Tahoma;color : black;background-color :
          white;} B{color : white;background-color : #0086b2;} HR{color : #0086b2;}
          --></STYLE> </head><body><h1>HTTP Status 500 - Internal Server Error</h1><HR
          size="1" noshade><p><b>type</b> Exception report</p><p><b>message</b>
          <u>Internal Server Error</u></p><p><b>description</b> <u>The server
          encountered an internal error (Internal Server Error) that prevented it from
          fulfilling this request.</u></p><p><b>exception</b>
          <pre>java.lang.RuntimeException
          at org.apache.axis.Message.setup(Message.java:325)

          ...
          ...
          ...
          </response snippet>





          --
          Tony Rose
          Carrier Integration Engineer
          Danger, INC
          <T> +1 650 289 5080 <hiptop> +1 650 283 3661
          <F> +1 650 289 5001 <AIM> trosedanger
          <E> trose@... <hiplog> hiptop.com/hiplog/read/5/3289/
        Your message has been successfully submitted and would be delivered to recipients shortly.