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

Re: [soaplite] MIME::Entity to create SOAP::Lite attachment using parts() is failing with 500 Internal Server Error

Expand Messages
  • 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 1 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]);

      Steve Piercey


      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!


      <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-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
      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>
      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.