Examples of PortType


Examples of javax.wsdl.PortType

        this.definition = model.getDefinition();
        this.wmodel = model;
    }

    public void generate() {
        PortType portType = definition.createPortType();
        portType.setQName(new QName(wmodel.getTargetNameSpace(), wmodel.getPortTypeName()));
        portType.setUndefined(false);
        for (JavaMethod method : wmodel.getJavaMethods()) {
            Operation operation = definition.createOperation();
            operation.setName(method.getName());
            operation.setUndefined(false);

            Message inputMessage = null;
            inputMessage = definition.createMessage();
            inputMessage.setQName(new QName(wmodel.getTargetNameSpace(), method.getName()));
            processInputMessage(operation, method, inputMessage);

            Message outputMessage = null;
            if (!method.isOneWay()) {
                outputMessage = definition.createMessage();
                outputMessage.setQName(new QName(wmodel.getTargetNameSpace(), method.getName() + "Response"));
                processOutputMessage(operation, method, outputMessage);
            }

            generateFault(method, operation);

            portType.addOperation(operation);
            definition.addPortType(portType);
        }

    }
View Full Code Here

Examples of javax.wsdl.PortType

        javaModel.setJAXWSBinding(customizing(definition));

        Map portTypes = definition.getPortTypes();

        for (Iterator iter = portTypes.keySet().iterator(); iter.hasNext();) {
            PortType portType = (PortType)portTypes.get(iter.next());
            PortTypeProcessor portTypeProcessor = new PortTypeProcessor(getEnvironment());
            portTypeProcessor.process(javaModel, portType);
        }

        ServiceProcessor serviceProcessor = new ServiceProcessor(env, getWSDLDefinition());
View Full Code Here

Examples of javax.wsdl.PortType

      fact = WSDLFactory.newInstance();
      read = fact.newWSDLReader();
      def = read.readWSDL(wsdlURI);
      map = def.getPortTypes();

      PortType p = new PortTypeImpl() ;
      QName qname = p.getQName();
      //Operation op = p.getOperation(wsdlURI, wsdlURI, wsdlURI);
      //op.getName()

      PortTypeImplm portType;
      OperationImplm operation;
      List<PortTypeImplm> portTypeList = new ArrayList<PortTypeImplm>();
      List<OperationImplm> operationList = new ArrayList<OperationImplm>();

      Set s = map.entrySet();
      Iterator it = s.iterator();
      while(it.hasNext())
          {
              // key=value separator this by Map.Entry to get key and value
              Map.Entry m = (Map.Entry)it.next();

              // getKey is used to get key of Map
              Object key = m.getKey();

              // getValue is used to get value of key in Map
              PortType pType = (PortTypeImpl)m.getValue();

              Operation op ;
              portType = new PortTypeImplm();
              portType.setLocalPart(pType.getQName().getLocalPart());
              for(int i=0; i<pType.getOperations().size(); i++){
                op = (OperationImpl)pType.getOperations().get(i);
                operation = new OperationImplm(op.getName());
                portType.addOperation(operation.name);
                System.out.println("operation.getname = "+operation.name);
              }
              System.out.println("operation.getnames = "+portType.operations);
View Full Code Here

Examples of javax.wsdl.PortType

              // getKey is used to get key of Map
              Object key = m.getKey();

              // getValue is used to get value of key in Map
              PortType pType = (PortTypeImpl)m.getValue();

              Operation op ;
              portType = new PortTypeImplm();
              for(int i=0; i<pType.getOperations().size(); i++){
                op = (OperationImpl)pType.getOperations().get(i);
                operation = new OperationImplm(op.getName());
                portType.addOperation(operation.name);
                System.out.println("operation.getname = "+operation.name);
              }
              portTypeList.add(portType);
View Full Code Here

Examples of javax.wsdl.PortType

        SOAPBinding soapBinding = (SOAPBinding) extensionRegistry.createExtension(Binding.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "binding"));
        soapBinding.setTransportURI("http://schemas.xmlsoap.org/soap/http");
        soapBinding.setStyle("rpc");
        binding.addExtensibilityElement(soapBinding);
        binding.addBindingOperation(bindingOperation);
        PortType portType = definition.createPortType();
        portType.setQName(new QName(NAMESPACE, "MockPort"));
        portType.addOperation(bindingOperation.getOperation());
        binding.setPortType(portType);
        Port port = definition.createPort();
        port.setName("MockPort");
        //add soap:address
        SOAPAddress soapAddress = (SOAPAddress) extensionRegistry.createExtension(Port.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "address"));
View Full Code Here

Examples of javax.wsdl.PortType

                Binding binding = port.getBinding();
                if (binding == null) {
                    throw new DeploymentException("No binding for port: " + portName);
                }
               
                PortType portType = binding.getPortType();
                if (portType == null) {
                    throw new DeploymentException("No portType for binding: " + binding.getQName());
                }

                boolean mtomEnabled = isMTOMEnabled(portType.getQName());
               
                EndpointInfo info = new EndpointInfo(location, credentialsName, mtomEnabled);
                this.portInfoMap.put(portName, info);
                // prefer first binding listed in wsdl
                if (!this.portInfoMap.containsKey(portType.getQName())) {
                    this.portInfoMap.put(portType.getQName(), info);
                }
            }
        }
    }
View Full Code Here

Examples of javax.wsdl.PortType

    }

    private void mapBinding(Binding binding, JavaWsdlMappingType mapping, QName serviceQName, ClassLoader classLoader, SOAPConstants soapVersion, SchemaInfoBuilder schemaInfoBuilder, String portName, URL location, List handlerInfos, Map seiPortNameToFactoryMap, Map seiClassNameToFactoryMap, String credentialsName, Map exceptionMap) throws DeploymentException {
        Style portStyle = getStyle(binding);

        PortType portType = binding.getPortType();

        ServiceEndpointInterfaceMappingType[] endpointMappings = mapping.getServiceEndpointInterfaceMappingArray();

        //port type corresponds to SEI
        List operations = portType.getOperations();
        OperationInfo[] operationInfos = new OperationInfo[operations.size()];
        if (endpointMappings.length == 0) {
            doLightweightMapping(serviceQName, portType, mapping, classLoader, operations, binding, portStyle, soapVersion, operationInfos, schemaInfoBuilder, portName, location, handlerInfos, seiPortNameToFactoryMap, seiClassNameToFactoryMap, credentialsName);
        } else {
            doHeavyweightMapping(serviceQName, portType, endpointMappings, classLoader, operations, binding, portStyle, soapVersion, exceptionMap, schemaInfoBuilder, mapping, operationInfos, portName, location, handlerInfos, seiPortNameToFactoryMap, seiClassNameToFactoryMap, credentialsName);
View Full Code Here

Examples of javax.wsdl.PortType

                        }

                        if (binding != null) {   
                            org.apache.schemas.yoko.bindings.corba.Object obj =
                                new org.apache.schemas.yoko.bindings.corba.Object();
                            PortType portT = binding.getPortType();
                            QName name = new QName(idlNamespace, portT.getQName().getLocalPart(),
                                                   definition.getPrefix(idlNamespace));
                            obj.setName(name.getLocalPart());
                            obj.setQName(name)
                            QName bName = binding.getQName();                          
                            obj.setBinding(bName);
View Full Code Here

Examples of javax.wsdl.PortType

        if (interfaceNames.size() > 0) {
            intfs = new ArrayList<PortType>(interfaceNames.size());

            for (int i = 0; i < interfaceNames.size(); i++) {
                PortType portType = null;
                String interfaceName = (String)interfaceNames.get(i);

                Map portTypes = def.getPortTypes();
                if (portTypes != null) {
                    Iterator it2 = portTypes.keySet().iterator();
                    while (it2.hasNext()) {
                        QName existPortQName = (QName)it2.next();
                        if (!existPortQName.getLocalPart().equals(interfaceName)) {
                            portType = null;
                        } else {
                            portType = (PortType)portTypes.get(existPortQName);
                            break;
                        }
                    }
                }

                if (portType == null) {                   
                    String msgStr = "PortType " + interfaceName
                        + " doesn't exist in WSDL.";                    
                    throw new Exception(msgStr);
                }
                intfs.add(portType);
            }
        } else {
            Map portTypes = def.getPortTypes();

            if (portTypes == null) {
                org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(
                    "No PortTypes defined in wsdl", LOG);
                throw new Exception(msg.toString());
            } else {
                PortType portType = null;
                if (portTypes.size() > 1) {
                    throwMultiplePortTypeException(portTypes);
                } else {
                    portType = (PortType) portTypes.values().iterator().next();
                    interfaceNames.add(portType.getQName().getLocalPart());
                }
                intfs = new ArrayList<PortType>();
                intfs.add(portType);
            }
        }
View Full Code Here

Examples of javax.wsdl.PortType

        parseImports(d, defList);
        for (Definition def : defList) {

            for (Iterator<?> ite = def.getPortTypes().entrySet().iterator(); ite.hasNext();) {
                Entry<?, ?> entry = (Entry<?, ?>)ite.next();
                PortType portType = def.getPortType((QName)entry.getKey());
                ServiceInfo serviceInfo = this.buildMockService(def, portType);
                serviceList.add(serviceInfo);

                for (Iterator<?> it2 = d.getAllBindings().values().iterator(); it2.hasNext();) {
                    Binding b = (Binding)it2.next();
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.