Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.SchemaGlobalElement$Ref


            + wsdlContext.getSoapVersion().getFaultDetailNamespace() + "';" + "declare namespace ns='"
            + elementName.getNamespaceURI() + "';" + "//env:Fault/flt:detail/ns:" + elementName.getLocalPart() );

        if( paths.length == 1 )
        {
          SchemaGlobalElement elm = wsdlContext.getSchemaTypeLoader().findElement( elementName );
          if( elm != null )
          {
            validateMessageBody( errors, elm.getType(), paths[0] );
          }
          else
            errors.add( XmlError.forMessage( "Missing fault part element [" + elementName + "] for fault ["
                + part.getName() + "] in associated schema" ) );
View Full Code Here


    SchemaType schemaType = null;
    QName elementName = part.getElementName();

    if( elementName != null )
    {
      SchemaGlobalElement elm = wsdlContext.getSchemaTypeLoader().findElement( elementName );
      if( elm != null )
      {
        schemaType = elm.getType();
      }
      else
        WsdlRequest.log.error( "Could not find element [" + elementName + "] specified in part [" + part.getName()
            + "]" );
    }
View Full Code Here

    {
      cursor.beginElement( elementName );

      if( wsdlContext.hasSchemaTypes() )
      {
        SchemaGlobalElement elm = wsdlContext.getSchemaTypeLoader().findElement( elementName );
        if( elm != null )
        {
          cursor.toFirstChild();
          xmlGenerator.createSampleForType( elm.getType(), cursor );
        }
        else
          log.error( "Could not find element [" + elementName + "] specified in part [" + part.getName() + "]" );
      }
View Full Code Here

            else
              log.warn( "Failed to find type [" + typeName + "]" );
          }
          else
          {
            SchemaGlobalElement element = wsdlContext.getSchemaTypeLoader().findElement( part.getElementName() );
            if( element != null )
            {
              XmlCursor c = cursor.newCursor();
              c.toLastChild();
              c.insertElement( element.getName() );
              c.toPrevToken();

              xmlGenerator.createSampleForType( element.getType(), c );
              c.dispose();
            }
            else
              log.warn( "Failed to find element [" + part.getElementName() + "]" );
          }
View Full Code Here

            else
              log.warn( "Failed to find type [" + typeName + "]" );
          }
          else
          {
            SchemaGlobalElement element = wsdlContext.getSchemaTypeLoader().findElement( part.getElementName() );
            if( element != null )
            {
              XmlCursor c = cursor.newCursor();
              c.toLastChild();
              c.insertElement( element.getName() );
              c.toPrevToken();

              xmlGenerator.createSampleForType( element.getType(), c );
              c.dispose();
            }
            else
              log.warn( "Failed to find element [" + part.getElementName() + "]" );
          }
View Full Code Here

        javax.wsdl.Part part = message.getPart( header.getPart() );

        if( part != null )
        {
          SchemaType schemaType = WsdlUtils.getSchemaTypeForPart( wsdlContext, part );
          SchemaGlobalElement schemaElement = WsdlUtils.getSchemaElementForPart( wsdlContext, part );
          if( schemaType != null )
            result.add( new WsdlHeaderPart( part.getName(), schemaType, part.getElementName(), schemaElement ) );
        }
        else
          log.error( "Missing part for header; " + header.getPart() );
      }

      // content parts
      javax.wsdl.Part[] parts = WsdlUtils.getOutputParts( bindingOperation );

      for( int i = 0; i < parts.length; i++ )
      {
        javax.wsdl.Part part = parts[i];

        if( !WsdlUtils.isAttachmentOutputPart( part, bindingOperation ) )
        {
          SchemaType schemaType = WsdlUtils.getSchemaTypeForPart( wsdlContext, part );
          SchemaGlobalElement schemaElement = WsdlUtils.getSchemaElementForPart( wsdlContext, part );
          if( schemaType != null )
            result.add( new WsdlContentPart( part.getName(), schemaType, part.getElementName(), schemaElement ) );
        }
      }
View Full Code Here

          if( schemaType.isNoType() )
          {
            SchemaTypeSystem typeSystem = wsdlRequest.getOperation().getInterface().getWsdlContext()
                .getSchemaTypeSystem();
            SchemaGlobalElement schemaElement = typeSystem.findElement( new QName( parentNode.getNamespaceURI(),
                parentNode.getLocalName() ) );
            if( schemaElement != null )
            {
              schemaType = schemaElement.getType();
            }
          }

          String txt = null;
View Full Code Here

    {
        StscState state = StscState.get();

        for (int i = 0 ; i < elts.length ; i++)
        {
            SchemaGlobalElement elt = elts[i];
            SchemaGlobalElement head = elt.substitutionGroup();

            if (head != null)
            {
                SchemaType headType = head.getType();
                SchemaType tailType = elt.getType();
                XmlObject parseTree = ((SchemaGlobalElementImpl)elt)._parseObject;

                if (! headType.isAssignableFrom(tailType))
                {
                    state.error("Element " + QNameHelper.pretty(elt.getName()) +
                        " must have a type that is derived from the type of its substitution group.",
                        XmlErrorContext.INCONSISTENT_TYPE, parseTree);
                   
                }
                else if (head.finalExtension() && head.finalRestriction())
                {
                    state.error("Element " + QNameHelper.pretty(elt.getName()) +
                        " cannot be substituted for element with final='#all'",
                        XmlErrorContext.CANNOT_DERIVE_FINAL, parseTree);
                }
                else if (! headType.equals(tailType))
                {
                    if (head.finalExtension() &&
                             tailType.getDerivationType() == SchemaType.DT_EXTENSION)
                    {
                        state.error("Element " + QNameHelper.pretty(elt.getName()) +
                            " cannot be substituted for element with final='extension'",
                            XmlErrorContext.CANNOT_DERIVE_FINAL, parseTree);
                    }
                    else if (head.finalRestriction() &&
                             tailType.getDerivationType() == SchemaType.DT_RESTRICTION)
                    {
                        state.error("Element " + QNameHelper.pretty(elt.getName()) +
                            " cannot be substituted for element with final='restriction'",
                            XmlErrorContext.CANNOT_DERIVE_FINAL, parseTree);
View Full Code Here

            QName typeQName = globalType.getName();
            addSchemaType(typeQName, globalType, false, qnameMap);
        }
        SchemaGlobalElement[] globalElements = schemaTypeSystem.globalElements();
        for (int i = 0; i < globalElements.length; i++) {
            SchemaGlobalElement globalElement = globalElements[i];
            addElement(globalElement, null, qnameMap);
        }
        return qnameMap;
    }
View Full Code Here

                            "Element substitution not allowed when group head has block='substitution'", name);
                        _eatContent = 1;
                        return;
                    }

                    SchemaGlobalElement newField = _globalTypes.findElement(name);

                    if (XmlBeans.ASSERTS)
                        XmlBeans.assertTrue(newField != null);

                    if (newField != null)
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.SchemaGlobalElement$Ref

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.