2016-03-17 65 views

回答

3
@Bean 
public IntegrationFlow httpOut() { 
    return IntegrationFlows.from("inputChannel") 
      .handle(Http.outboundGateway("http://localhost:8080/") 
        .charset("UTF-8") 
        .httpMethod(HttpMethod.POST) 
        .headerMapper(soapHeaderMapper()) 
        .requestFactory(requestFactory()), e -> e.id("test")) 
      .get(); 
} 

或者

@ServiceActivator(inputChannel="inputChannel") 
@Bean(name="test") 
public MessageHandler httpout() { 
    HttpRequestExecutingMessageHandler handler = new ... 
    ... 
    return handler; 
} 
相關問題