Examples of WsdlReturnValueMapping


Examples of org.apache.openejb.jee.WsdlReturnValueMapping

        Class returnClass = null;

        if (output == null) {
            throw new DeploymentException("No output message, but a mapping for it for operation " + operationName);
        }
        WsdlReturnValueMapping wsdlReturnValueMapping = methodMapping.getWsdlReturnValueMapping();
        String returnClassName = wsdlReturnValueMapping.getMethodReturnValue();
        try {
            returnClass = ClassLoading.loadClass(returnClassName, bundle);
        } catch (ClassNotFoundException e) {
            throw new DeploymentException("Could not load return type for operation " + operationName, e);
        }

        QName wsdlMessageQName = wsdlReturnValueMapping.getWsdlMessage();

        if (!wsdlMessageQName.equals(output.getQName())) {
            throw new DeploymentException("OutputMessage has QName: " + output.getQName() + " but mapping specifies: " + wsdlMessageQName + " for operation " + operationName);
        }

        if (wsdlReturnValueMapping.getWsdlMessagePartName() != null) {
            String wsdlMessagePartName = wsdlReturnValueMapping.getWsdlMessagePartName();
            if (outParamNames.contains(wsdlMessagePartName)) {
                throw new DeploymentException("output message part " + wsdlMessagePartName + " has both an INOUT or OUT mapping and a return value mapping for operation " + operationName);
            }

            if (wrappedStyle) {
View Full Code Here

Examples of org.apache.openejb.jee.WsdlReturnValueMapping

        if (outputMessage == null) {
            throw new OpenEJBException("No output message, but a mapping for it for operation " + operationName);
        }

        // verify mapped return value qname matches expected output message name
        final WsdlReturnValueMapping wsdlReturnValueMapping = methodMapping.getWsdlReturnValueMapping();
        if (!wsdlReturnValueMapping.getWsdlMessage().equals(outputMessage.getQName())) {
            throw new OpenEJBException("OutputMessage has QName: " + outputMessage.getQName() + " but mapping specifies: " + wsdlReturnValueMapping.getWsdlMessage() + " for operation " + operationName);
        }

        //
        // Determind return type qname and xml schema type
        //
        QName returnQName = null;
        QName returnXmlType = null;
        if (wsdlReturnValueMapping.getWsdlMessagePartName() != null) {
            final String wsdlMessagePartName = wsdlReturnValueMapping.getWsdlMessagePartName();
            if (outParamNames.contains(wsdlMessagePartName)) {
                throw new OpenEJBException("output message part " + wsdlMessagePartName + " has both an INOUT or OUT mapping and a return value mapping for operation " + operationName);
            }

            if (bindingStyle.isWrapped()) {
                final Part outPart = getWrappedPart(outputMessage);
                final XmlElementInfo returnParticle = getWrapperChild(outPart, wsdlMessagePartName);

                returnQName = new QName("", returnParticle.qname.getLocalPart());
                returnXmlType = returnParticle.xmlType;
            } else if (bindingStyle.isRpc()) {
                final Part part = outputMessage.getPart(wsdlMessagePartName);
                if (part == null) {
                    throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
                }

                returnQName = new QName("", part.getName());

                // RPC can only use type
                returnXmlType = part.getTypeName();
            } else {
                final Part part = outputMessage.getPart(wsdlMessagePartName);
                if (part == null) {
                    throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
                }

                returnQName = getPartName(part);
                returnXmlType = returnQName;
            }

            outParamNames.add(wsdlMessagePartName);
        } else {
            // what does this mean????
        }

        operationInfo.returnQName = returnQName;
        operationInfo.returnXmlType = returnXmlType;
        operationInfo.returnJavaType = wsdlReturnValueMapping.getMethodReturnValue();
    }
View Full Code Here

Examples of org.apache.openejb.jee.WsdlReturnValueMapping

        if (outputMessage == null) {
            throw new OpenEJBException("No output message, but a mapping for it for operation " + operationName);
        }

        // verify mapped return value qname matches expected output message name
        WsdlReturnValueMapping wsdlReturnValueMapping = methodMapping.getWsdlReturnValueMapping();
        if (!wsdlReturnValueMapping.getWsdlMessage().equals(outputMessage.getQName())) {
            throw new OpenEJBException("OutputMessage has QName: " + outputMessage.getQName() + " but mapping specifies: " + wsdlReturnValueMapping.getWsdlMessage() + " for operation " + operationName);
        }

        //
        // Determind return type qname and xml schema type
        //
        QName returnQName = null;
        QName returnXmlType = null;
        if (wsdlReturnValueMapping.getWsdlMessagePartName() != null) {
            String wsdlMessagePartName = wsdlReturnValueMapping.getWsdlMessagePartName();
            if (outParamNames.contains(wsdlMessagePartName)) {
                throw new OpenEJBException("output message part " + wsdlMessagePartName + " has both an INOUT or OUT mapping and a return value mapping for operation " + operationName);
            }

            if (bindingStyle.isWrapped()) {
                Part outPart = getWrappedPart(outputMessage);
                XmlElementInfo returnParticle = getWrapperChild(outPart, wsdlMessagePartName);

                returnQName = new QName("", returnParticle.qname.getLocalPart());
                returnXmlType = returnParticle.xmlType;
            } else if (bindingStyle.isRpc()) {
                Part part = outputMessage.getPart(wsdlMessagePartName);
                if (part == null) {
                    throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
                }

                returnQName = new QName("", part.getName());

                // RPC can only use type
                returnXmlType = part.getTypeName();
            } else {
                Part part = outputMessage.getPart(wsdlMessagePartName);
                if (part == null) {
                    throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
                }

                returnQName = getPartName(part);
                returnXmlType = returnQName;
            }

            outParamNames.add(wsdlMessagePartName);
        } else {
            // what does this mean????
        }

        operationInfo.returnQName = returnQName;
        operationInfo.returnXmlType = returnXmlType;
        operationInfo.returnJavaType = wsdlReturnValueMapping.getMethodReturnValue();
    }
View Full Code Here

Examples of org.apache.openejb.jee.WsdlReturnValueMapping

        if (outputMessage == null) {
            throw new OpenEJBException("No output message, but a mapping for it for operation " + operationName);
        }

        // verify mapped return value qname matches expected output message name
        WsdlReturnValueMapping wsdlReturnValueMapping = methodMapping.getWsdlReturnValueMapping();
        if (!wsdlReturnValueMapping.getWsdlMessage().equals(outputMessage.getQName())) {
            throw new OpenEJBException("OutputMessage has QName: " + outputMessage.getQName() + " but mapping specifies: " + wsdlReturnValueMapping.getWsdlMessage() + " for operation " + operationName);
        }

        //
        // Determind return type qname and xml schema type
        //
        QName returnQName = null;
        QName returnXmlType = null;
        if (wsdlReturnValueMapping.getWsdlMessagePartName() != null) {
            String wsdlMessagePartName = wsdlReturnValueMapping.getWsdlMessagePartName();
            if (outParamNames.contains(wsdlMessagePartName)) {
                throw new OpenEJBException("output message part " + wsdlMessagePartName + " has both an INOUT or OUT mapping and a return value mapping for operation " + operationName);
            }

            if (bindingStyle.isWrapped()) {
                Part outPart = getWrappedPart(outputMessage);
                XmlElementInfo returnParticle = getWrapperChild(outPart, wsdlMessagePartName);

                returnQName = new QName("", returnParticle.qname.getLocalPart());
                returnXmlType = returnParticle.xmlType;
            } else if (bindingStyle.isRpc()) {
                Part part = outputMessage.getPart(wsdlMessagePartName);
                if (part == null) {
                    throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
                }

                returnQName = new QName("", part.getName());

                // RPC can only use type
                returnXmlType = part.getTypeName();
            } else {
                Part part = outputMessage.getPart(wsdlMessagePartName);
                if (part == null) {
                    throw new OpenEJBException("No part for wsdlMessagePartName " + wsdlMessagePartName + " in output message for operation " + operationName);
                }

                returnQName = getPartName(part);
                returnXmlType = returnQName;
            }

            outParamNames.add(wsdlMessagePartName);
        } else {
            // what does this mean????
        }

        operationInfo.returnQName = returnQName;
        operationInfo.returnXmlType = returnXmlType;
        operationInfo.returnJavaType = wsdlReturnValueMapping.getMethodReturnValue();
    }
View Full Code Here

Examples of org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping

            hasReturnMapping = false;
            mapped = true;
         }
         else
         {
            WsdlReturnValueMapping returnMapping = seiMethodMapping.getWsdlReturnValueMapping();
            if (returnMapping != null)
            {
               String mappingPart = returnMapping.getWsdlMessagePartName();
               if (mappingPart != null && partName.equals(mappingPart))
               {
                  javaTypeName = returnMapping.getMethodReturnValue();
                  hasReturnMapping = true;
                  mapped = true;
               }
            }
         }
View Full Code Here

Examples of org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping

      if (opMetaData.isDocumentWrapped())
      {
         if (seiMethodMapping == null)
            throw new IllegalArgumentException("Cannot wrap parameters without SEI method mapping");

         WsdlReturnValueMapping returnValueMapping = seiMethodMapping.getWsdlReturnValueMapping();
         if (returnValueMapping != null)
         {
            ServiceEndpointInterfaceMapping seiMapping = seiMethodMapping.getServiceEndpointInterfaceMapping();
            JavaWsdlMapping javaWsdlMapping = seiMapping.getJavaWsdlMapping();
            JavaXmlTypeMapping javaXmlTypeMapping = javaWsdlMapping.getTypeMappingForQName(xmlType);
            if (javaXmlTypeMapping == null)
               throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);

            Map<String, String> map = createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
            if (map.size() > 0)
            {
               String elementName = returnValueMapping.getWsdlMessagePartName();
               String variable = map.get(elementName);
               if (variable == null)
                  throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);

               String wrappedType = returnValueMapping.getMethodReturnValue();
               QName element = new QName(elementName);
               WrappedParameter wrappedParameter = new WrappedParameter(element, wrappedType, variable, WrappedParameter.RETURN);
               wrappedResponseParameters.add(0, wrappedParameter);
            }
         }

         outMetaData.setWrappedParameters(wrappedResponseParameters);
      }
      else
      {
         if (seiMethodMapping != null)
         {
            MethodParamPartsMapping part = seiMethodMapping.getMethodParamPartsMappingByPartName(opOutput.getPartName());
            String mode = null;
            if (part != null)
            {
               WsdlMessageMapping wsdlMessageMapping = part.getWsdlMessageMapping();
               mode = wsdlMessageMapping.getParameterMode();
            }
            if ("INOUT".equals(mode))
            {
               ParameterMetaData inMetaData = opMetaData.getParameter(xmlName);
               if (inMetaData != null)
               {
                  inMetaData.setMode(ParameterMode.INOUT);
                  return wsdlPosition;
               }

               throw new WSException("Could not update IN parameter to be INOUT, as indicated in the mapping: " + opOutput.getPartName());
            }
            // It's potentialy possible that an input parameter could exist with the same part name
            else if ("OUT".equals(mode))
            {
               hasReturnMapping = false;
               javaTypeName = part.getParamType();
               outMetaData.setIndex(part.getParamPosition());
               outMetaData.setJavaTypeName(javaTypeName);
            }
            else
            {
               WsdlReturnValueMapping returnValueMapping = seiMethodMapping.getWsdlReturnValueMapping();
               if (returnValueMapping != null)
               {
                  javaTypeName = returnValueMapping.getMethodReturnValue();
                  outMetaData.setJavaTypeName(javaTypeName);
               }
            }
         }
View Full Code Here

Examples of org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping

            String javaType = getJavaTypeAsString(xmlName, xmlType, nameSpace, array, primitive);

            if ((isDocStyle() == false && "void".equals(javaType)) == false)
            {
               WsdlReturnValueMapping wrvm = new WsdlReturnValueMapping(semm);
               wrvm.setMethodReturnValue(javaType);
               wrvm.setWsdlMessage(messageName);
               wrvm.setWsdlMessagePartName(partName);
               semm.setWsdlReturnValueMapping(wrvm);
            }
         }
      }
View Full Code Here

Examples of org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping

         if (xt instanceof XSSimpleTypeDefinition)
         {
            xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);
         }

         WsdlReturnValueMapping wrvm = new WsdlReturnValueMapping(semm);
         wrvm.setMethodReturnValue(getJavaTypeAsString(xmlName, xmlType, nameSpace, false, true));
         QName messageName = WSDLUtils.getWsdl11Output(wiop).getMessageName();

         wrvm.setWsdlMessage(new QName(messageName.getNamespaceURI(), messageName.getLocalPart(), WSToolsConstants.WSTOOLS_CONSTANT_MAPPING_WSDL_MESSAGE_NS));
         wrvm.setWsdlMessagePartName(partName);
         semm.setWsdlReturnValueMapping(wrvm);
      }

      if (bindingOperation != null)
      {
View Full Code Here

Examples of org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping

      methodMapping.addMethodParamPartsMapping(paramMapping);
   }

   private void buildReturnParamMapping(ServiceEndpointMethodMapping methodMapping, String interfaceName, OperationMetaData operation, String name, String type)
   {
      WsdlReturnValueMapping returnMapping = new WsdlReturnValueMapping(methodMapping);
      returnMapping.setMethodReturnValue(type);
      returnMapping.setWsdlMessagePartName(name);
      String messageName = interfaceName + "_" + operation.getQName().getLocalPart() + "Response";;
      QName messageQName = new QName(wsdl.getTargetNamespace(), messageName, "wsdlMsgNS");
      returnMapping.setWsdlMessage(messageQName);
      methodMapping.setWsdlReturnValueMapping(returnMapping);
   }
View Full Code Here

Examples of org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping

            String javaType = getJavaTypeAsString(xmlName, xmlType, array, primitive);

            if ((isDocStyle() == false && "void".equals(javaType)) == false)
            {
               WsdlReturnValueMapping wrvm = new WsdlReturnValueMapping(semm);
               wrvm.setMethodReturnValue(javaType);
               wrvm.setWsdlMessage(messageName);
               wrvm.setWsdlMessagePartName(partName);
               semm.setWsdlReturnValueMapping(wrvm);
            }
         }
      }
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.