Write a Cúram Outbound Service

Follow the Cúram Server Modelling Guide chapter on outbound web services.

Note: In brief, you must:

The chapter also outlines how to call this client from within your regular code, but this may be a more useful example:

/**
 * This method tests WID's exposed Evidence export
 */
public void testCreateEvidenceViaWID() 
  throws AppException, InformationalException,
  ParserConfigurationException, SAXException, IOException {

  boolean success = false;

  // The service locator gets instances of the web service.
  final 
    WIDExport_WIDServiceHttpServiceLocator 
    serviceLocator =
    new WIDExport_WIDServiceHttpServiceLocator();

  try {

    // get an instance of client stub 
    // by casting from interface:
    final WIDExport_WIDServiceHttpBindingStub 
      myService =
      (WIDExport_WIDServiceHttpBindingStub) 
        serviceLocator
        .getWIDExport_WIDServiceHttpPort();

    // getRequestObject builds up the request using 
    // Axis generated classes to represent the wsdl types
    final ResponseType response = 
      myService.operation1(getRequestObject());

    // this evaluation of success is specific to the
    // structure of this particular service
    success = 
      response.getResponse().getEvidenceCreate().isSuccess();

  } catch (javax.xml.rpc.ServiceException se) {
    System.out.println(se.getLocalizedMessage());
    System.out.println(se.fillInStackTrace());
  }

  assertTrue(success); 

}