Examples of WSDLInterfaceOperationOutput


Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

      wsdlPosition = processBindingParameters(opMetaData, wsdlOperation, seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);

      WSDLInterfaceOperationOutput[] outputs = wsdlOperation.getOutputs();
      if (outputs.length > 0)
      {
         WSDLInterfaceOperationOutput output = outputs[0];
         for (WSDLRPCPart part : output.getChildParts())
         {
            String partName = part.getName();

            ParameterMetaData outMetaData = opMetaData.getParameter(new QName(partName));
            if (outMetaData != null)
View Full Code Here

Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

   }

   private int processOutputDocElement(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping,
         TypeMappingImpl typeMapping, List<WrappedParameter> wrappedResponseParameters, int wsdlPosition)
   {
      WSDLInterfaceOperationOutput opOutput = wsdlOperation.getOutputs()[0];
      QName xmlName = opOutput.getElement();
      QName xmlType = opOutput.getXMLType();

      String javaTypeName = typeMapping.getJavaTypeName(xmlType);

      TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
      if (typesMetaData.getTypeMappingByXMLType(xmlType) != null)
         javaTypeName = typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName();

      if (javaTypeName == null)
         throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);

      ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName);

      boolean hasReturnMapping = true;
      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;
View Full Code Here

Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

      interfaceOperation.setStyle(Constants.URI_STYLE_DOCUMENT);

      WSDLInterfaceOperationInput input = new WSDLInterfaceOperationInput(interfaceOperation);
      WSDLBindingOperationInput bindingInput = new WSDLBindingOperationInput(bindingOperation);

      WSDLInterfaceOperationOutput output = null;
      WSDLBindingOperationOutput bindingOutput = null;

      boolean twoWay = !operation.isOneWay();
      if (twoWay)
      {
         output = new WSDLInterfaceOperationOutput(interfaceOperation);
         bindingOutput = new WSDLBindingOperationOutput(bindingOperation);

         ParameterMetaData returnParameter = operation.getReturnParameter();
         if (returnParameter != null)
         {
            QName xmlName = returnParameter.getXmlName();
            String partName = returnParameter.getPartName();
            if (returnParameter.isInHeader())
            {
               WSDLSOAPHeader header = new WSDLSOAPHeader(xmlName, partName);
               header.setIncludeInSignature(true);
               bindingOutput.addSoapHeader(header);
            }
            else
            {
               output.setElement(xmlName);
               output.setPartName(partName);
            }
            addSignatureItem(interfaceOperation, returnParameter, true);
         }

         // If there is no return parameter, it will most likely be set later with an INOUT or OUT parameter.
         // Otherwise, a null element means there is a 0 body element part, which is allowed by BP 1.0
         interfaceOperation.addOutput(output);
         bindingOperation.addOutput(bindingOutput);
      }

      for (ParameterMetaData param : operation.getParameters())
      {
         if (param.isInHeader())
         {
            WSDLSOAPHeader header = new WSDLSOAPHeader(param.getXmlName(), param.getPartName());
            header.setIncludeInSignature(true);
            if (param.getMode() != ParameterMode.OUT)
               bindingInput.addSoapHeader(header);
            if (twoWay && param.getMode() != ParameterMode.IN)
               bindingOutput.addSoapHeader(header);
         }
         else
         {
            if (param.getMode() != ParameterMode.OUT)
            {
               input.setElement(param.getXmlName());
               input.setPartName(param.getPartName());
            }
            if (twoWay && param.getMode() != ParameterMode.IN)
            {
               output.setElement(param.getXmlName());
               output.setPartName(param.getPartName());
            }
         }
         addSignatureItem(interfaceOperation, param, false);
      }
View Full Code Here

Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

      WSDLInterfaceOperationInput input = new WSDLInterfaceOperationInput(interfaceOperation);
      WSDLBindingOperationInput bindingInput = new WSDLBindingOperationInput(bindingOperation);
      QName operationName = operation.getQName();
      input.setElement(operationName);

      WSDLInterfaceOperationOutput output = null;
      WSDLBindingOperationOutput bindingOutput = null;

      boolean twoWay = !operation.isOneWay();
      if (twoWay)
      {
         output = new WSDLInterfaceOperationOutput(interfaceOperation);
         bindingOutput = new WSDLBindingOperationOutput(bindingOperation);
         output.setElement(new QName(operationName.getNamespaceURI(), operationName.getLocalPart() + "Response"));

         ParameterMetaData returnParameter = operation.getReturnParameter();
         if (returnParameter != null)
         {
            QName xmlName = returnParameter.getXmlName();
            String partName = returnParameter.getPartName();
            if (returnParameter.isInHeader())
            {
               WSDLSOAPHeader header = new WSDLSOAPHeader(xmlName, partName);
               header.setIncludeInSignature(true);
               bindingOutput.addSoapHeader(header);
            }
            else
            {
               QName xmlType = returnParameter.getXmlType();
               String ns = getNamespace(returnParameter.getJavaType(), xmlType.getNamespaceURI());
               QName newXmlType = new QName(ns, xmlType.getLocalPart());
               WSDLRPCPart part = new WSDLRPCPart(partName, newXmlType);

               output.addChildPart(part);
            }
            addSignatureItem(interfaceOperation, returnParameter, true);
         }

         interfaceOperation.addOutput(output);
         bindingOperation.addOutput(bindingOutput);
      }

      for (ParameterMetaData param : operation.getParameters())
      {
         if (param.isInHeader())
         {
            WSDLSOAPHeader header = new WSDLSOAPHeader(param.getXmlName(), param.getPartName());
            header.setIncludeInSignature(true);
            if (param.getMode() != ParameterMode.OUT)
               bindingInput.addSoapHeader(header);
            if (twoWay && param.getMode() != ParameterMode.IN)
               bindingOutput.addSoapHeader(header);
         }
         else
         {
            QName xmlType = param.getXmlType();

            String ns = getNamespace(param.getJavaType(), xmlType.getNamespaceURI());
            QName newXmlType = new QName(ns, xmlType.getLocalPart());
            WSDLRPCPart part = new WSDLRPCPart(param.getPartName(), newXmlType);
            if (param.getMode() != ParameterMode.OUT)
               input.addChildPart(part);
            if (twoWay && param.getMode() != ParameterMode.IN)
               output.addChildPart(part);
         }
         addSignatureItem(interfaceOperation, param, false);
      }

      interfaceOperation.addInput(input);
View Full Code Here

Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

            // extract the root element NS
            String notificationRootElementNS = null;
            WSDLInterfaceOperation wsdlInterfaceOperation = wsdlInterface.getOperations()[0];
            if (wsdlInterfaceOperation.getOutputs().length > 0)
            {
               WSDLInterfaceOperationOutput wsdlInterfaceOperationOutput = wsdlInterfaceOperation.getOutputs()[0];
               notificationRootElementNS = wsdlInterfaceOperationOutput.getElement().getNamespaceURI();
            }
            else
            {
               // WSDL operation of an WSDL interface that is marked as an event source
               // requires to carry an output message.
View Full Code Here

Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

               else destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name, Direction.OUT));
            }
         }
      }

      WSDLInterfaceOperationOutput rpcOutput = new WSDLInterfaceOperationOutput(destOperation);
      for (Part srcPart : (List<Part>)srcMessage.getOrderedParts(null))
      {
         // Skip SWA attachment parts
         if (ignorePart(srcPortType, srcPart))
            continue;

         if (Constants.URI_STYLE_DOCUMENT == destOperation.getStyle())
         {
            WSDLInterfaceOperationOutput destOutput = new WSDLInterfaceOperationOutput(destOperation);

            QName elementName = messagePartToElementName(srcMessage, srcPart, destOperation);
            destOutput.setElement(elementName);

            // Lets remember the Message name
            destOutput.setMessageName(srcMessage.getQName());
            destOperation.addProperty(new WSDLProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT, srcMessage.getQName().getLocalPart()));

            // Remember the original part name
            destOutput.setPartName(srcPart.getName());

            destOperation.addOutput(destOutput);
         }
         else
         {
View Full Code Here

Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

            return srcBindingOperation.getOperation().getOutput().getMessage().getPart(partName).getTypeName();
         }

         public void removeReference(QName element)
         {
            WSDLInterfaceOperationOutput destIntfOutput = destIntfOperation.getOutput(element);
            if (destIntfOutput != null)
               destIntfOperation.removeOutput(element);
         }

         public void removeRPCPart(String partName)
         {
            QName name = destIntfOperation.getName();
            WSDLInterfaceOperationOutput operationOutput = destIntfOperation.getOutput(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
            operationOutput.removeChildPart(partName);
         }
      };

      processBindingReference(srcWsdl, destBindingOperation, destIntfOperation, extList, output, srcBindingOperation, cb);
   }
View Full Code Here

Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

   }

   private void constructDOCParameters(ServiceEndpointMethodMapping semm, WSDLInterfaceOperation wiop, WSDLBindingOperation bindingOperation)
   {
      WSDLInterfaceOperationInput win = WSDLUtils.getWsdl11Input(wiop);
      WSDLInterfaceOperationOutput output = WSDLUtils.getWsdl11Output(wiop);

      JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
      MethodParamPartsMapping mpin = null;

      boolean holder = false;

      if (win != null)
      {
         QName xmlName = win.getElement();
         QName xmlType = win.getXMLType();
         String partName = win.getPartName();
         String wsdlMessageName = win.getMessageName().getLocalPart();
         XSTypeDefinition xt = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());

         boolean wrapped = isWrapped();

         if (wrapped)
         {
            wrapped = unwrapRequest(semm, wsdlMessageName, xmlName.getLocalPart(), xt);
         }

         if (wrapped == false)
         {
            if (xt instanceof XSSimpleTypeDefinition)
               xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);
            String paramMode = "IN";
            holder = output != null && xmlName.equals(output.getElement());
            if (holder == true)
            {
               paramMode = "INOUT";
            }

            mpin = getMethodParamPartsMapping(semm, xmlName, xmlType, 0, wsdlMessageName, paramMode, partName, false, true);
            semm.addMethodParamPartsMapping(mpin);
         }
      }

      if (holder == false && output != null)
      {
         QName xmlName = output.getElement();
         QName xmlType = output.getXMLType();
         boolean primitive = true;

         String targetNS = wsdlDefinitions.getTargetNamespace();
         QName messageName = new QName(targetNS, output.getMessageName().getLocalPart(), WSToolsConstants.WSTOOLS_CONSTANT_MAPPING_WSDL_MESSAGE_NS);

         String partName = output.getPartName();
         String containingElement = xmlName.getLocalPart();
         boolean array = false;
         XSTypeDefinition xt = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());

         ReturnTypeUnwrapper unwrapper = new ReturnTypeUnwrapper(xmlType, schemaModel, isWrapped());
View Full Code Here

Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

   }

   private String getMode(WSDLInterfaceOperation op, String name)
   {
      WSDLInterfaceOperationInput in = WSDLUtils.getWsdl11Input(op);
      WSDLInterfaceOperationOutput out = WSDLUtils.getWsdl11Output(op);

      boolean i = false, o = false;
      if (in != null && in.getChildPart(name) != null)
         i = true;
      if (out != null && out.getChildPart(name) != null)
         o = true;

      if (i && o)
         return "INOUT";
View Full Code Here

Examples of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

         String returnType = null;

         StringBuilder paramBuffer = new StringBuilder();

         WSDLInterfaceOperationInput input = WSDLUtils.getWsdl11Input(op);
         WSDLInterfaceOperationOutput output = WSDLUtils.getWsdl11Output(op);
         if (isDocument())
         {
            returnType = appendDocParameters(paramBuffer, input, output, bindingOperation);
         }
         else
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.