0
我試圖通過Spring集成調用REST Web服務,即Spring集成將充當我的客戶端到REST Web服務。但是,我應該將參數添加到ws url並添加json對象作爲參數。 爲此,我嘗試了以下配置:春季集成:如何用http出站網關發佈請求參數
<int:enricher input-channel="inputChannel" request-channel="quakeinfotrigger.channel">
<int:property name="info" expression="payload"/>
</int:enricher>
<int-http:outbound-gateway id="quakerHttpGateway"
request-channel="quakeinfotrigger.channel"
url="http://ffff.ff/gg/rest/put/{tel_number}"
http-method="PUT"
expected-response-type="java.lang.String"
charset="UTF-8"
reply-timeout="5000"
reply-channel="quakeinfo.channel">
<int-http:uri-variable name="tel_number" expression="payload.getNumTelefono()"/>
</int-http:outbound-gateway>
tel_number不作爲PARAM過去了,能否請您給我一個解決方案來傳遞PARAM通過URL字符串和JSON對象。
如何傳遞{tel_num}?這是一個動態變量。我應該以編程方式通過它。端點不是網關,而是入站通道適配器 – NAZEHA
啓動流程的內容並不重要;正如我在asnwer中所說的,你可以使用' '來設置'content-type'頭。你的表情應該工作(如果它是有效的),我只是用了一個文字表達式。我需要知道你的意思是「沒有通過」。 –
它確實意味着:如何填充URI變量{tel_number},我將它發送到頭部? – NAZEHA