"MyBillingCode");
RequestStatus requestStatus = waitForTerminalStatus(port, requestId);
System.out.println("Operation completed with status: " + requestStatus.getEnumValue());
} catch (Exception e) { System.out.println("Operation failed with exception: " +
e.getMessage());
}
System.out.println("Invoking deactivateService..."); try {
String requestId = port.deactivateService(infServiceName);
RequestStatus requestStatus = waitForTerminalStatus(port, requestId);
System.out.println("Operation completed with status: " + requestStatus.getEnumValue());
} catch (Exception e) { System.out.println("Operation failed with exception: " +
e.getMessage());
}
System.out.println("Invoking activateService..."); try {
String requestId = port.activateService(infServiceName,null);
RequestStatus requestStatus = waitForTerminalStatus(port, requestId);
System.out.println("Operation completed with status: " + requestStatus.getEnumValue());
} catch (Exception e) { System.out.println("Operation failed with exception: " +
e.getMessage());
}
System.exit(0);
}
/**
*Initializes the security settings for the web service client.
*/
private static void setupConnection(IO port) {
final String USER_NAME = "MyUserName"; final String PASSWORD = "MySecretPassword"; Client proxy = ClientProxy.getClient(port);
//Configure
Map<String, Object> outProps = new HashMap<String, Object>(); outProps.put(WSHandlerConstants.ACTION,
WSHandlerConstants.USERNAME_TOKEN + " " + WSHandlerConstants.TIMESTAMP);
outProps.put(WSHandlerConstants.USER, USER_NAME); outProps.put(WSHandlerConstants.PASSWORD_TYPE,
WSConstants.PW_TEXT); IOClientPasswordHandler.setPassword(PASSWORD); outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,
IOClientPasswordHandler.class.getName()); outProps.put(WSHandlerConstants.TTL_TIMESTAMP, "1800"); outProps.put(WSHandlerConstants.TIMESTAMP_PRECISION, "false");
WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); cxfEndpoint.getOutInterceptors().add(wssOut);
// Configure TLS client parameters
HTTPConduit conduit = (HTTPConduit) proxy.getConduit(); TLSClientParameters tcp = new TLSClientParameters(); tcp.setTrustManagers(
new TrustManager[] { new TrustAllX509TrustManager() });