ping.setTicket(ticket);
PingDocument pingDoc = PingDocument.Factory.newInstance();
pingDoc.setPing(ping);
PingPortStub stub = new PingPortStub(clientRepo,url);
//Enable MTOM to those scenarios where they are configured using:
//<optimizeParts>xpathExpression</optimizeParts>
stub._getClientOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
//Engage the security module
stub.engageModule("security");
if(outflowConfig !=null){
stub._getClientOptions().setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, outflowConfig.getProperty());
}
if(inflowConfig != null) {
stub._getClientOptions().setProperty(WSSHandlerConstants.INFLOW_SECURITY, inflowConfig.getProperty());
}
PingResponseDocument pingResDoc = stub.Ping(pingDoc);
PingResponse pingRes = pingResDoc.getPingResponse();
System.out.println(pingRes.getText());
}