Package org.jboss.ws.metadata.wsdl

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


      return "IN";
   }

   private void constructRPCParameters(ServiceEndpointMethodMapping semm, WSDLInterfaceOperation wiop, WSDLBindingOperation bindingOperation)
   {
      WSDLInterfaceOperationInput win = WSDLUtils.getWsdl11Input(wiop);
      if (win == null)
         throw new WSException("RPC endpoints require an input message");
      String wsdlMessageName = win.getMessageName().getLocalPart();
      JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());

      RPCSignature signature = new RPCSignature(wiop);
      int i = 0;
      for (WSDLRPCPart part : signature.parameters())
View Full Code Here


   protected void processOperationDOC(WSDLInterfaceOperation interfaceOperation, WSDLBindingOperation bindingOperation, OperationMetaData operation)
   {
      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());
View Full Code Here

   protected void processOperationRPC(WSDLInterfaceOperation interfaceOperation, WSDLBindingOperation bindingOperation, OperationMetaData operation)
   {
      interfaceOperation.setStyle(Constants.URI_STYLE_RPC);

      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);
      }
View Full Code Here

               if (srcMessage.getPart(name) != null)
                  destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name));
            }
         }

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

            if (Constants.URI_STYLE_DOCUMENT == destOperation.getStyle())
            {
               WSDLInterfaceOperationInput destInput = new WSDLInterfaceOperationInput(destOperation);
               QName elementName = messagePartToElementName(srcMessage, srcPart, destOperation, destBinding);
               destInput.setElement(elementName);

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

               destInput.setPartName(srcPart.getName());
               processUnknownExtensibilityElements(srcMessage, destInput);

               destOperation.addInput(destInput);
            }
            else
View Full Code Here

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

         public void removeReference(QName element)
         {
            WSDLInterfaceOperationInput destIntfInput = destIntfOperation.getInput(element);
            if (destIntfInput != null)
               destIntfOperation.removeInput(element);
         }

         public void removeRPCPart(String partName)
         {
            WSDLInterfaceOperationInput operationInput = destIntfOperation.getInput(destIntfOperation.getName());
            operationInput.removeChildPart(partName);
         }
      };

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

/*  699 */           if (srcMessage.getPart(name) != null) {
/*  700 */             destOperation.addRpcSignatureItem(new WSDLRPCSignatureItem(name));
/*      */           }
/*      */         }
/*      */       }
/*  704 */       WSDLInterfaceOperationInput rpcInput = new WSDLInterfaceOperationInput(destOperation);
/*  705 */       for (Part srcPart : srcMessage.getOrderedParts(paramOrder))
/*      */       {
/*  708 */         if (ignorePart(srcPortType, srcPart)) {
/*      */           continue;
/*      */         }
/*  711 */         if ("http://www.w3.org/2004/03/wsdl/style/iri" == destOperation.getStyle())
/*      */         {
/*  713 */           WSDLInterfaceOperationInput destInput = new WSDLInterfaceOperationInput(destOperation);
/*  714 */           QName elementName = messagePartToElementName(srcMessage, srcPart, destOperation, destBinding);
/*  715 */           destInput.setElement(elementName);
/*      */
/*  718 */           destInput.setMessageName(srcMessage.getQName());
/*  719 */           destOperation.addProperty(new WSDLProperty("http://www.jboss.org/jbossws/messagename/in", srcMessage.getQName().getLocalPart()));
/*      */
/*  721 */           destInput.setPartName(srcPart.getName());
/*  722 */           processUnknownExtensibilityElements(srcMessage, destInput);
/*      */
/*  724 */           destOperation.addInput(destInput);
/*      */         }
/*      */         else
View Full Code Here

/* 1320 */         return this.val$srcBindingOperation.getOperation().getInput().getMessage().getPart(partName).getTypeName();
/*      */       }
/*      */
/*      */       public void removeReference(QName element)
/*      */       {
/* 1325 */         WSDLInterfaceOperationInput destIntfInput = this.val$destIntfOperation.getInput(element);
/* 1326 */         if (destIntfInput != null)
/* 1327 */           this.val$destIntfOperation.removeInput(element);
/*      */       }
/*      */
/*      */       public void removeRPCPart(String partName)
/*      */       {
/* 1332 */         WSDLInterfaceOperationInput operationInput = this.val$destIntfOperation.getInput(this.val$destIntfOperation.getName());
/* 1333 */         operationInput.removeChildPart(partName);
/*      */       }
/*      */     };
/* 1337 */     processBindingReference(srcWsdl, destBindingOperation, destIntfOperation, extList, input, srcBindingOperation, cb);
/*      */   }
View Full Code Here

/* 553 */     WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
/* 554 */     if (bindingOperation == null) {
/* 555 */       throw new WSException("Could not locate binding operation for:" + opMetaData.getQName());
/*     */     }
/*     */
/* 558 */     WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
/* 559 */     int wsdlPosition = 0;
/* 560 */     for (WSDLRPCPart part : input.getChildParts())
/*     */     {
/* 562 */       QName xmlType = part.getType();
/* 563 */       String partName = part.getName();
/* 564 */       QName xmlName = new QName(partName);
/*     */
View Full Code Here

/*     */     }
/*     */   }
/*     */
/*     */   private int processDocElement(OperationMetaData operation, WSDLInterfaceOperation wsdlOperation, WSDLBindingOperation bindingOperation, ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping, List<WrappedParameter> wrappedParameters, List<WrappedParameter> wrappedResponseParameters)
/*     */   {
/* 613 */     WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
/* 614 */     WSDLBindingOperationInput bindingInput = bindingOperation.getInputs()[0];
/*     */
/* 617 */     QName xmlName = input.getElement();
/* 618 */     QName xmlType = input.getXMLType();
/* 619 */     String javaTypeName = typeMapping.getJavaTypeName(xmlType);
/*     */
/* 621 */     TypesMetaData typesMetaData = operation.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
/* 622 */     TypeMappingMetaData typeMetaData = typesMetaData.getTypeMappingByXMLType(xmlType);
/* 623 */     if (typeMetaData != null) {
/* 624 */       javaTypeName = typeMetaData.getJavaTypeName();
/*     */     }
/* 626 */     if (javaTypeName == null) {
/* 627 */       throw new WSException("Cannot obtain java type mapping for: " + xmlType);
/*     */     }
/*     */
/* 630 */     boolean isWrapped = isWrapped(seiMethodMapping, javaTypeName);
/* 631 */     operation.getEndpointMetaData().setParameterStyle(isWrapped ? SOAPBinding.ParameterStyle.WRAPPED : SOAPBinding.ParameterStyle.BARE);
/*     */
/* 633 */     ParameterMetaData inMetaData = new ParameterMetaData(operation, xmlName, xmlType, javaTypeName);
/* 634 */     operation.addParameter(inMetaData);
/*     */     int wsdlPosition;
/*     */     int wsdlPosition;
/* 637 */     if (inMetaData.getOperationMetaData().isDocumentWrapped())
/*     */     {
/* 639 */       if (seiMethodMapping == null) {
/* 640 */         throw new IllegalArgumentException("Cannot wrap parameters without SEI method mapping");
/*     */       }
/* 642 */       ServiceEndpointInterfaceMapping seiMapping = seiMethodMapping.getServiceEndpointInterfaceMapping();
/* 643 */       JavaXmlTypeMapping javaXmlTypeMapping = seiMapping.getJavaWsdlMapping().getTypeMappingForQName(xmlType);
/* 644 */       if (javaXmlTypeMapping == null) {
/* 645 */         throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);
/*     */       }
/* 647 */       Map variableMap = createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
/* 648 */       for (MethodParamPartsMapping partMapping : seiMethodMapping.getMethodParamPartsMappings())
/*     */       {
/* 650 */         WsdlMessageMapping wsdlMessageMapping = partMapping.getWsdlMessageMapping();
/* 651 */         if (wsdlMessageMapping.isSoapHeader()) {
/*     */           continue;
/*     */         }
/* 654 */         if (wsdlMessageMapping == null) {
/* 655 */           throw new IllegalArgumentException("wsdl-message-message mapping required for document/literal wrapped");
/*     */         }
/* 657 */         String elementName = wsdlMessageMapping.getWsdlMessagePartName();
/*     */
/* 660 */         if (bindingInput.getMimePart(elementName) != null) {
/*     */           continue;
/*     */         }
/* 663 */         String variable = (String)variableMap.get(elementName);
/* 664 */         if (variable == null) {
/* 665 */           throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);
/*     */         }
/* 667 */         WrappedParameter wrapped = new WrappedParameter(new QName(elementName), partMapping.getParamType(), variable, partMapping.getParamPosition());
/*     */
/* 669 */         String parameterMode = wsdlMessageMapping.getParameterMode();
/* 670 */         if ((parameterMode == null) || (parameterMode.length() < 2)) {
/* 671 */           throw new IllegalArgumentException("Invalid parameter mode for element: " + elementName);
/*     */         }
/* 673 */         if (!"OUT".equals(parameterMode))
/* 674 */           wrappedParameters.add(wrapped);
/* 675 */         if ("IN".equals(parameterMode))
/*     */           continue;
/* 677 */         wrapped.setHolder(true);
/*     */
/* 679 */         if ("INOUT".equals(parameterMode))
/* 680 */           wrapped = new WrappedParameter(wrapped);
/* 681 */         wrappedResponseParameters.add(wrapped);
/*     */       }
/*     */
/* 684 */       inMetaData.setWrappedParameters(wrappedParameters);
/* 685 */       wsdlPosition = wrappedParameters.size();
/*     */     }
/*     */     else
/*     */     {
/* 689 */       if (seiMethodMapping != null)
/*     */       {
/* 691 */         MethodParamPartsMapping part = seiMethodMapping.getMethodParamPartsMappingByPartName(input.getPartName());
/* 692 */         if (part != null)
/*     */         {
/* 694 */           inMetaData.setJavaTypeName(part.getParamType());
/* 695 */           inMetaData.setIndex(part.getParamPosition());
/*     */         }
View Full Code Here

/*     */
/*     */   protected void processOperationDOC(WSDLInterfaceOperation interfaceOperation, WSDLBindingOperation bindingOperation, OperationMetaData operation)
/*     */   {
/* 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());
View Full Code Here

TOP

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

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.