Package org.apache.wsdl

Examples of org.apache.wsdl.WSDLEndpoint


                }

                /*
                 * Setting the policy of the operation
                 */
                WSDLEndpoint endpoint = infoHolder.getPort();

                if (endpoint != null) {
                  Policy policy = attachmentUtil.getOperationPolicy(endpoint.getName(), operation.getName());

                  if (policy != null) {
                    addAttribute(doc, "policy", PolicyUtil.getPolicyAsString(policy), methodElement);
                  }
                }


                methodElement.appendChild(getInputElement(doc, operation, soapHeaderInputParameterList));
                methodElement.appendChild(getOutputElement(doc, operation, soapHeaderOutputParameterList));
                rootElement.appendChild(methodElement);
                //////////////////////
            }else{
                //mep is present - we move ahead only if the given mep matches the mep of this operation

                if (mep.equals(operation.getMessageExchangePattern())){
                    //at this point we know it's true
                    opsFound = true;
                    List soapHeaderInputParameterList = new ArrayList();
                    List soapHeaderOutputParameterList = new ArrayList();
                    methodElement = doc.createElement("method");
                    String localPart = operation.getName().getLocalPart();

                    addAttribute(doc, "name", localPart, methodElement);
                    addAttribute(doc, "namespace", operation.getName().getNamespaceURI(), methodElement);
                    addAttribute(doc, "style", operation.getStyle(), methodElement);
                    addAttribute(doc, "dbsupportname", portTypeName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
                            methodElement);

                    addAttribute(doc, "mep", operation.getMessageExchangePattern(), methodElement);

                    if (null != binding) {
                        WSDLBindingOperation bindingOperation = binding.getBindingOperation(operation.getName());

                        // todo This can be a prob !!!!!
                        if (bindingOperation != null) {
                            addSOAPAction(doc, methodElement, bindingOperation);
                            addHeaderOperations(soapHeaderInputParameterList, bindingOperation, true);
                            addHeaderOperations(soapHeaderOutputParameterList, bindingOperation, false);
                        }
                    }

                    /*
                     * Setting the policy of the operation
                     */
                    WSDLEndpoint endpoint = infoHolder.getPort();
                    Policy policy = attachmentUtil.getOperationPolicy(endpoint.getName(), operation.getName());

                    if (policy != null) {
                      addAttribute(doc, "policy", PolicyUtil.getPolicyAsString(policy), methodElement);
                    }

View Full Code Here


        // start with the service
        Map services = wsdlDescription.getServices();

        if ((services != null) && !services.isEmpty()) {
            WSDLService selectedService;
            WSDLEndpoint selectedEndpoint;

            if (services.size() > 1) {

                // look for the users setting here
                if (configuration.getServiceName() != null) {
                    selectedService = wsdlDescription.getService(new QName(configuration.getWom().getTargetNameSpace(),
                            configuration.getServiceName()));

                    if (selectedService == null) {
                        throw new RuntimeException(CodegenMessages.getMessage("emitter.serviceNotFoundError",
                                configuration.getServiceName()));
                    }
                } else {

                    // print warning
                    System.out.println(CodegenMessages.getMessage("emitter.warningMultipleServices"));
                    // note - we are sure of no NPE's here
                    selectedService = (WSDLService) services.values().iterator().next();
                }
            } else {
                // note - we are sure of no NPE's here
                selectedService = (WSDLService) services.values().iterator().next();
            }

            infoHolder.setService(selectedService);

            // get the ports from the service
            Map endpoints = selectedService.getEndpoints();

            if ((endpoints != null) && !endpoints.isEmpty()) {
                if (endpoints.size() > 1) {

                    // look for the users setting here
                    if (configuration.getPortName() != null) {
                        selectedEndpoint =
                                selectedService.getEndpoint(new QName(configuration.getWom().getTargetNameSpace(),
                                        configuration.getPortName()));

                        if (selectedEndpoint == null) {
                            throw new RuntimeException(CodegenMessages.getMessage("emitter.endpointNotFoundError"));
                        }
                    } else {
                        System.out.println(CodegenMessages.getMessage("emitter.warningMultipleEndpoints"));
                        selectedEndpoint = (WSDLEndpoint) endpoints.values().iterator().next();
                    }
                } else {
                    selectedEndpoint = (WSDLEndpoint) endpoints.values().iterator().next();
                }

                infoHolder.setPort(selectedEndpoint);

                WSDLBinding binding = selectedEndpoint.getBinding();

                infoHolder.setBinding(binding);
                infoHolder.setWSDLinterface(binding.getBoundInterface());
            } else {
View Full Code Here

     *
     * @param doc
     * @param rootElement
     */
    protected void addEndpoint(Document doc, Element rootElement) throws Exception {
        WSDLEndpoint endpoint = infoHolder.getPort();

        // attach the policy for this endpoint here
        //            String policyFileResourceName = null;
        //            Policy policy =  (Policy)endpointPolicyMap.get(endpoint.getName());
        //            if (policy!=null){
        //                //process the policy for this end point
        //                 policyFileResourceName = processPolicy(policy,endpoint.getName().getLocalPart());
        //
        //            }
        Element endpointElement = doc.createElement("endpoint");
        org.apache.wsdl.extensions.SOAPAddress address = null;
        Iterator iterator = endpoint.getExtensibilityElements().iterator();

        while (iterator.hasNext()) {
            WSDLExtensibilityElement element = (WSDLExtensibilityElement) iterator.next();

            if (ExtensionConstants.SOAP_11_ADDRESS.equals(element.getType())
View Full Code Here

        // start with the service
        Map services = wsdlDescription.getServices();

        if ((services != null) && !services.isEmpty()) {
            WSDLService selectedService;
            WSDLEndpoint selectedEndpoint;

            if (services.size() > 1) {

                // look for the users setting here
                if (configuration.getServiceName() != null) {
                    selectedService = wsdlDescription.getService(new QName(configuration.getWom().getTargetNameSpace(),
                            configuration.getServiceName()));

                    if (selectedService == null) {
                        throw new RuntimeException(CodegenMessages.getMessage("emitter.serviceNotFoundError",
                                configuration.getServiceName()));
                    }
                } else {

                    // print warning
                    System.out.println(CodegenMessages.getMessage("emitter.warningMultipleServices"));
                    // note - we are sure of no NPE's here
                    selectedService = (WSDLService) services.values().iterator().next();
                }
            } else {
                // note - we are sure of no NPE's here
                selectedService = (WSDLService) services.values().iterator().next();
            }

            infoHolder.setService(selectedService);

            // get the ports from the service
            Map endpoints = selectedService.getEndpoints();

            if ((endpoints != null) && !endpoints.isEmpty()) {
                if (endpoints.size() > 1) {

                    // look for the users setting here
                    if (configuration.getPortName() != null) {
                        selectedEndpoint =
                                selectedService.getEndpoint(new QName(configuration.getWom().getTargetNameSpace(),
                                        configuration.getPortName()));

                        if (selectedEndpoint == null) {
                            throw new RuntimeException(CodegenMessages.getMessage("emitter.endpointNotFoundError"));
                        }
                    } else {
                        System.out.println(CodegenMessages.getMessage("emitter.warningMultipleEndpoints"));
                        selectedEndpoint = (WSDLEndpoint) endpoints.values().iterator().next();
                    }
                } else {
                    selectedEndpoint = (WSDLEndpoint) endpoints.values().iterator().next();
                }

                infoHolder.setPort(selectedEndpoint);

                WSDLBinding binding = selectedEndpoint.getBinding();

                infoHolder.setBinding(binding);
                infoHolder.setPorttype(binding.getBoundInterface());
            } else {
View Full Code Here

     * otherwise will return null.
     */
    public OperationDescription getOperationBySOAPAction(String soapAction){
        Iterator iterator = this.getEndpoints().keySet().iterator();
        if(iterator.hasNext()){
            WSDLEndpoint endpoint = (WSDLEndpoint)this.getEndpoints().get(iterator.next());
            return this.getOperationBySOAPAction(soapAction, endpoint.getName());
        }

        return null;


View Full Code Here

TOP

Related Classes of org.apache.wsdl.WSDLEndpoint

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.