Configuring the components
Procedure
-
Double-click cMessagingEndpoint to open
its Basic settings view in the Component tab.
- In the URI field, enter timer:go?repeatCount=1 to define a timer for starting message exchanges. In this example, only one message exchange will be carried out due to the setting of repeatCount=1.
-
Double-click cSetBody to open its
Basic settings view in the Component tab.
- In the Language field, select Constant.
-
In the Expression field, enter the
following as the body of the request message:
<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:weat=\"http://ws.cdyne.com /WeatherWS/\"><soapenv:Header/><soapenv:Body><weat:GetWeatherDefinitionInformation/></soapenv:Body></soapenv:Envelope>
-
Double-click cHttp to open
its Basic settings view in the Component tab.
- In the Uri field, enter the location of the file to fetch, http://wsf.cdyne.com/WeatherWS/Weather.asmx in this example.
- Click the Client radio button to use this cHttp component as a client.
- Select POST in the Method list and then the Use Message Body radio button. Select text/xml in the Content-Type list.
-
Click Advanced settings for further setup.
-
Click the [+] button to add a line in the
Headers table.
Type in SOAPAction and http://ws.cdyne.com/WeatherWS/GetWeatherInformation for the Key and Value fields.
-
Double-click cProcessor to open its
Basic settings view in the Component tab.
-
In the Code area, enter the following to print the
response from the remote website, the body of the desired file:
System.out.println("--------------------RESPONSE--------------------"); System.out.println(exchange.getIn().getBody(String.class)); System.out.println("--------------------END--------------------");
- Press Ctrl+S to save your Route.
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!