Package org.codehaus.enunciate.contract.validation

Examples of org.codehaus.enunciate.contract.validation.ValidationResult.addError()


        WebService eiAnnotation = ei.getAnnotation(WebService.class);
        if (!"".equals(eiAnnotation.serviceName())) {
          result.addError(ei, "CXF fails if you specify 'serviceName' on an endpoint interface.");
        }
        if (!"".equals(eiAnnotation.portName())) {
          result.addError(ei, "CXF fails if you specify 'portName' on an endpoint interface.");
        }
        for (MethodDeclaration m : ei.getMethods()) {
          javax.jws.WebMethod wm = m.getAnnotation(javax.jws.WebMethod.class);
          if (wm != null && wm.exclude()) {
            result.addError(m, "CXF fails if you specify 'exclude=true' on an endpoint interface.");
View Full Code Here


          result.addError(ei, "CXF fails if you specify 'portName' on an endpoint interface.");
        }
        for (MethodDeclaration m : ei.getMethods()) {
          javax.jws.WebMethod wm = m.getAnnotation(javax.jws.WebMethod.class);
          if (wm != null && wm.exclude()) {
            result.addError(m, "CXF fails if you specify 'exclude=true' on an endpoint interface.");
          }
        }
      }

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

      for (WebMethod webMethod : ei.getWebMethods()) {
        for (WebParam webParam : webMethod.getWebParameters()) {
          if ((webParam.isHeader()) && ("".equals(webParam.getAnnotation(javax.jws.WebParam.class).name()))) {
            //todo: lift this constraint by serializing the parameter names to some file you can load for metadata...
            result.addError(webParam, "For now, Enunciate requires you to specify a 'name' on the @WebParam annotation if it's a header.");
          }
        }

        for (WebFault webFault : webMethod.getWebFaults()) {
          if (webFault.getExplicitFaultBeanType() != null) {
View Full Code Here

        for (WebFault webFault : webMethod.getWebFaults()) {
          if (webFault.getExplicitFaultBeanType() != null) {
            ElementDeclaration faultBean = webFault.findExplicitFaultBean();
            if (!webFault.getSimpleName().equals(faultBean.getName())) {
              result.addError(webMethod, "Because of some inconsistencies with the JAX-WS implementation of CXF, the CXF module cannot have methods that " +
                "throw exceptions that are named differently than the element name of their explicit fault beans. Apply @XmlRootElement ( name = \""
                + webFault.getSimpleName() + "\" ) to  explicit fault bean " + webFault.getExplicitFaultBeanType() + " to apply the workaround.");
            }
          }
          else {
View Full Code Here

          }
          else {
            String ns = webFault.getTargetNamespace() == null ? "" : webFault.getTargetNamespace();
            String eins = ei.getTargetNamespace() == null ? "" : ei.getTargetNamespace();
            if (!ns.equals(eins)) {
              result.addError(webMethod, "CXF doesn't handle throwing exceptions that are defined in a different namespace " +
                "from the namespace of the endpoint interface.");
            }
          }
        }
      }
View Full Code Here

  @Override
  public ValidationResult validateComplexType(ComplexTypeDefinition complexType) {
    ValidationResult result = super.validateComplexType(complexType);
    if (!Character.isUpperCase(complexType.getClientSimpleName().charAt(0))) {
      result.addError(complexType, "PHP requires your class name to be upper-case. Please rename the class or apply the @org.codehaus.enunciate.ClientName annotation to the class.");
    }
    for (Element element : complexType.getElements()) {
      if (element instanceof ElementRef && ((ElementRef) element).isElementRefs()) {
        result.addWarning(complexType, "The PHP client library doesn't fully support the @XmlElementRefs annotation. The items in the collection will be read-only and will only be available to PHP clients in the form of a Hash. Consider redesigning using a collection of a single type. See http://jira.codehaus.org/browse/ENUNCIATE-542 for more information.");
      }
View Full Code Here

        //no out or in/out non-header parameters!
        if (webParam.isHeader()) {
          //unique parameter names for all header parameters of a given ei
          Declaration conflict = paramsByName.put(webParam.getElementName(), webParam);
          if (conflict != null) {
            result.addError(webParam, "C# requires that all header parameters defined in the same endpoint interface have unique names. " +
              "This parameter conflicts with the one at " + (conflict.getPosition() == null ? "(unknown source position)" : conflict.getPosition()));
          }

          DecoratedTypeMirror paramType = (DecoratedTypeMirror) webParam.getType();
          if (paramType.isCollection()) {
View Full Code Here

              "This parameter conflicts with the one at " + (conflict.getPosition() == null ? "(unknown source position)" : conflict.getPosition()));
          }

          DecoratedTypeMirror paramType = (DecoratedTypeMirror) webParam.getType();
          if (paramType.isCollection()) {
            result.addError(webParam, "C# can't handle header parameters that are collections.");
          }

        }
        else if (webParam.getMode() != javax.jws.WebParam.Mode.IN) {
          result.addError(webParam, "C# doesn't support non-header parameters of mode " + webParam.getMode());
View Full Code Here

            result.addError(webParam, "C# can't handle header parameters that are collections.");
          }

        }
        else if (webParam.getMode() != javax.jws.WebParam.Mode.IN) {
          result.addError(webParam, "C# doesn't support non-header parameters of mode " + webParam.getMode());
        }

        //parameters/results can't be maps
        if (webParam.getType() instanceof MapType) {
          result.addError(webParam, "C# can't handle types that are maps.");
View Full Code Here

          result.addError(webParam, "C# doesn't support non-header parameters of mode " + webParam.getMode());
        }

        //parameters/results can't be maps
        if (webParam.getType() instanceof MapType) {
          result.addError(webParam, "C# can't handle types that are maps.");
        }
      }

      //web result cannot be a header.
      if (webMethod.getWebResult().isHeader()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.