gtata007 commented on issue #3973:
URL: https://github.com/apache/camel-k/issues/3973#issuecomment-1404534935

   Hi @squakez ,
   I found another way of doing this SOAP invocation. I directly invoked the 
HTTP Methods. Below is the piece of code it worked for me and it is returning 
the response.
   
   **TestWeb.java**
   
   // camel-k: language=java
   
   
   import org.apache.camel.builder.RouteBuilder;
   import org.apache.camel.Processor;
   import org.apache.camel.Exchange;
   
   import org.apache.camel.Message;
   // import org.apache.camel.component.cxf.common.message.CxfConstants;
   
   public class TestWeb extends RouteBuilder {
     @Override
     public void configure() throws Exception {
   
         from("timer:java?period=100000")
           .routeId("java")
           .setHeader("SOAPAction", constant("CountryCurrency")) // SOAPAction 
to invoke the method.
           .setHeader(Exchange.HTTP_METHOD, constant("POST")) // HTTP Method
           .setHeader(Exchange.CONTENT_TYPE, constant("text/xml")) // Content 
Type
           .setBody()
           .simple("<soapenv:Envelope 
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"; 
xmlns:web=\"http://www.oorsprong.org/websamples.countryinfo\";> 
<soapenv:Header/><soapenv:Body><web:CountryCurrency><web:sCountryISOCode>IN</web:sCountryISOCode></web:CountryCurrency>
 </soapenv:Body></soapenv:Envelope>")
   
   
           
.to("http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso";)
           .log("response: ${body}");
     }
   }
   
   Regards,
   Guru


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to