Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.SchemaGlobalElement


    public SchemaGlobalElement findElement(QName name)
    {
        SchemaGlobalElement.Ref ref = findElementRef(name);
        if (ref == null)
            return null;
        SchemaGlobalElement result = ref.get();
        assert(result != null);
        return result;
    }
View Full Code Here


                        }
                        return null;
                    }
                    else
                    {
                        SchemaGlobalElement elt = findElement(QNameHelper.forLNS(part.substring(offset), uri));
                        if (elt == null)
                            return null;
                        curType = elt.getType();
                    }
                    break;

                case 'A':
                case 'Q': // distinguish qualified/unqualified TBD
View Full Code Here

          {
            QName typeName = part.getTypeName();
            if( typeName == null )
            {
              typeName = partName;
              SchemaGlobalElement type = wsdlContext.getSchemaTypeLoader().findElement( typeName );

              if( type != null )
              {
                messageParts.add( new MessageXmlPart( children[0], type.getType(), part, bindingOperation,
                    isRequest ) );
              }
              else
                log.error( "Missing element [" + typeName + "] in associated schema for part ["
                    + part.getName() + "]" );
            }
            else
            {
              SchemaType type = wsdlContext.getSchemaTypeLoader().findType( typeName );
              if( type != null )
              {
                messageParts.add( new MessageXmlPart( children[0], type, part, bindingOperation, isRequest ) );
              }
              else
                log.error( "Missing type [" + typeName + "] in associated schema for part [" + part.getName()
                    + "]" );
            }
          }
        }
      }
    }
    else
    {
      Part part = inputParts[0];
      QName elementName = part.getElementName();
      if( elementName != null )
      {
        // just check for correct message element, other elements are
        // avoided (should create an error)
        XmlObject[] paths = msgXml.selectPath( "declare namespace env='"
            + wsdlContext.getSoapVersion().getEnvelopeNamespace() + "';" + "declare namespace ns='"
            + elementName.getNamespaceURI() + "';" + "$this/env:Envelope/env:Body/ns:"
            + elementName.getLocalPart() );

        if( paths.length == 1 )
        {
          SchemaGlobalElement elm = wsdlContext.getSchemaTypeLoader().findElement( elementName );
          if( elm != null )
          {
            messageParts.add( new MessageXmlPart( paths[0], elm.getType(), part, bindingOperation, isRequest ) );
          }
          else
            throw new Exception( "Missing part type in associated schema" );
        }
        else
View Full Code Here

          if( context.hasSchemaTypes() )
          {
            schemaType = context.getSchemaTypeSystem().findDocumentType( getElement() );
            if( schemaType == null )
            {
              SchemaGlobalElement element = context.getSchemaTypeSystem().findElement( getElement() );
              if( element != null )
              {
                schemaType = element.getType();
              }
            }
          }
        }
      }
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.getInputParts( bindingOperation );

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

        if( !WsdlUtils.isAttachmentInputPart( 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

        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( resultType.isNoType() )
          {
            SchemaGlobalElement elm = typeSystem.findElement( nm );
            if( elm != null )
            {
              resultType = elm.getType();
            }
            else if( typeSystem.findDocumentType( nm ) != null )
            {
              resultType = typeSystem.findDocumentType( nm );
            }
View Full Code Here

          {
            QName typeName = part.getTypeName();
            if( typeName == null )
            {
              typeName = partName;
              SchemaGlobalElement type = wsdlContext.getSchemaTypeLoader().findElement( typeName );

              if( type != null )
              {
                result.add( children[0].copy().changeType( type.getType() ) );
              }
              else
                log.error( "Missing element [" + typeName + "] in associated schema for part ["
                    + part.getName() + "]" );
            }
            else
            {
              SchemaType type = wsdlContext.getSchemaTypeLoader().findType( typeName );
              if( type != null )
              {
                result.add( children[0].copy().changeType( type ) );
              }
              else
                log.error( "Missing type [" + typeName + "] in associated schema for part [" + part.getName()
                    + "]" );
            }
          }
        }
      }
    }
    else
    {
      Part part = parts[0];
      QName elementName = part.getElementName();
      if( elementName != null )
      {
        // just check for correct message element, other elements are
        // avoided (should create an error)
        XmlObject[] paths = msgXml.selectPath( "declare namespace env='"
            + wsdlContext.getSoapVersion().getEnvelopeNamespace() + "';" + "declare namespace ns='"
            + elementName.getNamespaceURI() + "';" + "$this/env:Envelope/env:Body/ns:"
            + elementName.getLocalPart() );

        if( paths.length == 1 )
        {
          SchemaGlobalElement elm = wsdlContext.getSchemaTypeLoader().findElement( elementName );
          if( elm != null )
          {
            result.add( paths[0].copy().changeType( elm.getType() ) );
          }
          else
            throw new Exception( "Missing part type in associated schema" );
        }
        else
View Full Code Here

          + wsdlContext.getSoapVersion().getEnvelopeNamespace() + "';" + "declare namespace ns='"
          + elementName.getNamespaceURI() + "';" + "$this/env:Envelope/env:Body/ns:" + elementName.getLocalPart() );

      if( paths.length == 1 )
      {
        SchemaGlobalElement elm = wsdlContext.getSchemaTypeLoader().findElement( elementName );
        if( elm != null )
        {
          validateMessageBody( errors, elm.getType(), paths[0] );

          // ensure no other elements in body
          NodeList children = XmlUtils.getChildElements( ( Element )paths[0].getDomNode().getParentNode() );
          for( int c = 0; c < children.getLength(); c++ )
          {
View Full Code Here

                + bindingOperation.getName() + ( isResponse ? "Response" : "" ) + "/ns2:"
                + elementName.getLocalPart() );

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

TOP

Related Classes of org.apache.xmlbeans.SchemaGlobalElement

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.