Examples of EndpointElement


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

            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

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

  // 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

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

  {
    /* 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

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

      // 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

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

            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

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

            DOMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                                       Constants.ELEM_ENDPOINT,
                                       des);
        for(int ind=0;ind<endpoints.length;ind++){

            EndpointElement endPoint=endpoints[ind];
            if(endPoint!=null){

                pw.print("    <" + tagName);
                NCName ncName=endPoint.getName();
                if(ncName!=null){
                    String name=ncName.toString();
                    DOMUtils.printAttribute(Constants.ATTR_NAME,
                            name, pw);
                   
                }               

                BindingElement binding =endPoint.getBindingElement();
                if (binding != null){
                    DOMUtils.printQualifiedAttribute(Constants.ATTR_BINDING,
                            binding.getName(),
                            des,
                            pw);
                }

                URI address =endPoint.getAddress();
                if (address != null){
                    DOMUtils.printAttribute(Constants.ATTR_ADDRESS,
                            address.toString(),
                            pw);
                }
                printExtensibilityAttributes(endPoint.getExtensionAttributes(), endPoint, pw);
                pw.println('>');
                printDocumentation(endPoint.getDocumentationElements(), des, pw);
                printExtensibilityElements(endPoint.getClass(), endPoint.getExtensionElements(), des, pw);
                pw.println("    </" + tagName + '>');
            }
        }
      }
View Full Code Here

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

            OMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                                       Constants.ELEM_ENDPOINT,
                                       des);
        for(int ind=0;ind<endpoints.length;ind++){

            EndpointElement endPoint=endpoints[ind];
            if(endPoint!=null){

                pw.print("    <" + tagName);
                NCName ncName=endPoint.getName();
                if(ncName!=null){
                    String name=ncName.toString();
                    OMUtils.printAttribute(Constants.ATTR_NAME,
                            name, pw);
                   
                }
               
                BindingElement binding =endPoint.getBindingElement();
                if (binding != null){
                    OMUtils.printQualifiedAttribute(Constants.ATTR_BINDING,
                            binding.getName(),
                            des,
                            pw);
                }

                URI address =endPoint.getAddress();
                if (address != null){
                    OMUtils.printAttribute(Constants.ATTR_ADDRESS,
                            address.toString(),
                            pw);
                }


                printExtensibilityAttributes(endPoint.getExtensionAttributes(), endPoint, pw);
                pw.println('>');
                printDocumentation(endPoint.getDocumentationElements(), des, pw);
                printExtensibilityElements(endPoint.getClass(), endPoint.getExtensionElements(), des, pw);
                pw.println("    </" + tagName + '>');
            }
        }  
      }
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.