Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

jasperserver multipart response #21

Open
rossi-jeff opened this issue Mar 25, 2011 · 23 comments
Open

jasperserver multipart response #21

rossi-jeff opened this issue Mar 25, 2011 · 23 comments

Comments

@rossi-jeff
Copy link

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

/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:70:in `parse_multipart'
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:25:in `parse_http_part'
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/curb_driver.rb:64:in `send_http_request'
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/service.rb:249:in `invoke'

Are there some options to invoke or a method of response that will make this work?

@troelskn
Copy link
Contributor

What's the error message? It seems to be something in the http-parser.

@troelskn
Copy link
Contributor

Oh .. and if you switch to a different http-driver, does the problem go away?

@rossi-jeff
Copy link
Author

On 03/26/2011 05:00 AM, troelskn wrote:

What's the error message? It seems to be something in the http-parser.

Here's the full backtrace caught by a rescue clause in my controller

Fatal Error bad content body in Report download at Sat Mar 26 08:04:33
-0400 2011

Parameters during error request {"start_date"=>"2011-03-19",
"format"=>"PDF", "max_speed"=>"30", "action"=>"single",
"group_id"=>["5", "default"], "device_id"=>"51", "report_id"=>"8",
"time_zone"=>"Central Time (US & Canada)", "controller"=>"pdf",
"end_date"=>"2011-03-26"}
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:70:in
parse_multipart' /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:25:in parse_http_part'
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/curb_driver.rb:64:in
send_http_request' /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/service.rb:249:ininvoke'
/home/jeff/svn/intouchmvc/trunk/app/models/management_service_service.rb:150:in
run_report' /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/service.rb:189:insend'
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/service.rb:189:in method_missing' /home/jeff/svn/intouchmvc/trunk/app/controllers/pdf_controller.rb:354:in single'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:1322:in
send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:1322:in perform_action_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:617:in
call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:610:in perform_action_without_benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in realtime' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in ms'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rescue.rb:160:in perform_action_without_flash'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/flash.rb:141:in
perform_action_without_newrelic_trace' /usr/lib/ruby/gems/1.8/gems/newrelic_rpm-2.13.4/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:254:in perform_action'
/usr/lib/ruby/gems/1.8/gems/newrelic_rpm-2.13.4/lib/new_relic/agent/method_tracer.rb:141:in
trace_execution_scoped' /usr/lib/ruby/gems/1.8/gems/newrelic_rpm-2.13.4/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:247:in perform_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523:in
send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523:in process_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:606:in
process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:391:in process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:386:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/routing/route_set.rb:433:in call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:88:in
dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:111:in _call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:82:in
initialize' /usr/lib/ruby/gems/1.8/gems/newrelic_rpm-2.13.4/lib/new_relic/rack/developer_mode.rb:20:in call'
/usr/lib/ruby/gems/1.8/gems/newrelic_rpm-2.13.4/lib/new_relic/rack/developer_mode.rb:20:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/head.rb:9:in call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb:24:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/params_parser.rb:15:in call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rewindable_input.rb:25:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/abstract_store.rb:122:in call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:29:in
call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:9:in
cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:28:in call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/failsafe.rb:11:in call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in synchronize'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/lock.rb:11:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:106:in call'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/static.rb:31:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:46:in call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in
each' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb:40:in call'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/log_tailer.rb:17:in
call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/content_length.rb:13:in call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:46:in
service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach'
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart'
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb:13:in run'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:111
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire'
script/server:3

And here's the method from my handsoap model

def run_report(report,format,parameters)
soap_action = 'runReport'
xml = ''
doc = Builder::XmlMarkup.new(:target => xml)
doc.request(:operationName => 'runReport', :locale => 'en') do
|request|
request.argument(format, :name => 'RUN_OUTPUT_FORMAT')
request.resourceDescriptor(:name => '', :wsType => '',
:uriString => report, :isNew => 'false') do |resource|
resource.label('null')
if parameters.size > 0
parameters.each do |k,v|
if v.is_a?(Array)
v.each do |v2|
resource.parameter(:name => k, :isListItem => true) do |p|
p.cdata!(v2)
end
end
else
resource.parameter(:name => k) do |p|
p.cdata!(v)
end
end
end
end
end
end
response = invoke('runReport', soap_action) do |message|

message.set_attr("env:encodingStyle","http://schemas.xmlsoap.org/soap/encoding/")
message.add('requestXmlString',xml) do |request|
request.set_attr("xsi:type","xsd:string")
end
end
return response.http_response.parts
end

I'm hoping it's just a simple error on my part.

Thank You

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@rossi-jeff
Copy link
Author

On 03/26/2011 05:02 AM, troelskn wrote:

Oh .. and if you switch to a different http-driver, does the problem go away?

I'm not sure how to do that.

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@troelskn
Copy link
Contributor

I'm not sure how to do that.

Put this in your global config to switch to the Net::HTTP driver

Handsoap.http_driver = :net_http

You can see a full list of supported drivers here

@troelskn
Copy link
Contributor

Fatal Error bad content body in Report download at Sat Mar 26 08:04:33-0400 2011
...
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:70:in
`parse_multipart'

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.

@rossi-jeff
Copy link
Author

On 03/26/2011 10:32 AM, troelskn wrote:

Fatal Error bad content body in Report download at Sat Mar 26 08:04:33-0400 2011
...
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:70:in
`parse_multipart'

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.

The server is jasper server and I have gotten pdfs with
SOAP::RPC::DRIVER, can I change the http driver for just this class or
possible just the method to get pdfs instead of globally? I have 2 other
classes that are working properly using handsoap w/ curb.

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@rossi-jeff
Copy link
Author

<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:Body

<request
operationName="runReport"
locale="en"><argument
name="RUN_OUTPUT_FORMAT">PDF</argument><resourceDescriptor
isNew="false" name="" wsType=""
uriString="/reports/staging/staging-speeding"><label>null</label><parameter
name="start_date"><![CDATA[1300496400000]]></parameter><parameter
name="time_zone_offset"><![CDATA[-3600]]></parameter><parameter
name="end_time"><![CDATA[00:59:59]]></parameter><parameter
name="max_speed"><![CDATA[30]]></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[1301187599000]]></parameter><parameter
name="start_time"><![CDATA[01:00:00]]></parameter></resourceDescriptor></request>

/env:Body
/env:Envelope

= Response

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: multipart/related; type="text/xml";
start="<8C8B7B1B32038C422B14EB06C05AF180>";
boundary="----=_Part_167_24156315.1301150522545"
Transfer-Encoding: chunked
Date: Sat, 26 Mar 2011 14:42:02 GMT

314

------=_Part_167_24156315.1301150522545
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: <8C8B7B1B32038C422B14EB06C05AF180>

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
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%;¡×máºO¼){¡HÏv5"îfñü vëÍt¿ØðÏÅ÷þKÿÅQýüü_àd¿üU¯9+mé *qZ|áù¥
ßÞëj
1ñÈïæ0'ߥÿ+âáàøÂØßí2ñºõoìx?çâûÿ%ÿâ¨þÇþ~/¿ð2_þ_«ë3{Ùü½O2Ó>
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·²ßY­HÏå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%-Ý÷ιý«ÝöR.73ÐNÚ»è&R¼Ýã¬×ÓV;Üùf骫'é Ý=iwu1+誵Ak
%CE/ÆWÞùCïlðµi£éøÔ|Í­S)üñ'½­Ý/í¤.<©+W`÷¿mîïÅ>MÞïa×áµ¾
ÔøJ«JÌýÖ
¦Õ¥+¼:K+£ª=Kwïfwõb4;ÎÚ
¬Þég¹▒▒Z²ÊæƯNO0»ÝøC§çê±Ô_v¹±Î,Ý(¢²Ë3¶ ÕØÑç/Íq°öõZrÎsª»¥ý]ká­+¦WÛVzöú
­#³vôtJ#ÚZ«Âo=«á¦u¤Üâ▒,~7³ñø§¸Çâú]b½ÛzÂÆT q¯Gßõô®É3ÙÊÁbEÓ×®¯hÛ
£Å÷±e
▒▒ $.'
",#(7),01444'9=82<.342ÿÛC
}ÿ¾®±+]▒pö Ïõx6ÝñÑGúÆ.}¤ÁC¶jM_]P▒§ß-qÖ®rû]YëÄïqóã§P,¤¡º
EÈ@▒j°Æ­êkÛÖÎf¯sW▒ö¾Ã»¯

3|$OðeøH>lÕ3|Zæ^Å ¶a¿«ÊÊéßæÙt(.Føl¬¾UÎÁ▒ið°FÖù/èÎÆä8gP
úHñ>]ÐËÔJ×1áÍ)3(²³FúÖå4xX#ÅDÖ*]ÆÄ9ô¨æ½¢Cub£Î¡22222222ÿLÈ"ÿÄ Ô°Ui¨¹1ysÆØ¡mÅNéSpÏñÎ*Ôà¡è«ê]ºUQéM¢¤¡øYCý<32P5lU▒k\é&Ä$:SðÁLjc<Ô![µ!/Ub&¼²ûåÊP9P#
ÿĵ}!1AQa"q2#B±ÁRÑð$3br glLt£>ò¿NÅA}
òH±C>uæ§5þÀÍ▒éë,U4xX#ÅDÖª\EÅ:b4?2é¡)¨Á)vð§N½kâT²3g¨m]9¨ÁÂ_v8ç8NU1yN(ÏiÏ^æÐ÷£<ÔàÁñwË\ùäFwc¶)-;ldÀ¸,ó2P6lÕ3ìü³ïÊÆ:e@ô CñnËGõäûl_.ÇC®^|Ðí[$¡O/­zî2µäuLS
ŸʿrdÃÊ,S4P9R|F®.ò_&ÞE´ /Ô
ÿĵw!1AQaq"B¡±Á #3RðbrÑ ºÎçK@ú{t/C▒9 Dc|G,¤ô)£;.õ2êë ¼ $4á%ñ▒▒&'()_56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz¢£¤¥¦§¨©ª²³´µ¶·¸{äª<ÇsHçëGå»Ù;ñöh¼xúùôf³Mûd<m3é9ËÅqo°uݾ·öØß;êjvÖʶçL¤ÆrbÀ"êg÷Zt±Õè ?÷ú(¢ êÅßóaýSh/Þ×sêùZªÔ9mÚ÷ (¤pJ=ÇjZLÜV¥¢i·\jºãþ~Ð)ÿÆT▒À¼øCàÍF=ñÛ\ÄíÒho$cõù ·þ/zÝK:ª'ü_Îâ¿ KRag¬Z©D~hÉÉFá;&­¢ë7▒®°\Â</L5ëÞñ endstream ¿ªt¹RwB®ì÷6(¢È°¢(¢(¢(¢(¢(¢(¢(¢(¢(ª▒¶iÛ¶vfî§$~~¨êÚ¬▒=»¸We endobj * 1 0 obj M4ëðÚÿP]:çKÓ¡¼áVïNki$>Ìè¤Æ¹¯øv/øNâxtôVûMy <</Type/Page/Contents 5 0 R/Parent 6 0 R/Group<</Type/Group/S/Transparency/CS/DeviceRGB>>/Resources<</ColorSpace<</CS/DeviceRGB>>/XObject<</img0 3 0 R>>/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]/Font<</F1 2 0 R/F2 4 0 R>>>>/MediaBox[0 0 612 792]>> ³HÏ endobj eeiùÇOZ¿©ø}µ 8 0 obj.yÞúÚGã[Â¥¬ï§Tõ3q¹g]·Tð®¡Ën,ä0è <</Filter/FlateDecode/Length 1643>>stream²1ϨGËn1ûãôÍRÕõ½èÖçÉ-¿öÔ6eapÛciÜÀÚJ¨ÇØMØîh¯+¾Õ¼XÄmæÖ÷}5tÕêo5YÀRl-«Ãþ°Ô§GoÜê´u[x¥»Ô"Ùªm8ÆèJ?1ã';Ö´ö/º'ÈõÀ¥®-ƧZ&ÞcvVÁ?0
öéØÕ·:¼82ÝyrM<>X¨#åõÀÍu4WÆ«
xÅÝoÛ6ÅßýWð±:¼ü·ií5Ùö0ìAHÔÇKáÿ~ãÆJá½nÖF-å\êw®uHÉþwtt>²AÕ>¨óËÑëóѯ#Roûÿ5J§þß::Þ▒eÒ³«ÑÎÿî·Ýn¢ÕÅt*£clhUë¥ÝWÔ4êGÓ¨E7º▒þòþeoªîH×


$¡ôvñn~Ñ.ÇóY¯¨Õõªþ/×UC=V7ë<=YÏúeXÐÙ§®»d«&Üh®&ì:<¯o»Ù«▒çíº▒¨<U·®jâþøØ}+¬Í.½\PÞû­ê£Ý9&Õ:R¯_]ë'q;½ÏÔÑäöò¥:nWËù¬UG]{ñQ½y÷£5dB¡JÖà\E¥2aÇ8Ç7ËvvѩݧùâY▒ȹÆUÑaE{@tÒ¶&ªÓ÷ߤ8xª«hÓõøqãjrÂ÷wªËHCÆH±Ð:Þè
ÍÁÙ¾«­(©▒QEQEciZÇöíÝĶDfÛHaùx}í¿ì)ã=Î{ZMê6k/ÄWic¡Ü\Io®ÑåH2§,?jV¿äV»ú§þ´ª|F^QÎ8ÚBcáÉý8&³àÞ!6ß7¬Á2ð▒"¼¡âwÍÞñ!¥
Å ôÿBaÓÚå
ôõªn´Ú#wTóUàà4d¸#ÅBî;ßç¾à@,1:EÐ=:Õâlå84dNð¥ï6'æadÈQ.ð4?ÒAÈóSVöÓ(¡ì÷,JIFé}¤!cxËð ÷uNàódµzÓÍîæF8¬ÂiâPC8TüBܱ·¾or ¯A>¡&÷ãTEÊü?¨!ã¤8ð)ìzr÷(]é°'⨠«Yv pê0rpqÇNâºÚàÇü#þ÷þÒ 5øà'▒6¥$-¡ÏØä9ãvzõâµô¸>4.ÌÙÝZO%<ÂßÚ6çåÏLU¿Úþ@:7ý}?þ^¥áïùt¯úóÿ@ÚêòѲëÐÁFóz?Ä/×ÞþÏÑôû8îõÛÈÁ(£ 9bXjq8ª2â;ºÞå¤>oA0ñ6îɨYºiÈx)< K»ÞæD<o@©yÎí²S'WÊY-FUak®G▒2Äá¨î ÿ>úOüã¨îÈ´ÍéþWU8G2k£f2æjýañ½ã©Ú©=·ãòJ_ìïßô´ü ÿâ+Ù¨¬>°ÿ}ÆÏÍT-¼u,é{÷4È$&6õLÊ°®2&@▒2&£*3Á°í]Ìw®AâA|Í«¾1#ï۳鶽ÓÇò xþÁóÿ踿?ò"ÞØAÿô\u¬*~êR²ÝtÐ}+ÞGÇùû´ü­¿ø¨ÿ¼wàfÒßÆ0KgpÖ"¨b d8$g¡kÜkÄ?hõ>ÿzãÿiÒ£5Vj×ÈsºlöåÊNAQPÙÿÇ¿ýs_åEqÅmzoøú{W)qpVÚ7WR=öǽh|¾è
|▒õv<®Ô«ÙL/¤Ã
RÄçx£▒"Ä¡â8ÿº¾«s

m,ÙFÇÞ#-ÿP|Hð̾+ðUæmv¤M'{##ñ¯'øañ5|(­á¯,°ÚÇ¥d;­ØzíÎO¨$öéÕ
Ĩ÷cTD:×7@▒2@
|ô}ÝÓ2rå»BVn¿§Kªè³ÙÂȲI·úpÀÿJµg}i¨Ú¥ÍÌW8ÊÉSø±\¦§'uá{ɼ'i¥¬°ùðɽ'iûÝ?Úô®N¶k=6ÖÙØ3C¡#¡
Vh ¹±áëøLαæÅö
»rwgfßL~µÐË4PDÒÍ"G▒vÄ×<þ7Òf¸k]#ÎÖnàǧ®ê;îÅ©¨Ä4©Û
qTE"^sG▒2Äb!ñMïrò#I³FýÞNºÙŸU¯n»êÅt>»ä¶*ÂOÓ#
ÀQm-Pºï('Ü9Â1Z½ûtÝnæs'óÉd¥NÆ k¤&ô+øPC5Õ5ÿ
üHqÿ9j4ºÏoÖ¢åºÄY#}G,maÛ&'ÊÙ▒äàúíl={32¤º×ç 4dH#Å-iýÒ¸ÅmÈIuÖ£TW9R,â8
âôn¶▒2¬áQݲæ?©SÌ uPC5tÔÀHe¥éC}¦}¨XHØéTç8ýå8¦nPC>Õ¾9´¥á­ÉJn▒
øpTdzøþP7¥îrâ´ïtTÓ-uPC6RÀæ¿ÞFèÈì!Mi;Ã2G▒2äb!ùm®s²h1▒é.ú6²ÌÑk<ª-kþ

l¦ÉIs¦7½8}¨ÏóYI¨!C)Òvº©s² f¤_Î▒é[ÃÞ
ô;=ÒNä5y¤!C)ÈÞs\èR
k8ª-ëç\GÝÑé>'ÎÒUÇãÛñÍx>%XËråjÈ▒jcwH¥ÒÍoàõL£^-óÕ\þóy%àp#
fíHB0S`ÜÚMÖç\Ñ\ðzpÿ»oEØ£
¬gio$!ôÕ½¾qæyì½úöèõåïî·éïûNÛLG¾öwO'£³¿áé/L@nm|²M;Óýu?Äû·ªt5ÍÅTbÄ"§íu§Hͯ
µE sÖ.ÿ[\¶+EA½oéÌFÚ~ lQ´òõ_m\2Pí¿ðm<»Î±åàéÿ/F
endstream
endobj
7 0 obj
<</Type/Page/Contents 8 0 R/Parent 6 0
R/Group<</Type/Group/S/Transparency/CS/DeviceRGB>>/Resources<</ColorSpace<</CS/DeviceRGB>>/ProcSet
[/PDF /Text /ImageB /ImageC /ImageI]/Font<</F1 2 0 R/F2 4 0
R>>>>/MediaBox[0 0 612 792]>>
endobj
10 0 obj
<</Filter/FlateDecode/Length 1619>>stream
x½]O}÷¯G*¥Ë|ð¤¨6úPõÁÂ

¸26¥)ýõ5]#zÌxîLPâU¼ësîswÎάù{ôá|¤,sƲóéèãùè·d?wÿ+▒?Ý¿.Hv3:ü$[£Îÿêöíwáìâf_▒Á/Êz«ØÝÕHÆíaÒ{ö£ðì®]?¼{ÛÆÚGÉî"Pü./&«ÙrÑ!rvõ
êÆ×éõ(î×|ÏúmHh|Û¶S26öñôõ:ëô|¼o+*6Ú¨5yQºña£ß¯Û·µ9¤ó¶Ì▒Ó£¾8ìc"»íH¾
·ÃÎ96^MV-;ùöÀÌä;YÎçìd6³O§û¬¡$Ò6ñA
132b

_42Æî(óxöÏj²¸hÙövy·pÚë&èUJ~(¢
§0Â(c80ßÃ[ý.xÜ6x ·S\nHA;¹!F¹!b¦Ü¸ßmäMPñ{ð▒@©)▒À▒QÁ6
ý)(Þx
2UõpýnNÛÊÿgµ­ôñäaµ\LØvrqM'6"ÇHA!6Â(#6¬j#¶>2ô£»5)ñÎjBѬ -aQqÜñݪ8g%Hå¯] (Ä¡]Q▒a1¬*Ï[­ÎS (É/ØéíU¼Ïï§E´øÊ\Ö!F­qU½Ö¼ÙO vÆÇ&6f|¼zÇ~½»Y.¦Äã:¤ I´▒e1Ê(JïseßÑì2)Ûqíâå 1È«êå¦ÏòÚ¥;máY¼o§æºý½¿oKQP4kp£U½Ln¿(§5J5º0$Ab'ön×)ÑNK@¼®r¹Gb§X▒eO%>Â(#>¬êY|uHrÚÄ!¹eååâÒÈ
{ç®eJÓMÓq/jè8P]ÝF½aU½Þô·î§ä;@ «ê
*
18WçaÇ+çCÏÔiëkè8(I£7Â(£7¬ª×æ]Ù§
|¨Îê▒@#Y▒e«ê
r;Þ¤D:¥ÐÊ«52äÐ=J¡7Â(£7¬_Oï¯RR(åSeGß!FÀª6GbG­¶:^$e:çìbÇÏþ­µ(¥6b É
§¨2%ãIæíL,¥xÙ'±Â(ck­ç)N8q'jLÕCÊLÜA"ãªï³6{^ø¨'¹w'5,8Ä'±Â(c8´@îd½p)ÁN▒ìx¼UqS;QFp+ø7)QOhH¯1ÌC

VÛùFºU=©-$ýs´2¤<éA)ßëhbQW5P?w^º8'▒Ã;ä y£)G▒eGCÁé§è¥MIxR£ª$<ÈA1ÊXVi­×)N_è\¨"8â§X▒eU
«ÊÔ{GǤ ÇQq5ç0CòåQÆ°ªr×çBJ¨ó(ÓÀÎ_£¾å®DøJÜÃ!"JÃGʳ÷Ä­î¾2H/Q@|E2k
Hk▒HïöÞ°oñn˲§¿_zÞ§{<îs32Î<nÎGã­Oxý7§éMBw;\c¢ÓºÕRù#ïj|¾ú°\Õtù<¹jbËËL¬8ÖÊpÆÕ×»éäIËÎ&wÑúÜÁGªn=µ1îUnl2@íóÛlqâËÁæw´¯p
endstream
endobj
9 0 obj
<</Type/Page/Contents 10 0 R/Parent 6 0
R/Group<</Type/Group/S/Transparency/CS/DeviceRGB>>/Resources<</ColorSpace<</CS/DeviceRGB>>/ProcSet
[/PDF /Text /ImageB /ImageC /ImageI]/Font<</F1 2 0 R/F2 4 0
R>>>>/MediaBox[0 0 612 792]>>
endobj
12 0 obj
<</Filter/FlateDecode/Length 1615>>stream
x½]o▒GïùsJéz¾?|ç(I­_Qã_U/VfãPaê(ýõÅË
ñ0çËË{Î>ç̾3»ð÷èÕåÈxÑÑÇ¿ö_!óoÿ?$-.oF'oPùÞçÑ.ÿê_»}W7£|Ó(b¾1>z#×#7÷Nè▒ÅÏ*E7ú<|óþi§▒ïï´P¶ÈBù7oþâÝüª]Nç·½¢×¨þñg¾¬¢~F<FÆU@N?▒Ïêi▒Ðøk×MÈ¢ñ÷»'Ç£ñûvÏîvIufÊT ÇÛÄ´'¢O_ºçÂZoÒ×õÂ9·U}°ÙÉqøÝ«g{}0âU×^}ãå±ÑaOV'Z¨ü¸:ÍÆÙûgIîÊ&ü#Þ®+@Ç=ý¶lo¯:qÑ}/* #0¤á¡VǨB¿)*iðT̪²v:^ÉÞ>ŧÃÑé]·ø6tâõâ¥8Ïf?Äùt6#à búÑ6ÉîÉjM?▒[Ùë>ØÔ^Ô!Wí5ËÈ°¶Ñ°l¤8mè;Ý;o Þ²ÓGúV5>Òà¡+éï´º)±q^·ádgôMhk¤ÁÃ▒fµe­é;]:Ìvìô¡¾£ç}Õ¾ªítYâß\Vc¼lÝ µL¬¡¾$£:Ôa³Ú°ÎSkêNw±ÄÒ¹¼Ç1è#ýL¢Ó¡}Õ¾?Íû¿®Ó/ñoΧq
ÖH?OÕ,k¤ÁÃ▒fµa­}§ÛGç

rtûå©y¤ÁfµÈ0¿Óè¦Ä¾9c§AyH▒ið YÕ¡ÞÓçªÈÏIà<ôè#}«Iä }¤8 _»ønS{³ø
%^Îzà:XÜ¡²1$.jðpYÕqßéoWâÙ¬öByÄÙìªý·]¬N¦rÀFäC9Å©T¨Áu¢RÛº

P7¹-ñqV˱°¹=RÏ{b jð°Göþö;®KLè$ªLNìâæ9¢£
òDä4xìêïivYâåLÎã¼Í´Ïî:&òPÛZÉ9Ô!äme«âÜLN#É$¸Y#}ëHfçP5R°6ä]n|£39:e#;~@vt?ÒàÁ³Úâ×µ­îJük(å;lÕ4½4x#ÅJØ{zÝ:£©Ó^³ãGdü³7¨Á)ð«Ú^WEöM¢kãòá6
À8iðÀYÕÁƽ®S«Óøe3þOyn>mo¾ÍoÅ«ÙÝ©
üHq¿vNËC§2t:°ÏÝaÖøy¨ÁÂƽ®b·S®ÓùÀñS▒<øâÿ!Ë´Ã^W¡ÄÃ)<´ü½
ú\à°é×é+±uÊÿ4»«ú&Là }UýV7%Ni6¢´Ç8Ïc0ä *¨ÁõåM¿RÇ% ö8b Z▒<++Øñ©ÄÈEäãdÐý:*AfMaä
j$8
}Èz,îõXô1VdëR0üìQF}9ű?Æú,W§ÒAìø·èïyñÿßÅ/ôç×Ü\p÷wg£ñÎ;<þEgvíò¼rOÙ¸\j&o¬7)Ê>ÅÍøóBÔmÊ!&,ò¡½îóÏZÙ]étÆíòŤý!´ïÛE>Äi©jG$mú§
÷ªz]%ÕþÚ¦·×%e9¸ûm^`c
endstream
endobj
11 0 obj
<</Type/Page/Contents 12 0 R/Parent 6 0
R/Group<</Type/Group/S/Transparency/CS/DeviceRGB>>/Resources<</ColorSpace<</CS/DeviceRGB>>/ProcSet
[/PDF /Text /ImageB /ImageC /ImageI]/Font<</F1 2 0 R/F2 4 0
R>>>>/MediaBox[0 0 612 792]>>
endobj
13 0 obj
[1 0 R/XYZ 0 804 0]
endobj
14 0 obj
[7 0 R/XYZ 0 804 0]
endobj
15 0 obj
[9 0 R/XYZ 0 804 0]
endobj
16 0 obj
[11 0 R/XYZ 0 804 0]
endobj
2 0 obj
<</Type/Font/BaseFont/Helvetica/Subtype/Type1/Encoding/WinAnsiEncoding>>
endobj
4 0 obj
<</Type/Font/BaseFont/Helvetica-Bold/Subtype/Type1/Encoding/WinAnsiEncoding>>
endobj
6 0 obj
<</Count 4/Type/Pages/ITXT(2.1.7)/Kids[1 0 R 7 0 R 9 0 R 11 0 R]>>
endobj
17 0 obj
<</Names[(JR_PAGE_ANCHOR_0_1) 13 0 R(JR_PAGE_ANCHOR_0_2) 14 0
R(JR_PAGE_ANCHOR_0_3) 15 0 R(JR_PAGE_ANCHOR_0_4) 16 0 R]>>
endobj
18 0 obj
<</Dests 17 0 R>>
endobj
19 0 obj
<</Type/Catalog/ViewerPreferences<</PrintScaling/AppDefault>>/Pages 6 0
R/Names 18 0 R>>
endobj
20 0 obj
<</CreationDate(D:20110326144202Z)/Producer(iText 2.1.7 by
1T3XT)/Creator(JasperReports (report1))/ModDate(D:20110326144202Z)>>
endobj
xref
0 21
0000000000 65535 f
0000005484 00000 n
0000011710 00000 n
0000000015 00000 n
0000011798 00000 n
0000003878 00000 n
0000011891 00000 n
0000007461 00000 n
0000005750 00000 n
0000009392 00000 n
0000007704 00000 n
0000011320 00000 n
0000009636 00000 n
0000011565 00000 n
0000011601 00000 n
0000011637 00000 n
0000011673 00000 n
0000011973 00000 n
0000012110 00000 n
0000012144 00000 n
0000012249 00000 n
trailer
<</ID
[<18a9ced03ccee0be44f77a04b5bad32c>]/Root
19 0 R/Size 21/Info 20 0 R>>
startxref
12395
%%EOF

2d

------=_Part_167_24156315.1301150522545--

0

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@troelskn
Copy link
Contributor

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.

@troelskn
Copy link
Contributor

The server is jasper server and I have gotten pdfs with
SOAP::RPC::DRIVER, can I change the http driver for just this class or
possible just the method to get pdfs instead of globally? I have 2 other
classes that are working properly using handsoap w/ curb.

You can override http_driver_instance in your service class

@troelskn
Copy link
Contributor

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?

@rossi-jeff
Copy link
Author

On 03/26/2011 11:09 AM, troelskn wrote:

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?

I added

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
-0400 2011

Parameters during error request {"start_date"=>"2011-03-19",
"format"=>"PDF", "max_speed"=>"30", "action"=>"single",
"group_id"=>["5", "default"], "device_id"=>"51", "report_id"=>"12",
"time_zone"=>"Central Time (US & Canada)", "controller"=>"pdf",
"end_date"=>"2011-03-26"}
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:70:in
parse_multipart' /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:25:in parse_http_part'
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/curb_driver.rb:64:in
send_http_request' /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/service.rb:249:ininvoke'
/home/jeff/svn/intouchmvc/trunk/app/models/management_service_service.rb:151:in
`run_report'

Line 151 is the invoke line from my earlier post

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@rossi-jeff
Copy link
Author

On 03/26/2011 11:09 AM, troelskn wrote:

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?

Isn't the chunked part what I want?

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@rossi-jeff
Copy link
Author

On 03/26/2011 11:09 AM, troelskn wrote:

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?

overwriting driver actually took

def http_driver_instance
Handsoap::Http.drivers[:net_http].new
end

But still no joy

/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:70:in
parse_multipart' /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:25:in parse_http_part'
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/net_http_driver.rb:71:in
send_http_request' /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/service.rb:249:ininvoke'
/home/jeff/svn/intouchmvc/trunk/app/models/management_service_service.rb:155:in
`run_report'

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@troelskn
Copy link
Contributor

Isn't the chunked part what I want?

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 /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb and dump the contents of status to see if that makes us any the wiser. Something is clearly going wrong with the parsing around that line.

@rossi-jeff
Copy link
Author

On 03/26/2011 06:34 PM, troelskn wrote:

Isn't the chunked part what I want?

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 if 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 /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb and dump the contents of status to see if that makes us any the wiser. Something is clearly going wrong with the parsing around that line.

I added a couple lines to write status into a log file, contents are
status and status.inspect

Logfile created on Sun Mar 27 08:33:14 -0400 2011 by logger.rb/22285

------=_Part_193_22897301.1301229203159
"\r\n------=_Part_193_22897301.1301229203159"

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@rossi-jeff
Copy link
Author

On 03/26/2011 06:34 PM, troelskn wrote:

Isn't the chunked part what I want?

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 if 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 /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb and dump the contents of status to see if that makes us any the wiser. Something is clearly going wrong with the parsing around that line.

Do any of the http drivers have a method to return the raw response?

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@troelskn
Copy link
Contributor

------=_Part_193_22897301.1301229203159
"\r\n------=_Part_193_22897301.1301229203159"

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 67..71 with the following chunk and see if it works?

if nil == status
  raise EOFError, "no content body"
elsif "\r\n" + boundary != status
  extra = content_io.read("\r\n".size)
  unless extra == "\r\n"
    EOFError, "parse error while reading boundary"
  end
elsif boundary + "\r\n" != status
  raise EOFError, "bad content body"
end

@rossi-jeff
Copy link
Author

On 03/27/2011 10:15 AM, troelskn wrote:

------=_Part_193_22897301.1301229203159
"\r\n------=_Part_193_22897301.1301229203159"

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 67..71 with the following chunk and see if it works?

 if nil == status
   raise EOFError, "no content body"
 elsif "\r\n" + boundary != status
   extra = content_io.read("\r\n".size)
   unless extra == "\r\n"
     EOFError, "parse error while reading boundary"
   end
 elsif boundary + "\r\n" != status
   raise EOFError, "bad content body"
 end

had to add a raise on the 6th line of your code, but got same error

/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:77:in
parse_multipart' /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/abstract_driver.rb:25:in parse_http_part'
/usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/http/drivers/net_http_driver.rb:71:in
send_http_request' /usr/lib/ruby/gems/1.8/gems/handsoap-1.1.8/lib/handsoap/service.rb:249:ininvoke'
/home/jeff/svn/intouchmvc/trunk/app/models/management_service_service.rb:155:in
`run_report'

155 is still invoke line, line #s changed due to http_driver_instance block

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@troelskn
Copy link
Contributor

My bad. I meant:

if nil == status
  raise EOFError, "no content body"
elsif "\r\n" + boundary == status
  extra = content_io.read("\r\n".size)
  unless extra == "\r\n"
    raise EOFError, "parse error while reading boundary"
  end
elsif boundary + "\r\n" != status
  raise EOFError, "bad content body"
end

@rossi-jeff
Copy link
Author

On 03/27/2011 05:11 PM, troelskn wrote:

My bad. I meant:

 if nil == status
   raise EOFError, "no content body"
 elsif "\r\n" + boundary == status
   extra = content_io.read("\r\n".size)
   unless extra == "\r\n"
     EOFError, "parse error while reading boundary"
   end
 elsif boundary + "\r\n" != status
   raise EOFError, "bad content body"
 end

Making progress now have different error

Fatal Error undefined method `size' for
#Handsoap::Http::Part:0xb5e7641c in Report download at Sun Mar 27
21:11:41 -0400 2011

Parameters during error request {"start_date"=>"2011-03-20",
"format"=>"PDF", "max_speed"=>"30", "action"=>"single",
"group_id"=>["5", "default"], "device_id"=>"51", "report_id"=>"11",
"time_zone"=>"Central Time (US & Canada)", "controller"=>"pdf",
"end_date"=>"2011-03-27"}
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/streaming.rb:140:in
send_data' /home/jeff/svn/intouchmvc/trunk/app/controllers/pdf_controller.rb:357:in single'

I had inspected the reponse and it was 2 parts, 1st xml, 2nd pdf so I
changed my service class to

return response.http_response.parts[1]

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@rossi-jeff
Copy link
Author

On 03/27/2011 05:11 PM, troelskn wrote:

My bad. I meant:

 if nil == status
   raise EOFError, "no content body"
 elsif "\r\n" + boundary == status
   extra = content_io.read("\r\n".size)
   unless extra == "\r\n"
     EOFError, "parse error while reading boundary"
   end
 elsif boundary + "\r\n" != status
   raise EOFError, "bad content body"
 end

I got a pdf by changing the return in my service class to

return response.http_response.parts[1].body()

The patch as it is in my abstract driver is

       if nil == status
         raise EOFError, "no content body"
       elsif "\r\n" + boundary == status
         extra = content_io.read("\r\n".size)
         unless extra == "\r\n"
           raise EOFError, "parse error while reading boundary"
         end
       elsif boundary + "\r\n" != status
         raise EOFError, "bad content body"
       end

Thanks

Jeff Rossi
Application Developer | InTouch MVC
Office: 800-881-6343 | Cell: 863-669-6488 | Fax: 863-687-0077
5101 Great Oak Dr. Lakeland, Fl 33815


http://www.intouchmvc.com
Asset Monitoring Solutions

@rossi-jeff
Copy link
Author

Did this patch ever find it's way into the main codebase?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants