Search in sources :

Example 1 with ObjectServiceFactory

use of org.codehaus.xfire.service.binding.ObjectServiceFactory 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;
}
Also used : ProtocolSocketFactory(org.apache.commons.httpclient.protocol.ProtocolSocketFactory) EasySSLProtocolSocketFactory(org.codehaus.xfire.transport.http.EasySSLProtocolSocketFactory) ObjectServiceFactory(org.codehaus.xfire.service.binding.ObjectServiceFactory) DOMOutHandler(org.codehaus.xfire.util.dom.DOMOutHandler) Service(org.codehaus.xfire.service.Service) Protocol(org.apache.commons.httpclient.protocol.Protocol) Client(org.codehaus.xfire.client.Client) XFireProxy(org.codehaus.xfire.client.XFireProxy) XFireProxyFactory(org.codehaus.xfire.client.XFireProxyFactory) EasySSLProtocolSocketFactory(org.codehaus.xfire.transport.http.EasySSLProtocolSocketFactory)

Example 2 with ObjectServiceFactory

use of org.codehaus.xfire.service.binding.ObjectServiceFactory 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;
}
Also used : ProtocolSocketFactory(org.apache.commons.httpclient.protocol.ProtocolSocketFactory) EasySSLProtocolSocketFactory(org.codehaus.xfire.transport.http.EasySSLProtocolSocketFactory) ObjectServiceFactory(org.codehaus.xfire.service.binding.ObjectServiceFactory) DOMOutHandler(org.codehaus.xfire.util.dom.DOMOutHandler) Service(org.codehaus.xfire.service.Service) Protocol(org.apache.commons.httpclient.protocol.Protocol) Client(org.codehaus.xfire.client.Client) XFireProxy(org.codehaus.xfire.client.XFireProxy) XFireProxyFactory(org.codehaus.xfire.client.XFireProxyFactory) EasySSLProtocolSocketFactory(org.codehaus.xfire.transport.http.EasySSLProtocolSocketFactory)

Aggregations

Protocol (org.apache.commons.httpclient.protocol.Protocol)2 ProtocolSocketFactory (org.apache.commons.httpclient.protocol.ProtocolSocketFactory)2 Client (org.codehaus.xfire.client.Client)2 XFireProxy (org.codehaus.xfire.client.XFireProxy)2 XFireProxyFactory (org.codehaus.xfire.client.XFireProxyFactory)2 Service (org.codehaus.xfire.service.Service)2 ObjectServiceFactory (org.codehaus.xfire.service.binding.ObjectServiceFactory)2 EasySSLProtocolSocketFactory (org.codehaus.xfire.transport.http.EasySSLProtocolSocketFactory)2 DOMOutHandler (org.codehaus.xfire.util.dom.DOMOutHandler)2