gpt4 book ai didi

org.codehaus.xfire.client.XFireProxyFactory.create()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 09:01:05 25 4
gpt4 key购买 nike

本文整理了Java中org.codehaus.xfire.client.XFireProxyFactory.create()方法的一些代码示例,展示了XFireProxyFactory.create()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XFireProxyFactory.create()方法的具体详情如下:
包路径:org.codehaus.xfire.client.XFireProxyFactory
类名称:XFireProxyFactory
方法名:create

XFireProxyFactory.create介绍

[英]Creates a new proxy with the specified URL. The returned object is a proxy with the interface specified by the given service interface.

String url = "http://localhost:8080/services/Echo"); 
Echo echo = (Echo) factory.create(myService, url);

[中]使用指定的URL创建新代理。返回的对象是具有给定服务接口指定的接口的代理

String url = "http://localhost:8080/services/Echo"); 
Echo echo = (Echo) factory.create(myService, url);

代码示例

代码示例来源:origin: org.codehaus.xfire/xfire-core

/**
 * Creates a new proxy with the specified URL. The returned object is a proxy with the interface specified by the
 * given service interface.
 * <pre>
 * String url = "http://localhost:8080/services/Echo");
 * Echo echo = (Echo) factory.create(transport, myService, url);
 * </pre>
 * @param transport        The transport to use.
 * @param url              the URL where the client object is located.
 * @param serviceInterface the service to create a client for.
 *
 * @return a proxy to the object with the specified interface.
 */
public Object create(Service service, Transport transport, String url)
    throws MalformedURLException
{
  return create(new Client(transport, service, url));
}

代码示例来源:origin: org.codehaus.xfire/xfire-jaxws

private Object createPort(Endpoint endpoint)
{
  try
  {
    return factory.create(endpoint);
  }
  catch (MalformedURLException e)
  {
    throw new WebServiceException("Invalid url: " + endpoint.getUrl(), e);
  }
}

代码示例来源:origin: org.nuiton.topia/topia-soa

public Object invoke(Object obj, Method method, Object[] args)
    throws Throwable {
  Object result = null;
  // Create a service model for the client
  ObjectServiceFactory serviceFactory = new ObjectServiceFactory();
  Service serviceModel = serviceFactory.create(clazz);
  // Create a client proxy
  XFireProxyFactory proxyFactory = new XFireProxyFactory();
  Object xfproxy = proxyFactory.create(serviceModel, serviceLocation
      + "/" + clazz.getSimpleName());
  result = MethodUtils.invokeMethod(xfproxy, method.getName(), args);
  return result;
}

代码示例来源:origin: org.codehaus.xfire/xfire-spring

/**
 * Create the XFire proxy that is wrapped by this interceptor.
 *
 * @param proxyFactory the proxy factory to use
 * @return the Burlap proxy
 * @throws MalformedURLException if thrown by the proxy factory
 * @see XFireProxyFactory#create
 */
protected Object createXFireProxy(XFireProxyFactory proxyFactory)
    throws MalformedURLException
{
  return proxyFactory.create(getService().getXFireService(), getServiceUrl());
}

代码示例来源:origin: org.codehaus.xfire/xfire-core

return create(client);

代码示例来源:origin: org.codehaus.xfire/xfire-core

public Object create(Binding binding, String address)
    throws MalformedURLException
  {
    Transport t = xfire.getTransportManager().getTransport(binding.getBindingId());
    
    if (t == null)
    {
      throw new XFireRuntimeException("Could not find transport for binding " + 
                      binding.getBindingId());
    }
    
    Client client = new Client(t, binding, address);
    return create(client);
  }
}

代码示例来源:origin: org.codehaus.xfire/xfire-core

public Object create(Endpoint endpoint)
  throws MalformedURLException
{
  Binding binding = endpoint.getBinding();
  Transport t = xfire.getTransportManager().getTransport(binding.getBindingId());
  
  if (t == null)
  {
    throw new XFireRuntimeException("Could not find transport for binding " + 
                    binding.getBindingId());
  }
  
  return create(new Client(t, endpoint));
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

/**
 * Load an XFire client proxy that implements the specified interface.
 *
 * @param iface The interface.
 * @param uuid The UUID of the interface.
 * @param endpoint The endpoint URL of the SOAP port.
 * @return The proxy.
 */
protected final Object loadProxy(Class iface, String uuid, String endpoint) {
 XFire xFire = XFireFactory.newInstance().getXFire();
 TransportManager transportManager = xFire.getTransportManager();
 Service service;
 try {
  ExplicitJAXWSAnnotationServiceFactory factory = new ExplicitJAXWSAnnotationServiceFactory(uuid, transportManager);
  service = factory.create(iface);
 }
 catch (RuntimeException e) {
  throw e;
 }
 catch (Exception e) {
  throw new IllegalStateException(e);
 }
 SoapHttpTransport soapTransport = new SoapHttpTransport();
 if (!soapTransport.isUriSupported(endpoint)) {
  throw new IllegalArgumentException("Endpoint " + endpoint + " is not a supported SOAP endpoint.");
 }
 soapTransport.addOutHandler(new EnunciatedClientSoapSerializerHandler());
 Client client = new Client(soapTransport, service, endpoint);
 return new XFireProxyFactory(xFire).create(client);
}

代码示例来源:origin: org.apache.servicemix/servicemix-jsr181

public Object getProxy() throws Exception {
  if (proxy == null) {
    Map props = new HashMap();
    props.put(AnnotationServiceFactory.ALLOW_INTERFACE, Boolean.TRUE);
    ServiceFactory factory = ServiceFactoryHelper.findServiceFactory(xfire, serviceClass, null, null);
    Service service = factory.create(serviceClass, props);
    JBIClient client;
    if (factory instanceof JAXWSServiceFactory) {
      client = new JAXWSJBIClient(xfire, service);
    } else {
      client = new JBIClient(xfire, service);
    }
    if (interfaceName != null) {
      client.getService().setProperty(JbiChannel.JBI_INTERFACE_NAME, interfaceName);
    }
    if (serviceName != null) {
      client.getService().setProperty(JbiChannel.JBI_SERVICE_NAME, serviceName);
    }
    if (endpoint != null) {
      client.getService().setProperty(JbiChannel.JBI_ENDPOINT, endpoint);
    }
    client.getService().setProperty(JbiChannel.JBI_SECURITY_PROPAGATATION, 
        Boolean.valueOf(propagateSecurityContext));
    XFireProxyFactory xpf = new XFireProxyFactory(xfire);
    proxy = xpf.create(client);
  }
  return proxy;
}

代码示例来源:origin: org.codehaus.xfire/xfire-spring

if (serviceUrl != null) 
  return new XFireProxyFactory().create(serviceModel, serviceUrl);
    throw new IllegalStateException("Could not find endpoint with name " + _endpointName + " on service.");
  return new XFireProxyFactory().create(ep);

代码示例来源:origin: org.codehaus.enunciate/enunciate-xfire-client-tools

/**
 * Load an XFire client proxy that implements the specified interface.
 *
 * @param iface The interface.
 * @param uuid The UUID of the interface.
 * @param endpoint The endpoint URL of the SOAP port.
 * @return The proxy.
 */
protected final Object loadProxy(Class iface, String uuid, String endpoint) {
 XFire xFire = XFireFactory.newInstance().getXFire();
 TransportManager transportManager = xFire.getTransportManager();
 Service service;
 try {
  ExplicitJAXWSAnnotationServiceFactory factory = new ExplicitJAXWSAnnotationServiceFactory(uuid, transportManager);
  service = factory.create(iface);
 }
 catch (RuntimeException e) {
  throw e;
 }
 catch (Exception e) {
  throw new IllegalStateException(e);
 }
 SoapHttpTransport soapTransport = new SoapHttpTransport();
 if (!soapTransport.isUriSupported(endpoint)) {
  throw new IllegalArgumentException("Endpoint " + endpoint + " is not a supported SOAP endpoint.");
 }
 soapTransport.addOutHandler(new EnunciatedClientSoapSerializerHandler());
 Client client = new Client(soapTransport, service, endpoint);
 return new XFireProxyFactory(xFire).create(client);
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com