private Client createClient() throws BusException, EndpointException {
    Client client = clientFactory.create();

    final Service service = client.getEndpoint().getService();
    service.setDataBinding(new SourceDataBinding());

    final ServiceInfo si = service.getServiceInfos().get(0);
    ServiceHelper.addOperation(si, operationName, isRequestResponse);

    return client;
  }
 private Object sendDocument(org.dom4j.Document doc) throws Exception {
   Client client = createClient();
   try {
     Object[] result = client.invoke(operationName, DOM4JMarshaller.documentToSource(doc));
     if (result != null) {
       return DOM4JMarshaller.sourceToDocument((Source) result[0]);
     }
   } catch (org.apache.cxf.binding.soap.SoapFault e) {
     SOAPFault soapFault = ServiceHelper.createSoapFault(e);
     if (soapFault == null) {
       throw new WebServiceException(e);
     }
     SOAPFaultException exception = new SOAPFaultException(soapFault);
     if (e instanceof Fault && e.getCause() != null) {
       exception.initCause(e.getCause());
     } else {
       exception.initCause(e);
     }
     throw exception;
   } finally {
     client.destroy();
   }
   return null;
 }