Package org.apache.ws.resource

Examples of org.apache.ws.resource.InvalidWsrfWsdlException


               schemaUrl    = new URL( baseUrl, location );
               schemaDoc    = JaxpUtils.loadDocument( schemaUrl.openStream(  ) );
            }
            catch ( Exception e )
            {
               throw new InvalidWsrfWsdlException( "Failed to load schema at location " + location );
            }

            xsdElementElem =
               getXsdElementElementRecursively( schemaDoc.getDocumentElement(  ),
                                                xsdElemName,
View Full Code Here


      if ( hasProperties(  ) )
      {
         if ( !m_implementedResourceDefs.containsKey( org.apache.ws.resource.properties.v2004_11.porttype.GetResourcePropertyPortType.NAME )
              && !m_implementedResourceDefs.containsKey( org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortType.NAME ) )
         {
            throw new InvalidWsrfWsdlException( "PortType " + m_portType.getQName(  )
                                                + " defines a wsrp:ResourceProperties attribute but does not implement the WSRF-RP GetResourceProperty portType." );
         }
      }
      else
      {
         Iterator resourceDefNames = m_implementedResourceDefs.keySet(  ).iterator(  );
         while ( resourceDefNames.hasNext(  ) )
         {
            QName resourceDefName = (QName) resourceDefNames.next(  );
            if ( resourceDefName.getNamespaceURI(  ).equals( org.apache.ws.resource.properties.v2004_11.ResourcePropertiesConstants.NSURI_WSRP_WSDL )
                 || resourceDefName.getNamespaceURI(  ).equals( org.apache.ws.resource.properties.v2004_06.ResourcePropertiesConstants.NSURI_WSRP_WSDL ) )
            {
               throw new InvalidWsrfWsdlException( "PortType " + m_portType.getQName(  )
                                                   + " does not define a wsrp:ResourceProperties attribute but implements one or more WSRF-RP portTypes." );
            }
         }
      }
   }
View Full Code Here

         }
      }

      if ( !isValid )
      {
         throw new InvalidWsrfWsdlException( "PortType " + m_portType.getQName(  )
                                             + " does not define one or more properties required by the portTypes it implements." );
      }
   }
View Full Code Here

               baseUrl = new URL( m_baseUrl,
                                  imports[i].getLocationURI(  ) );
            }
            catch ( MalformedURLException e )
            {
               throw new InvalidWsrfWsdlException( "Invalid import location " + imports[i].getLocationURI(  ) );
            }

            importedResourceDefs.add( new ResourceCapabilityImpl( def, portType, baseUrl ) );
         }
      }
View Full Code Here

         }
      }

      if ( rpDocXsdElem == null )
      {
         throw new InvalidWsrfWsdlException( "Unable to locate the ResourceProperties document element with QName "
                                             + rpDocElemName );
      }

      QName   type          = getQualifiedAttribute( rpDocXsdElem, "type" );
      Element rpDocTypeElem;
      if ( type != null )
      {
         if ( !type.getNamespaceURI(  ).equals( rpDocXsdElem.getSchemaElement(  ).getAttribute( "targetNamespace" ) ) )
         {
            throw new InvalidWsrfWsdlException( "This tool currently does not support referencing a ResourceProperties complexType that is not in the current schema's targetNamespace." );
         }

         rpDocTypeElem = getComplexTypeByName( rpDocXsdElem.getSchemaElement(  ),
                                               type.getLocalPart(  ) );
      }
      else
      {
         rpDocTypeElem =
            (Element) rpDocXsdElem.getElement(  )
                                  .getElementsByTagNameNS( XmlConstants.NSURI_SCHEMA_XSD, "complexType" ).item( 0 );
      }

      if ( rpDocTypeElem == null )
      {
         throw new InvalidWsrfWsdlException( "Unable to determine type of the ResourceProperties document element with QName "
                                             + rpDocElemName
                                             + " - expected either a type atribute or a nested anonymous complexType element." );
      }

      Element  sequenceElem  = null;
      NodeList sequenceNodes = rpDocTypeElem.getElementsByTagNameNS( XmlConstants.NSURI_SCHEMA_XSD, "sequence" );
      if ( sequenceNodes != null )
      {
         sequenceElem = (Element) sequenceNodes.item( 0 );
      }
      else
      {
         sequenceNodes = rpDocTypeElem.getElementsByTagNameNS( XmlConstants.NSURI_SCHEMA_XSD, "all" );
         if ( sequenceNodes != null )
         {
            sequenceElem = (Element) sequenceNodes.item( 0 );
         }
      }

      if ( sequenceElem == null )
      {
         throw new RuntimeException( "Resource property element definitions must be contained in an xsd:sequence or an xsd:all element." );
      }

      NodeList propElems = sequenceElem.getElementsByTagNameNS( XmlConstants.NSURI_SCHEMA_XSD, "element" );
      for ( int j = 0; j < propElems.getLength(  ); j++ )
      {
         Element propElem = (Element) propElems.item( j );
         QName   propName =
            getQualifiedAttribute( new XsdElement( propElem,
                                                   rpDocXsdElem.getSchemaElement(  ) ),
                                   "ref" );
         if ( propName == null )
         {
            throw new InvalidWsrfWsdlException( "All element defs within the resource property document def must have a 'ref' attribute that points at a global element def." );
         }

         propNames.add( propName );
      }
View Full Code Here

      {
         propName = toQName( value, prefixResolver );
      }
      catch ( PrefixResolutionException pre )
      {
         throw new InvalidWsrfWsdlException( "Unable to resolve prefix '" + pre.getPrefix(  )
                                             + "' in xsd:element '" + attribName + "' attribute value." );
      }
      catch ( InvalidValueException ive )
      {
         throw new InvalidWsrfWsdlException( "Value for xsd:element 'ref' attribute must be qualified via a namespace prefix." );
      }

      return propName;
   }
View Full Code Here

               schemaUrl    = new URL( baseUrl, location );
               schemaDoc    = JaxpUtils.loadDocument( schemaUrl.openStream(  ) );
            }
            catch ( Exception e )
            {
               throw new InvalidWsrfWsdlException( "Failed to load schema at location " + location );
            }

            xsdElementElem =
               getXsdElementElementRecursively( schemaDoc.getDocumentElement(  ),
                                                xsdElemName,
View Full Code Here

      if ( binding != null )
      {
         PortType portType = binding.getPortType(  );
         if ( portType == null )
         {
            throw new InvalidWsrfWsdlException( "The binding has no portType associated with it!" );
         }

         return portType;
      }
      else
      {
         throw new InvalidWsrfWsdlException( "The port has no binding associated with it!" );
      }
   }
View Full Code Here

         }
      }

      if ( endpointURL == null )
      {
         throw new InvalidWsrfWsdlException( "Failed to obtain service endpoint URL from port " + m_name
                                             + " service's wsdl:port/soap:address/@location attribute" );
      }

      return endpointURL;
   }
View Full Code Here

   {
      m_def            = def;
      m_portType       = portType;
      if ( m_portType.isUndefined(  ) )
      {
         throw new InvalidWsrfWsdlException( "The portType: " + m_portType.getQName(  )
                                             + " is undefined in your WSDL.  Please check the name of your wsdl:portType and its reference in the wsdl:binding." );
      }

      m_baseUrl        = baseURL;
      m_bindingName    = getBindingName( def,
View Full Code Here

TOP

Related Classes of org.apache.ws.resource.InvalidWsrfWsdlException

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.