Package org.apache.beehive.wsm.model.jsr181

Examples of org.apache.beehive.wsm.model.jsr181.SOAPBindingInfo


        for (BeehiveWsParameterMetadata cpm : paraMeta) {
          outParamMap.put(cpm.getWpName(), cpm);
        }
      }
    }
    BeehiveWsMethodMetadata wmm = new Jsr181MethodMetadataImpl(opName, returnType,
        returnXMLType);

    wmm.setWmOperationName(opName);
    // FIXME jcolwell@bea.com 2004-Nov-10 --
    // do something better with the action
    wmm.setWmAction(opName);
    if (Void.TYPE.equals(returnType)) {

      if (paraMeta.length == 0) {
        // FIXME jcolwell@bea.com 2004-Nov-22 --
        // also check for faults before setting as oneway.
        wmm.setOneWay(true);
      }
    } else {
      wmm.setWrName(paraMeta[0].getWpName());
      wmm.setWrTargetNamespace(paraMeta[0].getWpTargetNamespace());
    }

    methodMap.put(opName, wmm);

    List paramOrder = op.getParameterOrder(); // this is the one used by
    // rpc wsdls.
    TParam inputParam = op.getInput();
    if (inputParam != null) {

          TPart[] messageParts = messageMap.get(inputParam.getMessage()
              .getLocalPart());
       

        BeehiveWsParameterMetadata[] params = processParameters(opName, messageParts,  tBind, types,
          messageMap, wsm, false);

      if (paramOrder != null) {
        // Paramorder is only used for rpc.
        // if there is a paramoder then order the parameters, remove all the in/out parameters
        // from the out map
        for (Object ord : paramOrder) {
          for (BeehiveWsParameterMetadata wpm : params) {
            if (ord.equals(wpm.getWpName())) {
                if (outParamMap != null && outParamMap.containsKey(wpm.getWpName())) {
                    outParamMap.remove(wpm.getWpName()); // important...
                    // if this param is in.out it was in the out list
                    // also, so removeit.
                    wpm.setWpMode(WebParam.Mode.INOUT);
                  } else {
                    wpm.setWpMode(WebParam.Mode.IN);
                  }
              wmm.addParam(wpm);
              break;
            }
          }
        }
      } else if (params.length > 0) {
        for (BeehiveWsParameterMetadata wpm : params) {
          // FIXME jcolwell@bea.com 2005-Jan-04 --
          // Double check DOC/Lit rules
          if (outParamMap != null && outParamMap.containsKey(wpm.getWpName())) {
            outParamMap.remove(wpm.getWpName()); // important...
            // if
            // this param is
            // in.out it was
            // in the out list
            // also, so remove
            // it.
            wpm.setWpMode(WebParam.Mode.INOUT);
          } else {
            wpm.setWpMode(WebParam.Mode.IN);
          }
          wmm.addParam(wpm);
        }
      }
    }

    // do the pure out parameters.
    if (outParamMap != null && outParamMap.size() > 0) {
      if (outParamMap.size() == 1) {
        BeehiveWsParameterMetadata wpm = outParamMap.values().iterator().next();
        wmm.setXmlReturnType(wpm.getXmlType());
        wmm.setReturnType(wpm.getJavaType());
        wmm.setOneWay(false);
      } else {
        for (BeehiveWsParameterMetadata wpm : outParamMap.values()) {
          wpm.setWpMode(WebParam.Mode.OUT);
          wmm.addParam(wpm);
        }
      }
    }

   
View Full Code Here


    /**
     * Constructor.
     */
    public WsmAnnotationProcessor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) {
        super (atds, env);
        oms = new Jsr181ObjectModelStore(env);
    }
View Full Code Here

            // processing.
              if(!paramStyleIsSet)   // Only set the style to bare if it hasn't been done in previous parts processing
                  wsm.getSoapBinding().setParameterStyle(
                          SOAPBinding.ParameterStyle.BARE);

            BeehiveWsParameterMetadata wpm = new Jsr181ParameterMetadataImpl();

            wpm.setWpTargetNamespace(element.getNamespaceURI());
            wpm.setWpName(name);    //  NAME SHOULD BE THE NAME OF THE MESSAGE PART. element.getLocalPart());
            wpm.setXmlType(element);
            wpm.setJavaType(javaType);
            paramList.add(wpm);
          }
        } else { // this is an rpc and with no element attribute
          BeehiveWsParameterMetadata wpm = new Jsr181ParameterMetadataImpl();
          // FIXME jcolwell@bea.com 2004-Nov-09 -- figure out where
          // RPC parameter namespaces should be specified in the WSDL.
          wpm.setWpTargetNamespace(wsm.getWsTargetNamespace());
          wpm.setWpName(messagePart.getName());
          QName type = messagePart.getType();
          wpm.setXmlType(type);
          wpm.setJavaType(findClassForQname(type));
          /*
           * System.out.println(wpm.getWpName() + " of type " +
           * wpm.getJavaType());
           */
          paramList.add(wpm);
View Full Code Here

   * @param s
   * @param el
   */
  private BeehiveWsParameterMetadata elementToParamMetaData(
      String targetNamespace, Element el) {
    BeehiveWsParameterMetadata wpm = new Jsr181ParameterMetadataImpl();
    // FIXME
    // jcolwell@bea.com
    // 2004-Nov-09
    // double check the
    // namespace stuff
    wpm.setWpTargetNamespace(targetNamespace);
    boolean isArray = false;
    if (el.isSetMaxOccurs()) {
      if (0 != "1".compareTo(el.getMaxOccurs().toString()))
        isArray = true;
    } else if (el.isSetMinOccurs()) {
      String minOccur = el.getMinOccurs().toString();
      // If minoccur is other than 0, or 1 then it is array also
      if ("0" != minOccur && "1" != minOccur)
        isArray = true;
    }

    String name = null;
    QName xmlType = null;
    if (el.isSetName() && el.isSetType()) {

      name = el.getName();

      xmlType = el.getType();

    } else if (el.isSetRef()) {
      QName ref = el.getRef();
      name = ref.getLocalPart();
      xmlType = ref;

    } else
      throw new RuntimeException("invalid element: " + el);
    Class javaType = findClassForQname(xmlType);
    if (isArray) {
      // create an array of the type, then get its type.
      Object realType = Array.newInstance(javaType, 1);
      javaType = realType.getClass();
    }
    wpm.setWpName(name);
    wpm.setXmlType(xmlType);
    wpm.setJavaType(javaType);
    return wpm;
  }
View Full Code Here

                    om.merge(new MirrorTypeInfo(classDecl, _env));
                }
               
                // create object model from scratch
                else {
                    om = new Jsr181TypeMetadataImpl(new MirrorTypeInfo(classDecl, _env));
                }

                // check if we have an object model
                if (null == om) {
                    return;
                }

                // persist object model
                oms.store(om);
            }
           
            // service endpoint interface
            else if (_decl instanceof InterfaceDeclaration) {
                InterfaceDeclaration interfaceDecl = (InterfaceDeclaration) _decl;
               
                messager.printNotice("processing service endpoint interface: " + interfaceDecl.getQualifiedName());
               
                // create object model
                BeehiveWsTypeMetadata om = new Jsr181TypeMetadataImpl(new MirrorTypeInfo(interfaceDecl, _env));
                if (null == om) {
                    return;
                }

                // store the object model
View Full Code Here

  public BeehiveWsTypeMetadata getObjectModel(BindingLookupService lookupService)
      throws Exception {
  this.lookupService = lookupService;

    BeehiveWsTypeMetadata wsm = new Jsr181TypeMetadataImpl();
    Map<String, BeehiveWsMethodMetadata> methodMap = new HashMap<String, BeehiveWsMethodMetadata>();
    TDefinitions defs = defDoc.getDefinitions();
    wsm.setWsTargetNamespace(defs.getTargetNamespace());
    Map<String, TPart[]> messageMap = new HashMap<String, TPart[]>();

    if (defs.sizeOfServiceArray() > 0) {
      wsm.setWsServiceName(defs.getServiceArray(0).getName());
    }

    if (defs.sizeOfMessageArray() > 0) {
      TMessage[] messages = defs.getMessageArray();
      for (TMessage msg : messages) {
        messageMap.put(msg.getName(), msg.getPartArray());
      }
    }

    TBinding tBind = null;
    if (defs.sizeOfBindingArray() > 0) {
      tBind = defs.getBindingArray(0);
      processTBinding(tBind, wsm);
    }

    if (defs.sizeOfPortTypeArray() > 0) {
      TPortType tP = defs.getPortTypeArray(0);
      wsm.setWsName(tP.getName());
      TOperation[] operations = tP.getOperationArray();
      TTypes types = null;
      if (defs.sizeOfTypesArray() > 0) {
        types = defs.getTypesArray(0);
      }
View Full Code Here

  private void processTBinding(TBinding tBind, BeehiveWsTypeMetadata wsm)
      throws IllegalAccessException, NoSuchFieldException {

    org.xmlsoap.schemas.wsdl.soap.TBinding[] soapBinding = getSOAPBinding(tBind);
    BeehiveWsSOAPBindingInfo soapInfo = new SOAPBindingInfo();
    if (soapBinding != null && soapBinding.length > 0) {
      if (TStyleChoice.RPC.equals(soapBinding[0].getStyle())) {
        soapInfo.setStyle(SOAPBinding.Style.RPC);
      }
      wsm.setSoapBinding(soapInfo);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.beehive.wsm.model.jsr181.SOAPBindingInfo

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.