endpoint - Mule outbound http end point Content-Length mismatch -
i trying basic get/post 1 rest client another. i'm getting , mapping data fine, times out during post http oubound endpoint. in using fiddler web debugger, found out problem lies content-length. error "content-length mismatch: requestheader indicated 403 bytes, client sent 61 bytes."
if manually set content-length using following syntax, works without errors:
<message-properties-transformer scope="outbound> <add-message-property key="content-type" value="application/json"/> <add-message-property key="content-length" value="61"/> </message-properties-transformer> i don't understand why content-length incorrect. can't hard-code 61, because records i'm transferring going have different length.
any ideas appreciated.
brett
note: here full flow:
<http:endpoint exchange-pattern="request-response" host="slcomax.ameipro.com" port="80" path="maxrest/rest/mbo/worktype/115?_lid=mxintadm&_lpwd=mxintadm" method="get" name="http" doc:name="http"/> <data-mapper:config name="maxtondtypes" transformationgraphpath="maxtondtypes.grf" doc:name="maxtondtypes"/> <flow name="ruby_rest_testerflow1" doc:name="ruby_rest_testerflow1"> <quartz:inbound-endpoint jobname="gettypes" repeatinterval="600000" responsetimeout="10000" doc:name="quartz"> <quartz:endpoint-polling-job> <quartz:job-endpoint ref="http"/> </quartz:endpoint-polling-job> </quartz:inbound-endpoint> <echo-component doc:name="echo"/> <data-mapper:transform config-ref="maxtondtypes" doc:name="datamapper"/> <echo-component doc:name="echo"/> <http:outbound-endpoint exchange-pattern="request-response" host="ndeavor.ameipro.com" port="80" path="types" doc:name="http" contenttype="application/json"> <message-properties-transformer scope="outbound"> <add-message-property key="content-type" value="application/json"/> <!-- <add-message-property key="content-length" value="61"/> --> </message-properties-transformer> </http:outbound-endpoint> <echo-component doc:name="echo"/> </flow>
the problem due way quartz inbound endpoint deals endpoint polling: takes properties received endpoint interaction , places them in outbound scope totally messes what's downstream. bug imo: properties should placed in inbound scope.
for record, quartz poller puts in outbound scope:
cache-control=no-cache content-language=en-us content-length=360 content-type=application/json date=thu, 18 apr 2013 18:00:12 gmt expires=thu, 01 dec 1994 16:00:00 gmt mule_encoding=utf-8 server=ibm_http_server set-cookie=jsessionid=0000trnjz71m3rlx-ndbwfc-quo:-1; path=/ because these properties in outbound scope, http:outbound-endpoint picks them , uses them... hence faulty content-length (not mention other crazy headers sends no reason).
the solution use http polling connector instead of quartz, shown below:
<http:connector name="httpconnector" /> <http:polling-connector name="httppollingconnector" pollingfrequency="600000" /> <http:endpoint name="worktypepoller" exchange-pattern="request-response" host="slcomax.ameipro.com" port="80" path="maxrest/rest/mbo/worktype/115?_lid=mxintadm&_lpwd=mxintadm" method="get" connector-ref="httppollingconnector" /> <flow name="ruby_rest_testerflow1"> <http:inbound-endpoint ref="worktypepoller" /> <data-mapper:transform config-ref="maxtondtypes" /> <http:outbound-endpoint exchange-pattern="request-response" host="ndeavor.ameipro.com" port="80" path="types" connector-ref="httpconnector"> <set-property propertyname="content-type" value="application/json" /> </http:outbound-endpoint> </flow>
Comments
Post a Comment