Package org.jboss.ws.metadata.wsdl

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


      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

      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

               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, destBinding);
            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

            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

/*  803 */           else destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name, WSDLRPCSignatureItem.Direction.OUT));
/*      */         }
/*      */       }
/*      */     }
/*      */
/*  808 */     WSDLInterfaceOperationOutput rpcOutput = new WSDLInterfaceOperationOutput(destOperation);
/*  809 */     for (Part srcPart : srcMessage.getOrderedParts(null))
/*      */     {
/*  812 */       if (ignorePart(srcPortType, srcPart)) {
/*      */         continue;
/*      */       }
/*  815 */       if ("http://www.w3.org/2004/03/wsdl/style/iri" == destOperation.getStyle())
/*      */       {
/*  817 */         WSDLInterfaceOperationOutput destOutput = new WSDLInterfaceOperationOutput(destOperation);
/*      */
/*  819 */         QName elementName = messagePartToElementName(srcMessage, srcPart, destOperation, destBinding);
/*  820 */         destOutput.setElement(elementName);
/*      */
/*  823 */         destOutput.setMessageName(srcMessage.getQName());
/*  824 */         destOperation.addProperty(new WSDLProperty("http://www.jboss.org/jbossws/messagename/out", srcMessage.getQName().getLocalPart()));
/*      */
/*  827 */         destOutput.setPartName(srcPart.getName());
/*      */
/*  829 */         destOperation.addOutput(destOutput);
/*      */       }
/*      */       else
/*      */       {
View Full Code Here

/* 1352 */         return this.val$srcBindingOperation.getOperation().getOutput().getMessage().getPart(partName).getTypeName();
/*      */       }
/*      */
/*      */       public void removeReference(QName element)
/*      */       {
/* 1357 */         WSDLInterfaceOperationOutput destIntfOutput = this.val$destIntfOperation.getOutput(element);
/* 1358 */         if (destIntfOutput != null)
/* 1359 */           this.val$destIntfOperation.removeOutput(element);
/*      */       }
/*      */
/*      */       public void removeRPCPart(String partName)
/*      */       {
/* 1364 */         QName name = this.val$destIntfOperation.getName();
/* 1365 */         WSDLInterfaceOperationOutput operationOutput = this.val$destIntfOperation.getOutput(new QName(name.getNamespaceURI(), name.getLocalPart() + "Response"));
/* 1366 */         operationOutput.removeChildPart(partName);
/*      */       }
/*      */     };
/* 1370 */     processBindingReference(srcWsdl, destBindingOperation, destIntfOperation, extList, output, srcBindingOperation, cb);
/*      */   }
View Full Code Here

/* 572 */     wsdlPosition = processBindingParameters(opMetaData, wsdlOperation, seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
/*     */
/* 574 */     WSDLInterfaceOperationOutput[] outputs = wsdlOperation.getOutputs();
/* 575 */     if (outputs.length > 0)
/*     */     {
/* 577 */       WSDLInterfaceOperationOutput output = outputs[0];
/* 578 */       for (WSDLRPCPart part : output.getChildParts())
/*     */       {
/* 580 */         String partName = part.getName();
/*     */
/* 582 */         ParameterMetaData outMetaData = opMetaData.getParameter(new QName(partName));
/* 583 */         if (outMetaData != null)
View Full Code Here

/* 761 */     return isWrapParameters;
/*     */   }
/*     */
/*     */   private int processOutputDocElement(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping, List<WrappedParameter> wrappedResponseParameters, int wsdlPosition)
/*     */   {
/* 767 */     WSDLInterfaceOperationOutput opOutput = wsdlOperation.getOutputs()[0];
/* 768 */     QName xmlName = opOutput.getElement();
/* 769 */     QName xmlType = opOutput.getXMLType();
/*     */
/* 771 */     String javaTypeName = typeMapping.getJavaTypeName(xmlType);
/*     */
/* 773 */     TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
/* 774 */     if (typesMetaData.getTypeMappingByXMLType(xmlType) != null) {
/* 775 */       javaTypeName = typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName();
/*     */     }
/* 777 */     if (javaTypeName == null) {
/* 778 */       throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);
/*     */     }
/* 780 */     ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName);
/*     */
/* 782 */     boolean hasReturnMapping = true;
/* 783 */     if (opMetaData.isDocumentWrapped())
/*     */     {
/* 785 */       if (seiMethodMapping == null) {
/* 786 */         throw new IllegalArgumentException("Cannot wrap parameters without SEI method mapping");
/*     */       }
/* 788 */       WsdlReturnValueMapping returnValueMapping = seiMethodMapping.getWsdlReturnValueMapping();
/* 789 */       if (returnValueMapping != null)
/*     */       {
/* 791 */         ServiceEndpointInterfaceMapping seiMapping = seiMethodMapping.getServiceEndpointInterfaceMapping();
/* 792 */         JavaWsdlMapping javaWsdlMapping = seiMapping.getJavaWsdlMapping();
/* 793 */         JavaXmlTypeMapping javaXmlTypeMapping = javaWsdlMapping.getTypeMappingForQName(xmlType);
/* 794 */         if (javaXmlTypeMapping == null) {
/* 795 */           throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);
/*     */         }
/* 797 */         Map map = createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
/* 798 */         String elementName = returnValueMapping.getWsdlMessagePartName();
/* 799 */         String variable = (String)map.get(elementName);
/* 800 */         if (variable == null) {
/* 801 */           throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);
/*     */         }
/* 803 */         String wrappedType = returnValueMapping.getMethodReturnValue();
/* 804 */         QName element = new QName(elementName);
/* 805 */         WrappedParameter wrappedParameter = new WrappedParameter(element, wrappedType, variable, -1);
/* 806 */         wrappedResponseParameters.add(0, wrappedParameter);
/*     */       }
/*     */
/* 809 */       outMetaData.setWrappedParameters(wrappedResponseParameters);
/*     */     }
/*     */     else
/*     */     {
/* 813 */       if (seiMethodMapping != null)
/*     */       {
/* 815 */         MethodParamPartsMapping part = seiMethodMapping.getMethodParamPartsMappingByPartName(opOutput.getPartName());
/* 816 */         String mode = null;
/* 817 */         if (part != null)
/*     */         {
/* 819 */           WsdlMessageMapping wsdlMessageMapping = part.getWsdlMessageMapping();
/* 820 */           mode = wsdlMessageMapping.getParameterMode();
/*     */         }
/* 822 */         if ("INOUT".equals(mode))
/*     */         {
/* 824 */           ParameterMetaData inMetaData = opMetaData.getParameter(xmlName);
/* 825 */           if (inMetaData != null)
/*     */           {
/* 827 */             inMetaData.setMode(ParameterMode.INOUT);
/* 828 */             return wsdlPosition;
/*     */           }
/*     */
/* 831 */           throw new WSException("Could not update IN parameter to be INOUT, as indicated in the mapping: " + opOutput.getPartName());
/*     */         }
/*     */
/* 834 */         if ("OUT".equals(mode))
/*     */         {
/* 836 */           hasReturnMapping = false;
View Full Code Here

/* 256 */     interfaceOperation.setStyle("http://www.w3.org/2004/03/wsdl/style/iri");
/*     */
/* 258 */     WSDLInterfaceOperationInput input = new WSDLInterfaceOperationInput(interfaceOperation);
/* 259 */     WSDLBindingOperationInput bindingInput = new WSDLBindingOperationInput(bindingOperation);
/*     */
/* 261 */     WSDLInterfaceOperationOutput output = null;
/* 262 */     WSDLBindingOperationOutput bindingOutput = null;
/*     */
/* 264 */     boolean twoWay = !operation.isOneWay();
/* 265 */     if (twoWay)
/*     */     {
/* 267 */       output = new WSDLInterfaceOperationOutput(interfaceOperation);
/* 268 */       bindingOutput = new WSDLBindingOperationOutput(bindingOperation);
/*     */
/* 270 */       ParameterMetaData returnParameter = operation.getReturnParameter();
/* 271 */       if (returnParameter != null)
/*     */       {
/* 273 */         QName xmlName = returnParameter.getXmlName();
/* 274 */         String partName = returnParameter.getPartName();
/* 275 */         if (returnParameter.isInHeader())
/*     */         {
/* 277 */           WSDLSOAPHeader header = new WSDLSOAPHeader(xmlName, partName);
/* 278 */           header.setIncludeInSignature(true);
/* 279 */           bindingOutput.addSoapHeader(header);
/*     */         }
/*     */         else
/*     */         {
/* 283 */           output.setElement(xmlName);
/* 284 */           output.setPartName(partName);
/*     */         }
/* 286 */         addSignatureItem(interfaceOperation, returnParameter, true);
/*     */       }
/*     */
/* 291 */       interfaceOperation.addOutput(output);
/* 292 */       bindingOperation.addOutput(bindingOutput);
/*     */     }
/*     */
/* 295 */     for (ParameterMetaData param : operation.getParameters())
/*     */     {
/* 297 */       if (param.isInHeader())
/*     */       {
/* 299 */         WSDLSOAPHeader header = new WSDLSOAPHeader(param.getXmlName(), param.getPartName());
/* 300 */         header.setIncludeInSignature(true);
/* 301 */         if (param.getMode() != ParameterMode.OUT)
/* 302 */           bindingInput.addSoapHeader(header);
/* 303 */         if ((twoWay) && (param.getMode() != ParameterMode.IN))
/* 304 */           bindingOutput.addSoapHeader(header);
/*     */       }
/*     */       else
/*     */       {
/* 308 */         if (param.getMode() != ParameterMode.OUT)
/*     */         {
/* 310 */           input.setElement(param.getXmlName());
/* 311 */           input.setPartName(param.getPartName());
/*     */         }
/* 313 */         if ((twoWay) && (param.getMode() != ParameterMode.IN))
/*     */         {
/* 315 */           output.setElement(param.getXmlName());
/* 316 */           output.setPartName(param.getPartName());
/*     */         }
/*     */       }
/* 319 */       addSignatureItem(interfaceOperation, param, false);
/*     */     }
/*     */
View Full Code Here

TOP

Related Classes of org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput

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.