All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.enunciate.modules.xfire_client.client-soap-endpoint-impl.fmt Maven / Gradle / Ivy

Go to download

The Enunciate XFire Client module generates the client-side artifacts for invoking a remove web service endpoint via XFire.

The newest version!
[#ftl]
[#--template for the client-side endpoint interface.--]
[@file name=(endpointInterface.simpleName + "Impl.java")  package=(packageFor(endpointInterface) + ".impl") charset="utf-8"]
// Generated by Enunciate
package ${packageFor(endpointInterface) + ".impl"};

import ${packageFor(endpointInterface) + "." + endpointInterface.simpleName};

import org.codehaus.enunciate.modules.xfire_client.EnunciatedSOAPWebServiceImpl;

/**
 * Implementation of the {@link ${endpointInterface.simpleName}}.
 */
public class ${endpointInterface.simpleName}Impl extends EnunciatedSOAPWebServiceImpl implements ${endpointInterface.simpleName} {

  private final ${endpointInterface.simpleName} proxy;

  /**
   * Construct a ${endpointInterface.simpleName} that points to the default endpoint ("${baseDeploymentAddress}${endpointInterface.metaData.soapPath?default("/soap/" + endpointInterface.serviceName)}").
   */
  public ${endpointInterface.simpleName}Impl() {
    this("${baseDeploymentAddress}${endpointInterface.metaData.soapPath?default("/soap/" + endpointInterface.serviceName)}");
  }

  /**
   * Construct a ${endpointInterface.simpleName} that points to the endpoint at the specified host and port.
   *
   * @param host The host.
   * @param port The port.
   */
  public ${endpointInterface.simpleName}Impl(String host, int port) {
    this("${baseDeploymentAddress}${endpointInterface.metaData.soapPath?default("/soap/" + endpointInterface.serviceName)}");
    try {
      java.net.URL baseUrl = new java.net.URL(getXFireClient().getUrl());
      getXFireClient().setUrl(new java.net.URL(baseUrl.getProtocol(), host, port, baseUrl.getFile()).toString());
    }
    catch (java.net.MalformedURLException e) {
      throw new IllegalStateException(e);
    }
  }

  /**
   * Construct a ${endpointInterface.simpleName} that points to the specified endpoint.
   *
   * @param endpoint The endpoint to point to.
   */
  public ${endpointInterface.simpleName}Impl(String endpoint) {
    super(${endpointInterface.simpleName}.class, "${uuid}", endpoint);
    this.proxy = (${endpointInterface.simpleName}) getProxy();
  }

  [@forEachWebMethod endpointInterface=endpointInterface]

  // Inherited.
  public ${classnameFor(webMethod.webResult)} ${webMethod.simpleName}([#list webMethod.webParameters as param]${classnameFor(param)} ${param.simpleName}[#if param_has_next], [/#if][/#list]) [#if webMethod.webFaults?size > 0]throws [#list webMethod.webFaults as fault]${classnameFor(fault)}[#if fault_has_next], [/#if][/#list][/#if] {
    [#if !webMethod.returnType.void]return [/#if]proxy.${webMethod.simpleName}([#list webMethod.webParameters as param]${param.simpleName}[#if param_has_next], [/#if][/#list]); 
  }
  [/@forEachWebMethod]
}
[/@file]




© 2015 - 2024 Weber Informatics LLC | Privacy Policy