javax.jws.WebService.portName()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(155)

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

WebService.portName介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

String pn = ann.portName();
if (StringUtils.hasText(pn)) {
  setPortName(pn);

代码示例来源:origin: org.springframework/spring-web

String pn = ann.portName();
if (StringUtils.hasText(pn)) {
  setPortName(pn);

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

&& (!StringUtils.isEmpty(seiAnnotation.portName())
|| !StringUtils.isEmpty(seiAnnotation.serviceName())
|| !StringUtils.isEmpty(seiAnnotation.endpointInterface()))) {

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

portName = wsAnnotations.get(x).portName();

代码示例来源:origin: kumuluz/kumuluzee

public String portName() {

    if (ws == null) {
      return null;
    }

    return ws.portName() != null && ws.portName().isEmpty() ? null : ws.portName();
  }
}

代码示例来源:origin: io.oasp.java.modules/oasp4j-cxf-client-ws

private String getLocalName(Class<?> api, WebService webService) {
 String portName = webService.portName();
 if (portName.isEmpty()) {
  return api.getSimpleName();
 }
 return portName;
}

代码示例来源:origin: oasp/oasp4j

private String getLocalName(Class<?> api, WebService webService) {
 String portName = webService.portName();
 if (portName.isEmpty()) {
  return api.getSimpleName();
 }
 return portName;
}

代码示例来源:origin: org.fabric3/fabric3-binding-ws-metro

/**
 * Returns the WSDL port name according to JAX-WS rules.
 *
 * @param annotation   the WebService annotation on the endpoint implementation
 * @param serviceClass the endpoint implementation
 * @param namespace    the namespace
 * @return the port name
 */
private QName getPortName(WebService annotation, Class<?> serviceClass, String namespace) {
  String portName = annotation.portName();
  if (portName.length() < 1) {
    if (annotation.name().length() < 1) {
      portName = serviceClass.getSimpleName() + "Port";
    } else {
      portName = annotation.name() + "Port";
    }
  }
  return new QName(namespace, portName);
}

代码示例来源:origin: com.carecon.fabric3/fabric3-binding-ws

/**
 * Returns the WSDL port name according to JAX-WS rules.
 *
 * @param annotation   the WebService annotation on the endpoint implementation
 * @param serviceClass the endpoint implementation
 * @param namespace    the namespace
 * @return the port name
 */
private QName getPortName(WebService annotation, Class<?> serviceClass, String namespace) {
  String portName = annotation.portName();
  if (portName.length() < 1) {
    if (annotation.name().length() < 1) {
      portName = serviceClass.getSimpleName() + "Port";
    } else {
      portName = annotation.name() + "Port";
    }
  }
  return new QName(namespace, portName);
}

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core

public static QName getPortQName(Class<?> clazz) {
  WebService webService = clazz.getAnnotation(WebService.class);
  if (webService != null) {
    return getPortQName(clazz, webService.targetNamespace(), webService.name(), webService.portName());
  }
  WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
  if (webServiceProvider != null) {
    return getPortQName(clazz, webServiceProvider.targetNamespace(), null, webServiceProvider.portName());
  }
  throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}

代码示例来源:origin: org.apache.openejb/openejb-core

public static QName getPortQName(final Class<?> clazz) {
  final WebService webService = clazz.getAnnotation(WebService.class);
  if (webService != null) {
    return getPortQName(clazz, webService.targetNamespace(), webService.name(), webService.portName());
  }
  final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
  if (webServiceProvider != null) {
    return getPortQName(clazz, webServiceProvider.targetNamespace(), null, webServiceProvider.portName());
  }
  throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}

代码示例来源:origin: org.apache.tomee/openejb-core

public static QName getPortQName(final Class<?> clazz) {
  final WebService webService = clazz.getAnnotation(WebService.class);
  if (webService != null) {
    return getPortQName(clazz, webService.targetNamespace(), webService.name(), webService.portName());
  }
  final WebServiceProvider webServiceProvider = clazz.getAnnotation(WebServiceProvider.class);
  if (webServiceProvider != null) {
    return getPortQName(clazz, webServiceProvider.targetNamespace(), null, webServiceProvider.portName());
  }
  throw new IllegalArgumentException("The " + clazz.getName() + " is not annotated");
}

代码示例来源:origin: com.sun.xml.ws/jaxws-tools

protected void verifySeiAnnotations(WebService webService, TypeElement d) {
  if (webService.endpointInterface().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(
        d.getQualifiedName(), webService.endpointInterface()), d);
  }
  if (webService.serviceName().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
        "serviceName", d.getQualifiedName()), d);
  }
  if (webService.portName().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
        "portName", d.getQualifiedName()), d);
  }
}

代码示例来源:origin: javaee/metro-jax-ws

protected void verifySeiAnnotations(WebService webService, TypeElement d) {
  if (webService.endpointInterface().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(
        d.getQualifiedName(), webService.endpointInterface()), d);
  }
  if (webService.serviceName().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
        "serviceName", d.getQualifiedName()), d);
  }
  if (webService.portName().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
        "portName", d.getQualifiedName()), d);
  }
}

代码示例来源:origin: org.glassfish.metro/webservices-tools

protected void verifySeiAnnotations(WebService webService, TypeElement d) {
  if (webService.endpointInterface().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(
        d.getQualifiedName(), webService.endpointInterface()), d);
  }
  if (webService.serviceName().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
        "serviceName", d.getQualifiedName()), d);
  }
  if (webService.portName().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
        "portName", d.getQualifiedName()), d);
  }
}

代码示例来源:origin: javaee/metro-jax-ws

protected void verifySeiAnnotations(WebService webService, TypeElement d) {
  if (webService.endpointInterface().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_ENDPOINTINTERFACE_ON_INTERFACE(
        d.getQualifiedName(), webService.endpointInterface()), d);
  }
  if (webService.serviceName().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
        "serviceName", d.getQualifiedName()), d);
  }
  if (webService.portName().length() > 0) {
    builder.processError(WebserviceapMessages.WEBSERVICEAP_INVALID_SEI_ANNOTATION_ELEMENT(
        "portName", d.getQualifiedName()), d);
  }
}

代码示例来源:origin: apache/axis2-java

public static WebServiceAnnot createFromAnnotation(Annotation annotation) {
  WebServiceAnnot returnAnnot = null;
  if (annotation != null && annotation instanceof javax.jws.WebService) {
    javax.jws.WebService ws = (javax.jws.WebService) annotation;
    return new WebServiceAnnot(ws.name(),
                  ws.targetNamespace(),
                  ws.serviceName(),
                  ws.wsdlLocation(),
                  ws.endpointInterface(),
                  ws.portName());
                 
  }
  return returnAnnot;
}

代码示例来源:origin: org.apache.axis2/axis2-metadata

public static WebServiceAnnot createFromAnnotation(Annotation annotation) {
  WebServiceAnnot returnAnnot = null;
  if (annotation != null && annotation instanceof javax.jws.WebService) {
    javax.jws.WebService ws = (javax.jws.WebService) annotation;
    return new WebServiceAnnot(ws.name(),
                  ws.targetNamespace(),
                  ws.serviceName(),
                  ws.wsdlLocation(),
                  ws.endpointInterface(),
                  ws.portName());
                 
  }
  return returnAnnot;
}

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

public WebServiceAnnotation getWebServiceAnnotation(Class clazz)
{
  WebService webService = (WebService) clazz.getAnnotation(WebService.class);
  if (webService != null)
  {
    WebServiceAnnotation annotation = new WebServiceAnnotation();
    annotation.setEndpointInterface(webService.endpointInterface());
    annotation.setName(webService.name());
    annotation.setServiceName(webService.serviceName());
    annotation.setTargetNamespace(webService.targetNamespace());
    annotation.setPortName(webService.portName());
    annotation.setWsdlLocation(webService.wsdlLocation());
    
    return annotation;
  }
  else
  {
    return null;
  }
}

代码示例来源:origin: org.apache.axis2/axis2-metadata

/**
 * This method will be used to attach @WebService annotation data to the
 * <code>DescriptionBuildercomposite</code>
 *
 * @param composite - <code>DescriptionBuilderComposite</code>
 */
private void attachWebServiceAnnotation(DescriptionBuilderComposite composite) {
  WebService webService = (WebService)ConverterUtils.getAnnotation(
      WebService.class, serviceClass);
  if (webService != null) {
    // Attach @WebService annotated data
    WebServiceAnnot wsAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
    wsAnnot.setEndpointInterface(webService.endpointInterface());
    // check for SEI and save name if necessary
    seiClassName = webService.endpointInterface();
    wsAnnot.setName(webService.name());
    wsAnnot.setPortName(webService.portName());
    wsAnnot.setServiceName(webService.serviceName());
    wsAnnot.setTargetNamespace(webService.targetNamespace());
    wsAnnot.setWsdlLocation(webService.wsdlLocation());
    composite.setWebServiceAnnot(wsAnnot);
  }
}

相关文章