-
Notifications
You must be signed in to change notification settings - Fork 58
jasperserver multipart response #21
Comments
What's the error message? It seems to be something in the http-parser. |
Oh .. and if you switch to a different http-driver, does the problem go away? |
On 03/26/2011 05:00 AM, troelskn wrote:
Fatal Error bad content body in Report download at Sat Mar 26 08:04:33 Parameters during error request {"start_date"=>"2011-03-19", And here's the method from my handsoap model def run_report(report,format,parameters) message.set_attr("env:encodingStyle","http://schemas.xmlsoap.org/soap/encoding/") I'm hoping it's just a simple error on my part. Thank You Jeff Rossi http://www.intouchmvc.com |
On 03/26/2011 05:02 AM, troelskn wrote:
Jeff Rossi http://www.intouchmvc.com |
Put this in your global config to switch to the
You can see a full list of supported drivers here |
This is the culprit. It appears that the response, which is a multipart, is malformed. I suspect that this is a problem with the http client driver (curb), but it could also be the server sending garbage. If it doesn't work after switching http client driver, can you try to dump the tcp stream and attach it here? You can use tcpdump or Wireshark for capturing the stream. |
On 03/26/2011 10:32 AM, troelskn wrote:
Jeff Rossi http://www.intouchmvc.com |
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" = Response HTTP/1.1 200 OK 314 ------=_Part_167_24156315.1301150522545 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">soapenv:Body<?xml version="1.0" encoding="UTF-8"?> Æø¥à}CÆúU¾qmnResult version="2.0.1"> <¶Ó p@<×g¦ZµgfÌ ",:ªJ©k©xDºÇmQilÅ¿ï¹8'è vnâÂ+RÒ&Ñ"ãU)¾UI+Üä~ |7³ñÂÁp.ËR·]±N«¸Îv°ã¿B5ǧ¾+Z¨ÛÆp´Kº~(zÇö<óñ}ÿÿñTcÁÿ?ßø/ÿW▒óåÝy¡:i»Iqðãân«µÔüa µqn%;¡ ßÞëj nvû+OâÂßøIõXõÝ3SþÎÔ£@Û;[oÝmÃ#×»¯ìx?çâûÿ%ÿâ©·öëm Æ+³Ès$çîäSõÜ׳¬yD^lope>ø°#'ÆÒG¾×#d}LtIàÿ1dñ¢@®dßêë¼Ó¥Ãº}ÒKgànåA'ýÒ#úê¥Ö¥m«t(ÄBÖÜñ,>v÷? ªúÌ»/¹ 2000 Ù¯?¼ÇÑ|+ã'ÐüC¤xÄV·²ßYHÏå3_¾»ð7§±ÔîmG¹iÙâc±Tª¬÷k¡Õì%vP±À¾·(í_÷CõíïTsâ£Aé°á§W▒2É×gÐw¨YI5ܥΥ"óZEã;ÉÀÇÖ¼Ïâ§bÒNÖ4¸ZÑäßöm½0÷Zì¼Nª-,▒Dͼw±´ß.T Îr=:S£á¾16ù-L&á.hî9EIYðGåAyÎÅ ------=_Part_167_24156315.1301150522545 _J_Éø¯áÏ|^L·Ö¦+Ì ]Û~=ºÊ*£'x±4ðóðSÄz%ËOáy$ó/úò«ði▒l°«X\¨ï!¿R×°Ñ[<LßÄùìÒØòØ~2L½öûL ÑM]Â?/¿ä+ãÏ!;¥¢©ü ru9©Ý4 ÷x5×ÛZÛÙ@°ZÁ ÂÇQôÎS·e$ÁET(¢(¢(¢(¢01Ô QEQE£ò¥¢(¢?ÿÙnt-Id: endstream endobj.4 5 0 obj <</Filter/FlateDecode/Length 1538>>stream xÅKoÛF÷ú³t79ÞÅ#HÐ$rEÑaÑe/XObject/Length 3710/BitsPerComponent 8/Height 76/ColorSpace/DeviceRGB/Subtype/Image/Width 200>>stream =Euþú^J²LÒF3×µa0ç ¿¹ÃÃåo½ËÛñ¢t^Ü{W·½=-Þ¶UBÒwû» ZÜNzýk%-Ý÷Î 3|$OðeøH>lÕ3|Zæ^Å ¶a¿«ÊÊéßæÙt(.Føl¬¾UÎÁ▒ið°FÖù/èÎÆä8gP $à m,ÙFÇÞ#-ÿP|Hð̾+ðUæmv¤M'{ l¦ÉIs¦7½8}¨ÏóYI¨!C)Òvº©s² f¤_Î▒é[ÃÞ ¸26¥)ýõ5]#zÌxîLPâU¼ësîswÎάù{ôá|¤,sƲóéèãùè·d?wÿ+▒?Ý¿.Hv _42Æî(óxöÏj²¸hÙövy·pÚë&èUJ~(¢ rtûå©y¤ÁfµÈ0¿Óè¦Ä¾9c§AyH▒ið YÕ¡ÞÓçªÈÏIà<ôè#}«Iä }¤8 _»ønS{³ø
2d ------=_Part_167_24156315.1301150522545-- 0 Jeff Rossi http://www.intouchmvc.com |
Watch out - that Authorization header is giving away your user/pass in plaintext (it's just base64 encoded). Might want to change that after posting it here. Or edit the post quickly. |
You can override |
This is a wild guess, but the other service calls that works - would they happen to be smaller in size? I think the parser may be stumped by the content being in chunked mode. If that is the case, it would require some addition to the http parser library. I would expect this to not be a problem with other drivers than curb, as they will probably abstract the chunked part away. Did you try with another http driver? |
On 03/26/2011 11:09 AM, troelskn wrote:
http_driver_instance = :net_http just after the endpoint line in my service class Fatal Error bad content body in Report download at Sat Mar 26 11:12:15 Parameters during error request {"start_date"=>"2011-03-19", Line 151 is the invoke line from my earlier post Jeff Rossi http://www.intouchmvc.com |
On 03/26/2011 11:09 AM, troelskn wrote:
Jeff Rossi http://www.intouchmvc.com |
On 03/26/2011 11:09 AM, troelskn wrote:
def http_driver_instance But still no joy /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:70:in Jeff Rossi http://www.intouchmvc.com |
No, multipart and chunked transfer are two separate matters. Chunked refers to the ability to send a large http response in multiple "chunks", rather than as one stream. So it's a transfer encoding (Sort of like gzip or other transfer-level encoding). Multipart is something higher level (Eg. is parsed later in the process). But this is just a hunch of mine - It might be a red herring. I'll suggest that you try to edit |
On 03/26/2011 06:34 PM, troelskn wrote:
Logfile created on Sun Mar 27 08:33:14 -0400 2011 by logger.rb/22285------=_Part_193_22897301.1301229203159 Jeff Rossi http://www.intouchmvc.com |
On 03/26/2011 06:34 PM, troelskn wrote:
Jeff Rossi http://www.intouchmvc.com |
I'm not sure what exactly is going wrong here, but it appears that the parser is off by exactly two bytes, which is equal to one line break. I think it is related to the transfer encoding being chunked, but it's probably a bug in the http-parser, rather than the client driver. Can you try to replace the lines
|
On 03/27/2011 10:15 AM, troelskn wrote:
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:77:in 155 is still invoke line, line #s changed due to http_driver_instance block Jeff Rossi http://www.intouchmvc.com |
My bad. I meant:
|
On 03/27/2011 05:11 PM, troelskn wrote:
Fatal Error undefined method `size' for Parameters during error request {"start_date"=>"2011-03-20", I had inspected the reponse and it was 2 parts, 1st xml, 2nd pdf so I return response.http_response.parts[1] Jeff Rossi http://www.intouchmvc.com |
On 03/27/2011 05:11 PM, troelskn wrote:
return response.http_response.parts[1].body() The patch as it is in my abstract driver is
Thanks Jeff Rossi http://www.intouchmvc.com |
Did this patch ever find it's way into the main codebase? |
I am trying to convert some SOAP::RPC::DRIVER code I was using to fetch pdf documents from jasperserver. This probably isn't really an issue I just can't seem to find how to do it in the documentation.
My xml request
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header />
env:Body
<request operationName="runReport" locale="en"><argument name="RUN_OUTPUT_FORMAT">PDF</argument><resourceDescriptor isNew="false" wsType="" name="" uriString="/reports/staging/staging-stop"><label>null</label><parameter name="start_date"><![CDATA[1300410000000]]></parameter><parameter name="time_zone_offset"><![CDATA[-3600]]></parameter><parameter name="end_time"><![CDATA[00:59:59]]></parameter><parameter name="output_format"><![CDATA[PDF]]></parameter><parameter name="device_id"><![CDATA[51]]></parameter><parameter name="user_id"><![CDATA[1]]></parameter><parameter name="include"><![CDATA[true]]></parameter><parameter name="time_zone"><![CDATA[Central Time (US & Canada)]]></parameter><parameter name="end_date"><![CDATA[1301101199000]]></parameter><parameter name="start_time"><![CDATA[01:00:00]]></parameter></resourceDescriptor></request>
/env:Body
/env:Envelope
portion of backtrace from error
Are there some options to invoke or a method of response that will make this work?
The text was updated successfully, but these errors were encountered: