Hello,
I am new on Spring Integration and I have a question which I can't find answer.
I have created a small project to learn how SI works (from Spring sample), I am using a WSDL which define a "calculator" web service (it have a method which add two numbers).
This is my config file:
And my code:Code:<chain input-channel="addInputChannel" output-channel="addOutputChannel"> <ws:header-enricher> <ws:soap-action value="http://www.example.org/calculatrice/add"/> </ws:header-enricher> <ws:outbound-gateway uri="http://localhost:8088/mockcalculatriceSOAP"/> </chain> <!-- The response from the service is logged to the console. --> <stream:stdout-channel-adapter id="addOutputChannel"/>
It works but now, I want using jaxb (I don't want to deal directly with xml) and I don't understand how I will configure Spring to do that, even after googling and reading some tutorialsCode:ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("springWsAccess-Config.xml"); ChannelResolver channelResolver = new BeanFactoryChannelResolver(context); String requestXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n" + "<ns2:add xmlns:ns2=\"http://www.example.org/calculatrice/\">\r\n" + " <number1>10.0</number1>\r\n" + " <number2>21.0</number2>\r\n" + "</ns2:add>"; Message<String> message = MessageBuilder.withPayload(requestXml).build(); // Send the Message to the handler's input channel MessageChannel channel = channelResolver.resolveChannelName("addInputChannel"); channel.send(message);
I think that I must generate the jaxb client code with wsimport, but how it will be integrated in Spring SI?



Reply With Quote