Hello I have a request.xml file with the following contents:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://localhost:8080/webservices"> <soapenv:Header/> <soapenv:Body> <web:deviceRequest> <!--Optional:--> <devices> <device id="1" value="123" date="2002-05-30T09:00:00"/> <device id="2" value="123" date="2004-05-30T09:00:00"/> <device id="3" value="123" date="2006-05-30T09:00:00"/> <device id="4" value="123" date="2008-05-30T09:00:00"/> <device id="5" value="123" date="2010-05-30T09:00:00"/> </devices> </web:deviceRequest> </soapenv:Body> </soapenv:Envelope> I need to send a request to the web service. Everything works for me if I send a request in normal Java .
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance(); SOAPConnection soapConnection = soapConnectionFactory.createConnection(); String url = "http://localhost:8080/ws"; SOAPMessage soapResponse = soapConnection.call( /* содержимое файлика request.xml сконвертированное в SOAPMessage */ request , url); System.out.print("Response SOAP Message:"); soapResponse.writeTo(System.out); soapConnection.close(); The above code works
But I need to send content via apache camel, I do so.
CamelContext camelContext = new DefaultCamelContext(); camelContext.addRoutes(new RouteBuilder() { @Override public void configure() { // uploadfolder - папка где лежит request.xml from("file:uploadfolder").to("spring-ws:http://localhost:8080/ws"); } }); camelContext.start(); Here is Pom.xml
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>2.18.1</version> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring-ws</artifactId> <version>2.18.1</version> </dependency> When sending via camel, nothing works and a message is written:
[http-nio-8080-exec-3] WARN osws.server.EndpointNotFound - No endpoint mapping found for [SaajSoapMessage {http://schemas.xmlsoap.org/soap/envelope/}Envelope] org.springframework.ws.client.WebServiceTransportException: [404] Help understand what he wants. After all, if on normal Java everything is normally sent, then the problem is not in the web service?