use of org.codehaus.xfire.transport.http.EasySSLProtocolSocketFactory in project translationstudio8 by heartsome.
the class ServiceUtilTest method getService.
public static IService getService() throws MalformedURLException {
// Service srvcModel = new
// ObjectServiceFactory().create(IService.class);
// XFireProxyFactory factory = new XFireProxyFactory(XFireFactory
// .newInstance().getXFire());
//
// IService srvc = (IService) factory.create(srvcModel,
// Constants.CONNECT_URL);
// return srvc;
ProtocolSocketFactory easy = new EasySSLProtocolSocketFactory();
Protocol protocol = new Protocol(HTTP_TYPE, easy, PORT);
Protocol.registerProtocol(HTTP_TYPE, protocol);
Service serviceModel = new ObjectServiceFactory().create(IService.class, SERVICE_NAME, SERVICE_NAMESPACE, null);
IService service = (IService) new XFireProxyFactory().create(serviceModel, SERVICE_URL);
Client client = ((XFireProxy) Proxy.getInvocationHandler(service)).getClient();
client.addOutHandler(new DOMOutHandler());
client.setProperty(CommonsHttpMessageSender.GZIP_ENABLED, Boolean.FALSE);
client.setProperty(CommonsHttpMessageSender.DISABLE_EXPECT_CONTINUE, "1");
client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, "0");
return service;
}
use of org.codehaus.xfire.transport.http.EasySSLProtocolSocketFactory in project translationstudio8 by heartsome.
the class ServiceUtil method getService.
public static IService getService() throws MalformedURLException {
// Service srvcModel = new ObjectServiceFactory().create(IService.class);
// XFireProxyFactory factory = new XFireProxyFactory(XFireFactory
// .newInstance().getXFire());
//
// IService srvc = (IService) factory.create(srvcModel, Constants.CONNECT_URL);
// return srvc;
ProtocolSocketFactory easy = new EasySSLProtocolSocketFactory();
Protocol protocol = new Protocol(HTTP_TYPE, easy, PORT);
Protocol.registerProtocol(HTTP_TYPE, protocol);
Service serviceModel = new ObjectServiceFactory().create(IService.class, SERVICE_NAME, SERVICE_NAMESPACE, null);
IService service = (IService) new XFireProxyFactory().create(serviceModel, SERVICE_URL);
Client client = ((XFireProxy) Proxy.getInvocationHandler(service)).getClient();
client.addOutHandler(new DOMOutHandler());
client.setProperty(CommonsHttpMessageSender.GZIP_ENABLED, Boolean.FALSE);
client.setProperty(CommonsHttpMessageSender.DISABLE_EXPECT_CONTINUE, "1");
client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, "0");
return service;
}
Aggregations