2013-04-18 2 views
0

하나의 REST 클라이언트에서 다른 GET/POST로 기본 GET/POST를 시도하고 있습니다. 나는 데이터를 얻고 맵핑하는 중이지만, POST http oubound 엔드 포인트 동안 타임 아웃한다. Fiddler Web Debugger를 사용할 때, Content-Length 문제가 있음을 알게되었습니다. "Content-Length mismatch : RequestHeader가 403 바이트를 표시했지만 클라이언트가 61 바이트를 보냈습니다."라는 오류가 나타납니다. A는 수동으로 다음 구문을 사용하여 콘텐츠 길이를 설정하면Mule 아웃 바운드 http 엔드 포인트 내용 길이 불일치

, 그것은 오류없이 작동 : 콘텐츠 길이가 잘못 왜 이해가 안

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

. 저는 61로 하드 코딩 할 수 없습니다. 왜냐하면 제가 옮길 레코드가 항상 다른 길이가 될 것이기 때문입니다.

모든 아이디어는 크게 감사하겠습니다.

브렛

참고 :

<http:endpoint exchange-pattern="request-response" host="slcomax.ameipro.com" port="80" path="maxrest/rest/mbo/worktype/115?_lid=mxintadm&amp;_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> 
+0

당신은 흐름을 더 보여줄 수 : 아래 그림과 같이

이 솔루션은 대신 석영의 HTTP 폴링 커넥터를 사용하는 것입니다? HTTP 아웃 바운드 종점이 문제를 일으키기 전에 발생하는 것으로 보입니다. 또한 : 뮬 버전? –

+0

David, 방금 원래 게시물에 추가했습니다. –

+0

감사합니다. 레코드'echo-component'는 오래된 지원이므로 더 이상 사용하면 안됩니다. 'logger '사용을 선호하십시오. –

답변

0

문제는 엔드 포인트 폴링과 석영 인바운드 엔드 포인트 거래 방식 때문이다 : 그것은 모든 속성이 엔드 포인트의 상호 작용에서 수신합니다 여기에 전체 흐름은 범위의 아웃 바운드 위치에 배치합니다.이 범위는 다운 스트림을 완전히 망칩니다. IMO 버그 : 인바운드 범위에 속성을 배치해야합니다. 따라서 ... 이러한 모든 특성은 아웃 바운드 범위에 있기 때문에

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=/ 

에서, http:outbound-endpoint 그들을 집어 들고 그들을 사용 기록을 위해

, 이것은 석영 폴러는 아웃 바운드 범위에두고 무엇인가 콘텐츠 길이가 잘못되었습니다 (아무 이유없이 보내는 다른 미친 헤더는 말할 것도 없습니다).

<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&amp;_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> 
+0

입니다. David, 충분히 감사 할 수는 없지만 ... 이미 알고 있었지만 매력처럼 작동합니다. –

+0

매우 기쁘게 생각합니다. –

관련 문제