Invoke Web Services

Technologies > Software Engineering Techniques > Software Engineer Views > Invoke the "Echo" Web Service

This example view invokes the Apache "Echo" web service:

var result = Workflow.callMethod('AbSolutionsViewExamples-WSClientExamples-echo', 'http://www.mssoapinterop.org/asmx/simple.asmx', 'Hello World!');
View.showMessage(result.message);

The workflow rule creates an Axis Call object to invoke the web service:

// url = 'http://www.mssoapinterop.org/asmx/simple.asmx'
// input = 'Hello World!'

Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(url));
...
String output = (String) call.invoke(new Object[] { input });

View: http://localhost:8080/archibus/schema/ab-products/solutions/programming/echo/ab-ex-echo.axvw