Package org.codehaus.enunciate.contract.jaxws

Examples of org.codehaus.enunciate.contract.jaxws.EndpointInterface


    Collection<EndpointInterface> eis = new ArrayList<EndpointInterface>(wsdl.getEndpointInterfaces());
    if (considerFacets) {
      Iterator<EndpointInterface> vit = eis.iterator();
      while (vit.hasNext()) {
        EndpointInterface next = vit.next();
        if (!FacetFilter.accept(next)) {
          vit.remove();
        }
      }
    }
View Full Code Here


  private String var = "bindingType";
  private EndpointInterface endpointInterface;

  //Inherited.
  protected Iterator<BindingType> getLoop(TemplateModel model) throws TemplateException {
    EndpointInterface endpointInterface = this.endpointInterface;

    if (endpointInterface == null) {
      endpointInterface = (EndpointInterface) model.getVariable("endpointInterface");

      if (endpointInterface == null) {
        throw new MissingParameterException("endpointInterface");
      }
    }

    Collection<BindingType> bindingTypes = new ArrayList<BindingType>();
    Collection<EndpointImplementation> impls = endpointInterface.getEndpointImplementations();
    for (EndpointImplementation implementation : impls) {
      bindingTypes.add(implementation.getBindingType());
    }

    if (bindingTypes.isEmpty()) {
View Full Code Here

  private String var = "webMethod";
  private boolean considerFacets = false;
  private EndpointInterface endpointInterface;

  protected Iterator<WebMethod> getLoop(TemplateModel model) throws TemplateException {
    EndpointInterface endpointInterface = this.endpointInterface;
    if (endpointInterface == null) {
      throw new MissingParameterException("endpointInterface");
    }

    Collection<WebMethod> webMethods = endpointInterface.getWebMethods();
    if (considerFacets) {
      Iterator<WebMethod> vit = webMethods.iterator();
      while (vit.hasNext()) {
        if (!FacetFilter.accept(vit.next())) {
          vit.remove();
View Full Code Here

      final boolean isEndpointInterface = isEndpointInterface(declaration);
      final boolean isJAXRSRootResource = isJAXRSRootResource(declaration);
      final boolean isJAXRSSupport = isJAXRSSupport(declaration);
      if (isEndpointInterface || isJAXRSRootResource || isJAXRSSupport) {
        if (isEndpointInterface) {
          EndpointInterface endpointInterface = new EndpointInterface(declaration, additionalApiDefinitions);
          debug("%s to be considered as an endpoint interface.", declaration.getQualifiedName());
          for (EndpointImplementation implementation : endpointInterface.getEndpointImplementations()) {
            debug("%s is the implementation of endpoint interface %s.", implementation.getQualifiedName(), endpointInterface.getQualifiedName());
          }
          eis.add(endpointInterface);
        }

        if (isJAXRSRootResource) {
View Full Code Here

  @Override
  public ValidationResult validateEndpointInterface(EndpointInterface ei) {
    ValidationResult result = super.validateEndpointInterface(ei);

    EndpointInterface visited = visitedEndpoints.put(ei.getServiceName(), ei);
    if (visited != null) {
      if (visited.getTargetNamespace().equals(ei.getTargetNamespace())) {
        result.addError(ei, "Ummm... you already have a service named " + ei.getServiceName() + " at " +
          visited.getPosition() + ".  You need to disambiguate.");
      }
    }

    for (WebMethod webMethod : ei.getWebMethods()) {
      for (WebParam webParam : webMethod.getWebParameters()) {
View Full Code Here

  @Override
  public ValidationResult validateEndpointInterface(EndpointInterface ei) {
    ValidationResult result = super.validateEndpointInterface(ei);

    if (enableJaxws) {
      EndpointInterface visited = visitedEndpoints.put(ei.getServiceName(), ei);
      if (visited != null) {
        if (visited.getTargetNamespace().equals(ei.getTargetNamespace())) {
          result.addError(ei, "Ummm... you already have a service named " + ei.getServiceName() + " at " +
            visited.getPosition() + ".  You need to disambiguate.");
        }
      }

      if (ei.isInterface()) {
        WebService eiAnnotation = ei.getAnnotation(WebService.class);
View Full Code Here

      }
    };

    //test validation of JSR 181, secion 3.3
    TypeDeclaration declaration = getDeclaration("org.codehaus.enunciate.samples.services.NotAWebService");
    EndpointInterface ei = new EndpointInterface(declaration);
    assertTrue("A class not annotated with @WebService shouldn't be a valid endpoint interface (jsr 181: 3.3).", validator.validateEndpointInterface(ei).hasErrors());

    declaration = getDeclaration("org.codehaus.enunciate.samples.services.InvalidEIReference");
    ei = new EndpointInterface(declaration);
    assertTrue("An endpoint implementation with an ei reference to another class shouldn't be valid.", validator.validateEndpointInterface(ei).hasErrors());

    declaration = getDeclaration("org.codehaus.enunciate.samples.services.UnknownEIReference");
    ei = new EndpointInterface(declaration);
    assertTrue("An endpoint implementation with an ei reference to something unknown shouldn't be valid.", validator.validateEndpointInterface(ei).hasErrors());

    declaration = getDeclaration("org.codehaus.enunciate.samples.services.InterfaceSpecifiedAsImplementation");
    //if an interface is specified as an implementation, it's still an endpoint interface, just not a valid one.
    ei = new EndpointInterface(declaration);
    assertTrue("An interface declaration shouldn't be allowed to specify another endpoint interface (jsr 181: 3.3).", validator.validateEndpointInterface(ei).hasErrors());

    declaration = getDeclaration("org.codehaus.enunciate.samples.services.WebServiceWithoutUniqueMethodNames");
    //an unknown ei reference is correct, but not valid.
    ei = new EndpointInterface(declaration);
    assertTrue("An endpoint without unique web method names shouldn't be valid.", validator.validateEndpointInterface(ei).hasErrors());

    declaration = getDeclaration("org.codehaus.enunciate.samples.services.EncodedUseWebService");
    ei = new EndpointInterface(declaration);
    assertTrue("An encoded-use web wervice shouldn't be supported.", validator.validateEndpointInterface(ei).hasErrors());

    implCounter.reset();
    methodCounter.reset();
    declaration = getDeclaration("org.codehaus.enunciate.samples.services.NamespacedWebService");
    ei = new EndpointInterface(declaration);
    assertFalse("An encoded-use web wervice shouldn't be supported.", validator.validateEndpointInterface(ei).hasErrors());
    assertEquals(1, implCounter.getCount());
    assertEquals(1, methodCounter.getCount());
  }
View Full Code Here

  }

  public void testValidateEndpointImplementation() throws Exception {
    DefaultValidator validator = new DefaultValidator();

    EndpointInterface ei = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.NoNamespaceWebService"));

    ClassDeclaration declaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.services.NotAWebService");
    EndpointImplementation impl = new EndpointImplementation(declaration, ei);
    assertTrue("A class not annotated with @WebService shouldn't be seen as an endpoint implementation.", validator.validateEndpointImplementation(impl).hasErrors());
View Full Code Here

  public void testValidateRESTAPI() throws Exception {
    //todo: implement.
  }

  public void testValidateWebMethod() throws Exception {
    EndpointInterface ei = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.WebMethodExamples")) {
      @Override
      public boolean isWebMethod(MethodDeclaration method) {
        return true;
      }
    };

    WebMethod privateMethod = null;
    WebMethod protectedMethod = null;
    WebMethod excludedMethod = null;
    WebMethod encodedMethod = null;
    WebMethod nonVoidOneWayMethod = null;
    WebMethod exceptionThrowingOneWayMethod = null;
    WebMethod headerCollectionParam = null;
    WebMethod headerCollectionReturn = null;
    WebMethod rpcBareMethod = null;
    WebMethod docBare2ParamMethod = null;
    WebMethod docBare2OutputMethod = null;
    WebMethod docBareWithHeadersMethod = null;
    WebMethod docBareVoidMethod = null;
    WebMethod docBareVoid2OutputMethod = null;
    WebMethod rpcCollectionParam = null;
    WebMethod invalidInOutParameter = null;
    Collection<WebMethod> webMethods = ei.getWebMethods();
    for (WebMethod webMethod : webMethods) {
      if ("privateMethod".equals(webMethod.getSimpleName())) {
        privateMethod = webMethod;
      }
      else if ("protectedMethod".equals(webMethod.getSimpleName())) {
View Full Code Here

    }
    else if (ei.getEndpointImplementations().isEmpty()) {
      result.addError(ei, "JBoss requires an implementation for each service interface.");
    }

    EndpointInterface visited = visitedEndpoints.put(ei.getServiceName(), ei);
    if (visited != null) {
      if (visited.getTargetNamespace().equals(ei.getTargetNamespace())) {
        result.addError(ei, "Ummm... you already have a service named " + ei.getServiceName() + " at " +
          visited.getPosition() + ".  You need to disambiguate.");
      }
    }

    return result;
  }
View Full Code Here

TOP

Related Classes of org.codehaus.enunciate.contract.jaxws.EndpointInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.