Package org.apache.woden.wsdl20.xml

Examples of org.apache.woden.wsdl20.xml.EndpointElement


    }
   
    protected void validateWsdl2(HttpSoapProviderMarshaler marshaler) throws
                                  org.apache.woden.WSDLException, IOException, DeploymentException {
        WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
        DescriptionElement descElement = reader.readWSDL(wsdl.getURL().toString());
        Description desc = descElement.toComponent();
        org.apache.woden.wsdl20.Service svc;
        if (getService() != null) {
            svc = desc.getService(getService());
            if (svc == null) {
                throw new DeploymentException("Could not find service '" + getService() + "' in wsdl");
View Full Code Here


    }

    private void validateWsdl2(JmsSoapConsumerMarshaler marshaler) throws org.apache.woden.WSDLException, IOException,
            DeploymentException {
        WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
        DescriptionElement descElement = reader.readWSDL(wsdl.getURL().toString());
        Description desc = descElement.toComponent();
        org.apache.woden.wsdl20.Service svc;
        if (getService() != null) {
            svc = desc.getService(getService());
            if (svc == null) {
                throw new DeploymentException("Could not find service '" + getService() + "' in wsdl");
View Full Code Here

            description = readInTheWSDLFile(fullPath);
        } catch (AxisFault axisFault) {
            throw new WSDLException("ERROR", "Exception occured while reading WSDL 2.0 doc", axisFault);
        }

        DescriptionElement descriptionElement = description.toElement();
        savedTargetNamespace = descriptionElement.getTargetNamespace()
                .toString();
        namespacemap = descriptionElement.getDeclaredNamespaces();
        this.description = description;
        this.serviceName = null;
        if (name != null) {
            serviceName = new QName(descriptionElement.getTargetNamespace().toString(), name);
        }
        this.interfaceName = interfaceName;
        this.axisService = new AxisService();
        setPolicyRegistryFromService(axisService);
    }
View Full Code Here

            // null));
            // }
            //
            // }

            DescriptionElement descriptionElement = description.toElement();
            TypesElement typesElement = descriptionElement
                    .getTypesElement();
            if (typesElement != null) {
                Schema[] schemas = typesElement.getSchemas();
                for (int i = 0; i < schemas.length; i++) {
                    XmlSchema schemaDefinition = schemas[i].getSchemaDefinition();
View Full Code Here

        }
        try {
            if (description == null) {

                Description description;
                DescriptionElement descriptionElement;
                if (wsdlURI != null && !"".equals(wsdlURI)) {
                    description = readInTheWSDLFile(wsdlURI);
                    descriptionElement = description.toElement();
                } else if (in != null) {
                    description = readInTheWSDLFile(in);
                    descriptionElement = description.toElement();
                } else {
                    throw new AxisFault("No resources found to read the wsdl");
                }

                savedTargetNamespace = descriptionElement.getTargetNamespace().toString();
                namespacemap = descriptionElement.getDeclaredNamespaces();
                this.description = description;

            }
            // Create the namespacemap
View Full Code Here

     */
    private void addDocumentation(AxisDescription axisDescription, DocumentableElement element) {
        DocumentationElement[] documentationElements = element.getDocumentationElements();
        String documentation = "";
        for (int i = 0; i < documentationElements.length; i++) {
            DocumentationElement documentationElement = documentationElements[i];
            XMLElement contentElement = documentationElement.getContent();
            Element content = (Element)contentElement.getSource();
            if (content != null) {
                documentation = documentation + DOM2Writer.nodeToString(content.getFirstChild());
            }
        }
View Full Code Here

            XMLElement endpointEl,
            DescriptionElement desc,
            ServiceElement parent)
            throws WSDLException {

        EndpointElement endpoint = parent.addEndpointElement();

        String name = endpointEl.getAttributeValue(Constants.ATTR_NAME);
        if(name != null)
        {
            endpoint.setName(new NCName(name));
        }

        QName bindingQN = null;
        String binding = endpointEl.getAttributeValue(Constants.ATTR_BINDING);
        if(binding != null)
        {
            try {
                bindingQN = endpointEl.getQName(binding);
                endpoint.setBindingName(bindingQN);
            } catch (WSDLException e) {
                getErrorReporter().reportError(
                        new ErrorLocatorImpl()//TODO line&col nos.
                        "WSDL505",
                        new Object[] {binding, endpointEl.getQName()},
                        ErrorReporter.SEVERITY_ERROR);
            }
        }

        String address = endpointEl.getAttributeValue(Constants.ATTR_ADDRESS);

        if(address != null)
        {
            endpoint.setAddress(getURI(address));
        }

        parseExtensionAttributes(endpointEl, EndpointElement.class, endpoint, desc);

        /* Parse the child elements of <endpoint>.
         * As per WSDL 2.0 spec, they must be in the following order if present:
         * <documentation>
         * extension elements in any order
         * TODO validate that the elements are in correct order
         */

        XMLElement[] children = endpointEl.getChildElements();
        XMLElement tempEl = null;
        QName tempElQN = null;

        for(int i=0; i<children.length; i++)
        {
            tempEl = children[i];
            tempElQN = tempEl.getQName();

            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
            {
                parseDocumentation(tempEl, desc, endpoint);
            }
            else
            {
                endpoint.addExtensionElement(
                        parseExtensionElement(EndpointElement.class, endpoint, tempEl, desc) );
            }
        }

        return endpoint;
View Full Code Here

  // Test that the assertion returns true for an endpoint with no binding defined.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      ServiceElement service = descEl.addServiceElement();
    EndpointElement endpoint = service.addEndpointElement();
    if(!val.testAssertionEndpoint1062(descEl.toComponent().getServices()[0].getEndpoints()[0], reporter))
    {
      fail("The testAssertionEndpoint1062 method returned false for an endpoint with no binding defined.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
    /* (jkaputin) ditto the comment above for the first test case (NPE on getParent)
  // Test that the assertion returns true for an endpoint with no parent defined.
  try
  {
    EndpointImpl endpoint = new EndpointImpl();
    BindingElement binding = descEl.createBindingElement();
      binding.setName(name1);
    endpoint.setBindingName(name1);
    if(!val.testAssertionEndpoint0066(endpoint, reporter))
    {
      fail("The testAssertionEndpoint0066 method returned false for an endpoint with no parent defined.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
    */
 
  // Test that the assertion returns true for an endpoint that specifies a binding with no interface specified.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      ServiceElement service = descEl.addServiceElement();
      service.setInterfaceName(name1QN);
      EndpointElement endpoint = service.addEndpointElement();
      endpoint.setBindingName(name2QN);
    if(!val.testAssertionEndpoint1062(descEl.toComponent().getServices()[0].getEndpoints()[0], reporter))
    {
      fail("The testAssertionEndpoint1062 method returned false for an endpoint that specifies a binding with no specified interface.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true for an endpoint that specifies a binding with the same interface
  // as the parent service specified.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      ServiceElement service = descEl.addServiceElement();
      service.setInterfaceName(name1QN);
      EndpointElement endpoint = service.addEndpointElement();
      endpoint.setBindingName(name2QN);
    if(!val.testAssertionEndpoint1062(descEl.toComponent().getServices()[0].getEndpoints()[0], reporter))
    {
      fail("The testAssertionEndpoint1062 method returned false for an endpoint that specifies a binding with the same interface specified as the parent service specifies.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false for an endpoint that specifies a binding with a different interface
  // than the parent service specified.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
    InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceElement interfac2 = descEl.addInterfaceElement();
      interfac2.setName(name2);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name3);
      binding.setInterfaceName(name2QN);
      ServiceElement service = descEl.addServiceElement();
      service.setInterfaceName(name1QN);
      EndpointElement endpoint = service.addEndpointElement();
      endpoint.setBindingName(name3QN);
    if(val.testAssertionEndpoint1062(descEl.toComponent().getServices()[0].getEndpoints()[0], reporter))
    {
      fail("The testAssertionEndpoint1062 method returned true for an endpoint that specifies a binding with a different interface specified than the parent service specifies.");
    }
  }
View Full Code Here

  {
    /* Set up prereqs:
     * - Service with > 1 endpoints created.
     */
    ServiceElement fServiceElement = new ServiceImpl();
    EndpointElement fEndpointElement1 = fServiceElement.addEndpointElement();
    fEndpointElement1.setName(new NCName("endpoint1"));
    EndpointElement fEndpointElement2 = fServiceElement.addEndpointElement();
    fEndpointElement2.setName(new NCName("endpoint2"));   
    Service fService = (Service) fServiceElement;
   
    // test getEndpoint()
    Endpoint e1 = fService.getEndpoint(new NCName("endpoint1"));
    assertEquals("The retrieved Endpoint object is not that which was set", e1, fEndpointElement1);
View Full Code Here

      // Service... (attach our Endpoint to a Service parented by our Description)
      ServiceElement fServiceElement = fDescElement.addServiceElement();
      fServiceElement.setName(fServiceNCName);
     
      // Endpoint...
      EndpointElement fEndpointElement = fServiceElement.addEndpointElement();
      fEndpointElement.setName(fEndpointNCname);
        fEndpointElement.setBindingName(fBindingQName);
     
      // Component model creation
        Description fDesc = fDescElement.toComponent();
        Endpoint fDerivedEndpoint = fDesc.getService(fServiceQName).getEndpoint(fEndpointNCname);
       
View Full Code Here

TOP

Related Classes of org.apache.woden.wsdl20.xml.EndpointElement

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.