Package org.apache.woden.wsdl20

Examples of org.apache.woden.wsdl20.Service


            }
            // Messages
            InterfaceMessageReference[] iMsgRefs = wsdlOperation.getInterfaceMessageReferences();
            for (int j = 0; j < iMsgRefs.length; j++) {
                // Retrieve binding and extension
                InterfaceMessageReference iMsgRef = iMsgRefs[j];
                BindingMessageReference bMsgRef = findBindingMessage(wsdlBindingOperation, iMsgRef);
                HTTPBindingMessageReferenceExtensions msgExt = bMsgRef != null ? (HTTPBindingMessageReferenceExtensions) bMsgRef.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP) : null;
                // Create message
                Wsdl2HttpMessageImpl message = new Wsdl2HttpMessageImpl();
                // Standard WSDL2 attributes
                message.setContentModel(ContentModel.parse(iMsgRef.getMessageContentModel()));
                message.setElementName(iMsgRef.getElementDeclaration().getName());
                if (!XSD_2001_SYSTEM.equals(iMsgRef.getElementDeclaration().getSystem())) {
                    throw new IllegalStateException("Unsupported type system: " + iMsgRef.getElementDeclaration().getSystem());
                }
                if (Constants.API_APACHE_WS_XS.equals(iMsgRef.getElementDeclaration().getContentModel())) {
                    XmlSchemaElement xsEl = (XmlSchemaElement) iMsgRef.getElementDeclaration().getContent();
                    message.setElementDeclaration(xsEl);
                }
                // HTTP extensions
                if (msgExt != null) {
                    message.setHttpTransferCoding(msgExt.getHttpTransferCoding());
                    HTTPHeader[] headers = msgExt.getHttpHeaders();
                    for (int k = 0; k < headers.length; k++) {
                        Wsdl2HttpHeaderImpl h = new Wsdl2HttpHeaderImpl();
                        h.setName(headers[k].getName());
                        h.setRequired(headers[k].isRequired() ? headers[k].isRequired().booleanValue() : false);
                        if (!XSD_2001_SYSTEM.equals(headers[k].getTypeDefinition().getSystem())) {
                            throw new IllegalStateException("Unsupported type system: " + headers[k].getTypeDefinition().getSystem());
                        }
                        h.setType(headers[k].getTypeDefinition().getName());
                        message.addHttpHeader(h);
                    }
                }
                // Add the message
                if (iMsgRef.getDirection() == Direction.IN) {
                    operation.setInput(message);
                } else if (iMsgRef.getDirection() == Direction.OUT) {
                    operation.setOutput(message);
                } else {
                    throw new IllegalStateException("Unsupported message direction: " + iMsgRef.getDirection());
                }
            }
            // Faults
            InterfaceFaultReference[] faults = wsdlOperation.getInterfaceFaultReferences();
            for (int j = 0; j < faults.length; j++) {
View Full Code Here


        binding.setLocation(wsdlEndpoint.getAddress().toString());
        Interface wsdlInterface = wsdlEndpoint.getBinding().getInterface();
        InterfaceOperation[] wsdlOperations = wsdlInterface.getInterfaceOperations();
        for (int i = 0; i < wsdlOperations.length; i++) {
            // Retrieve binding and extension
            InterfaceOperation wsdlOperation = wsdlOperations[i];
            BindingOperation wsdlBindingOperation = findBindingOperation(wsdlEndpoint.getBinding(), wsdlOperation);
            HTTPBindingOperationExtensions opExt = wsdlBindingOperation != null ? (HTTPBindingOperationExtensions) wsdlBindingOperation.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP) : null;
            // Create operation
            Wsdl2HttpOperationImpl operation = new Wsdl2HttpOperationImpl();
            // Standard WSDL2 attributes
            operation.setName(wsdlOperation.getName());
            operation.setMep(wsdlOperation.getMessageExchangePattern());
            operation.setStyle(new HashSet<URI>(Arrays.asList(wsdlOperation.getStyle())));
            // HTTP extensions
            if (opExt != null) {
                operation.setHttpInputSerialization(opExt.getHttpInputSerialization());
                operation.setHttpOutputSerialization(opExt.getHttpOutputSerialization());
                operation.setHttpFaultSerialization(opExt.getHttpFaultSerialization());
                operation.setHttpLocation(extractLocation(wsdlBindingOperation));
                operation.setHttpMethod(opExt.getHttpMethod());
                operation.setHttpTransferCodingDefault(opExt.getHttpTransferCodingDefault());
                operation.setHttpLocationIgnoreUncited(opExt.isHttpLocationIgnoreUncited());
            }
            // Messages
            InterfaceMessageReference[] iMsgRefs = wsdlOperation.getInterfaceMessageReferences();
            for (int j = 0; j < iMsgRefs.length; j++) {
                // Retrieve binding and extension
                InterfaceMessageReference iMsgRef = iMsgRefs[j];
                BindingMessageReference bMsgRef = findBindingMessage(wsdlBindingOperation, iMsgRef);
                HTTPBindingMessageReferenceExtensions msgExt = bMsgRef != null ? (HTTPBindingMessageReferenceExtensions) bMsgRef.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP) : null;
                // Create message
                Wsdl2HttpMessageImpl message = new Wsdl2HttpMessageImpl();
                // Standard WSDL2 attributes
                message.setContentModel(ContentModel.parse(iMsgRef.getMessageContentModel()));
                message.setElementName(iMsgRef.getElementDeclaration().getName());
                if (!XSD_2001_SYSTEM.equals(iMsgRef.getElementDeclaration().getSystem())) {
                    throw new IllegalStateException("Unsupported type system: " + iMsgRef.getElementDeclaration().getSystem());
                }
                if (Constants.API_APACHE_WS_XS.equals(iMsgRef.getElementDeclaration().getContentModel())) {
                    XmlSchemaElement xsEl = (XmlSchemaElement) iMsgRef.getElementDeclaration().getContent();
                    message.setElementDeclaration(xsEl);
                }
                // HTTP extensions
                if (msgExt != null) {
                    message.setHttpTransferCoding(msgExt.getHttpTransferCoding());
                    HTTPHeader[] headers = msgExt.getHttpHeaders();
                    for (int k = 0; k < headers.length; k++) {
                        Wsdl2HttpHeaderImpl h = new Wsdl2HttpHeaderImpl();
                        h.setName(headers[k].getName());
                        h.setRequired(headers[k].isRequired() ? headers[k].isRequired().booleanValue() : false);
                        if (!XSD_2001_SYSTEM.equals(headers[k].getTypeDefinition().getSystem())) {
                            throw new IllegalStateException("Unsupported type system: " + headers[k].getTypeDefinition().getSystem());
                        }
                        h.setType(headers[k].getTypeDefinition().getName());
                        message.addHttpHeader(h);
                    }
                }
                // Add the message
                if (iMsgRef.getDirection() == Direction.IN) {
                    operation.setInput(message);
                } else if (iMsgRef.getDirection() == Direction.OUT) {
                    operation.setOutput(message);
                } else {
                    throw new IllegalStateException("Unsupported message direction: " + iMsgRef.getDirection());
                }
            }
            // Faults
            InterfaceFaultReference[] faults = wsdlOperation.getInterfaceFaultReferences();
            for (int j = 0; j < faults.length; j++) {
                // TODO: handle interface faults references
            }
            // Add the operation
            binding.addOperation(operation);
View Full Code Here

                }
                return null;   // can't go any further without the wsdl
            }
            Service[] services = description.getServices();
            for (int i = 0; i < services.length; i++) {
                Service service = services[i];
                // set the serviceName on the parent to setup call to populateService
                serviceName = service.getName();
                this.axisService = new AxisService();
                    AxisService retAxisService = populateService();
                    if (retAxisService != null) {
                        axisServices.add(retAxisService);
                    } // end if axisService was returned
View Full Code Here

    testAssertionService1060(services, errorReporter);
   
    int numServices = services.length;
    for(int i = 0; i < numServices; i++)
    {
      Service service = services[i];
     
      validateEndpoints(service.getEndpoints(), desc, errorReporter);
    }
  }
View Full Code Here

 
  Interface bindingInterface = binding.getInterface();
  WSDLComponent parent = endpoint.getParent();
  if(parent != null)
  {
    Service service = (Service)parent;
    Interface serviceInterface = service.getInterface();
   
    // If an interface hasn't been specified on the service this assertion doesn't apply.
    // If the binding interface is null this assertion passes.
    if(serviceInterface != null && bindingInterface != null && !serviceInterface.equals(bindingInterface))
    {
View Full Code Here

            System.out.println("Binding[" + j + "] : name = "
                    + bindings[j].getName());
        }

        Service services[] = descComp.getServices();
        System.out.println("There are " + services.length
                + " Service components.");

        for (int j = 0; j < services.length; j++) {
View Full Code Here

        List allServices = new Vector();
       
        //declared services
        for(Iterator i=fServiceElements.iterator(); i.hasNext(); )
        {
            Service service = (Service)i.next();
            if(!containsComponent(service, allServices)) {
                ((ServiceImpl)service).setDescriptionComponent(this);
                allServices.add(service);
            }
        }
       
        //nested services
        List nestedDescs = new Vector(getNestedDescriptions());
        for(Iterator i=nestedDescs.iterator(); i.hasNext(); )
        {
            DescriptionElement desc = (DescriptionElement)i.next();
            ServiceElement[] services = desc.getServiceElements();
            for(int j=0; j<services.length; j++)
            {
                Service service = (Service)services[j];
                if(!containsComponent(service, allServices)) {
                    ((ServiceImpl)service).setDescriptionComponent(this);
                    allServices.add(service);
                }
            }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.woden.wsdl20.Description#getService(javax.xml.namespace.QName)
     */
    public Service getService(QName name)
    {
        Service service = null;
       
        if(name != null)
        {
            Service[] services = getServices();
           
View Full Code Here

    /*
     * (non-Javadoc)
     * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
     */
    public FragmentIdentifier getFragmentIdentifier() {
        Service serviceComp = (Service)getParent();
       
        NCName service = new NCName(serviceComp.getName().getLocalPart());
       
        return new FragmentIdentifier(new EndpointPart(service ,fName));
    }
View Full Code Here

                wsdlURL);
       
        Description descComp = reader.readWSDL(wsdlURL.toString());
        assertNotNull("The reader did not return a WSDL description.", descComp);
       
        Service service = descComp.getServices()[0];
        assertNotNull("The Description should contain 1 Service component.",
                service);
       
        fEndpoints = service.getEndpoints();
        assertEquals("The Service contained unexpected number of Endpoint components.", 3, fEndpoints.length);
    }
View Full Code Here

TOP

Related Classes of org.apache.woden.wsdl20.Service

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.