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

org.codehaus.enunciate.modules.java_client.client-endpoint-interface.fmt Maven / Gradle / Ivy

[#ftl]
[#-- @ftlvariable name="webMethod" type="org.codehaus.enunciate.contract.jaxws.WebMethod" --]
[#--template for the client-side endpoint interface.--]
[#if endpointInterface.endpointImplementations?size == 1]
  [#assign impl=endpointInterface.endpointImplementations[0]/]
[/#if]
[@file name=(endpointInterface.simpleName + ".java")  package=packageFor(endpointInterface) charset="utf-8"]
/**
 * ${(generatedCodeLicense!"")?replace("\n", "\n * ")}
 *
 * Generated by Enunciate.
 */
package ${packageFor(endpointInterface)};

/**
 * ${endpointInterface.docComment?default("(no documentation provided)")?chop_linebreak?replace("\n", "\n * ")}
 */
 @javax.jws.WebService (
   name = "${endpointInterface.portTypeName}",
   targetNamespace = "${endpointInterface.targetNamespace}"
 )
 @javax.xml.bind.annotation.XmlSeeAlso ( {
  [#list seeAlsoBeans as seeAlso]
  ${seeAlso}.class[#if seeAlso_has_next],[/#if]
  [/#list]
 } )
[#if ((impl??) && (impl.annotations["javax.xml.ws.soap.MTOM"]??))]
@javax.xml.ws.soap.MTOM (
  enabled = ${impl.annotations["javax.xml.ws.soap.MTOM"].enabled?string},
  threshold = ${impl.annotations["javax.xml.ws.soap.MTOM"].threshold?string}
)
[/#if]
[#if ((impl??) && (impl.annotations["javax.xml.ws.soap.Addressing"]??))]
@javax.xml.ws.soap.Addressing (
  enabled = ${impl.annotations["javax.xml.ws.soap.Addressing"].enabled?string},
  required = ${impl.annotations["javax.xml.ws.soap.Addressing"].required?string}
)
[/#if]
[#if ((impl??) && (impl.annotations["javax.xml.ws.RespectBinding"]??))]
@javax.xml.ws.RespectBinding (
  enabled = ${impl.annotations["javax.xml.ws.RespectBinding"].enabled?string}
)
[/#if]
public interface ${endpointInterface.simpleName} {
  [@forEachWebMethod endpointInterface=endpointInterface considerFacets="true"]

  /**
   * ${webMethod.docComment?default("(no documentation provided)")?chop_linebreak?replace("\n", "\n   * ")}
   */
  @javax.jws.WebMethod (
    operationName = "${webMethod.operationName}",
    action = "${webMethod.action}"
  )
  @javax.jws.WebResult (
    name = "${webMethod.webResult.elementName}",
    targetNamespace = "${webMethod.webResult.targetNamespace}",
    header = ${webMethod.webResult.header?string},
    partName = "${webMethod.webResult.partName}"
  )
  [#if webMethod.requestWrapper?exists]
    [#assign beanfqn=webMethod.requestWrapper.requestBeanName/]
    [#assign beanPackage=packageFor(beanfqn[0..(beanfqn?last_index_of(".") - 1)])/]
    [#assign simpleBeanName=beanfqn[(beanfqn?last_index_of(".") + 1)..]/]
  @javax.xml.ws.RequestWrapper (
    localName = "${webMethod.requestWrapper.elementName}",
    targetNamespace = "${webMethod.requestWrapper.elementNamespace}",
    className = "${beanPackage}.${simpleBeanName}"
  )
  [/#if]
  [#if webMethod.responseWrapper?exists]
    [#assign beanfqn=webMethod.responseWrapper.responseBeanName/]
    [#assign beanPackage=packageFor(beanfqn[0..(beanfqn?last_index_of(".") - 1)])/]
    [#assign simpleBeanName=beanfqn[(beanfqn?last_index_of(".") + 1)..]/]
  @javax.xml.ws.ResponseWrapper (
    localName = "${webMethod.responseWrapper.elementName}",
    targetNamespace = "${webMethod.responseWrapper.elementNamespace}",
    className = "${beanPackage}.${simpleBeanName}"
  )
  [/#if]
  @javax.jws.soap.SOAPBinding (
    style = javax.jws.soap.SOAPBinding.Style.${webMethod.soapBindingStyle?string},
    use = javax.jws.soap.SOAPBinding.Use.${webMethod.soapUse?string},
    parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.${webMethod.soapParameterStyle?string}
  )
  [#if webMethod.oneWay]
  @javax.jws.Oneway
  [/#if]
  ${classnameFor(webMethod.webResult)} ${webMethod.simpleName}([#list webMethod.webParameters as param]@javax.jws.WebParam( name = "${param.elementName}", targetNamespace="${param.targetNamespace}", mode = javax.jws.WebParam.Mode.${param.mode?string} , header = ${param.header?string}, partName = "${param.partName}" )[#if param.mimeType??] @javax.xml.bind.annotation.XmlMimeType("${param.mimeType}")[/#if][#if param.swaRef] @javax.xml.bind.annotation.XmlAttachmentRef[/#if] ${classnameFor(param)} ${param.clientSimpleName}[#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];
  [/@forEachWebMethod]

}
[/@file]




© 2015 - 2025 Weber Informatics LLC | Privacy Policy