Package org.apache.axis2.om

Examples of org.apache.axis2.om.OMAttribute


            Parameter paramter = new ParameterImpl();
            //setting paramterElement
            paramter.setParameterElement(paramterElement);

            //setting paramter Name
            OMAttribute paraName = paramterElement.getAttribute(
                    new QName(ATTNAME));
            if(paraName == null ){
                throw new DeploymentException(
                        Messages.getMessage(DeploymentErrorMsgs.BAD_PARA_ARGU));
            }
            paramter.setName(paraName.getValue());

            //setting paramter Value (the chiled elemnt of the paramter)
            OMElement paraValue = paramterElement.getFirstElement();
            if(paraValue !=null){
                paramter.setValue(paramterElement);
                paramter.setParamterType(Parameter.DOM_PARAMETER);
            } else {
                String paratestValue = paramterElement.getText();
                paramter.setValue(paratestValue);
                paramter.setParamterType(Parameter.TEXT_PARAMETER);
            }

            //setting locking attribute
            OMAttribute paraLocked = paramterElement.getAttribute(
                    new QName(ATTLOCKED));
            Parameter parentpara = null;
            if (parent !=null) {
                parentpara = parent.getParameter(paramter.getName());
            }
            if (paraLocked !=null) {
                String lockedValue = paraLocked.getValue();
                if("true".equals(lockedValue)){
                    //if the parameter is locked at some levle paramer value replace by that
                    if(parent!=null && parent.isParamterLocked(paramter.getName())){
                        throw new DeploymentException("The paramter " + paramter.getName() + " has" +
                                " locked at top levle can not overide");
View Full Code Here


    protected void processOpeasrtionModuleRefs(Iterator moduleRefs
            , OperationDescription opeartion) throws DeploymentException {
        try {
            while (moduleRefs.hasNext()) {
                OMElement moduleref = (OMElement) moduleRefs.next();
                OMAttribute moduleRefAttribute = moduleref.getAttribute(
                        new QName(REF));
                if (moduleRefAttribute !=null) {
                    String refName = moduleRefAttribute.getValue();
                    if(engine.getModule(new QName(refName)) == null) {
                        throw new DeploymentException(Messages.getMessage(
                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
                    } else {
                        opeartion.addModule(new QName(refName));
View Full Code Here

        }
    }

    protected MessageReceiver loadMessageReceiver(ClassLoader loader , OMElement reciverElement)
            throws DeploymentException {
        OMAttribute recieverName = reciverElement.getAttribute(
                new QName(CLASSNAME));
        String className = recieverName.getValue();
        MessageReceiver receiver = null;
        try{
            Class messageReceiver ;
            if (className != null &&!"".equals(className)) {
                messageReceiver = Class.forName(className,true,loader);
View Full Code Here

    private void insertAttachmentNodes(OMElement element, SOAPMessage soapMsg) throws SOAPException {
      Iterator childIter = element.getChildElements();
      while(childIter.hasNext()) {
        OMElement child = (OMElement)childIter.next();
        //check if there is an href attribute
        OMAttribute hrefAttr = (OMAttribute)child.getFirstAttribute(new QName("href"));
        String hrefContentId = validateHref(hrefAttr);
       
        if (hrefContentId!=null) {//This is an element referencing an attachment!
          OMText omText = getOMTextForReferencedAttachment(hrefContentId, soapMsg);
          child.build();
View Full Code Here

            AttachmentPart ap = soapMsg.createAttachmentPart(actualDH);
            String contentId = SessionUtils.generateSessionId();
            ap.setContentId(contentId);
            ap.setContentType(actualDH.getContentType());
            OMElement parent = (OMElement)child.getParent();
            OMAttribute attr = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createOMAttribute("href", null,"cid:"+contentId);
            parent.addAttribute(attr);
            binaryNode.detach();
            soapMsg.addAttachmentPart(ap);
          }
        } else{
View Full Code Here

        ArrayList operations = new ArrayList();
        while (opeartinsItr.hasNext()) {
            OMElement operation = (OMElement) opeartinsItr.next();

            // /getting opeartion name
            OMAttribute op_name_att = operation.getAttribute(
                    new QName(ATTNAME));
            if(op_name_att == null){
                throw new DeploymentException(Messages.getMessage("Invalide Operations"));
            }
            String opname = op_name_att.getValue();
            OperationDescription op_descrip = service.getOperation(new QName(opname));
            if(op_descrip == null){
                op_descrip = new OperationDescription();
                op_descrip.setName(new QName(opname));
                log.info(Messages.getMessage(DeploymentErrorMsgs.OP_NOT_FOUN_IN_WSDL, opname));
            }

            //setting the mep of the operation
            OMAttribute op_mep_att = operation.getAttribute(
                    new QName(MEP));
            if(op_mep_att !=null){
                String mep = op_mep_att.getValue();
                op_descrip.setMessageExchangePattern(mep);
            }

            //Opeartion Paramters
            Iterator paramters = operation.getChildrenWithName(
View Full Code Here

    protected void processServiceModuleConfig(Iterator moduleConfigs ,
                                              ParameterInclude parent, ServiceDescription service)
            throws DeploymentException {
        while (moduleConfigs.hasNext()) {
            OMElement moduleConfig = (OMElement) moduleConfigs.next();
            OMAttribute moduleName_att = moduleConfig.getAttribute(
                    new QName(ATTNAME));
            if(moduleName_att == null){
                throw new DeploymentException("Invalid module configuration");
            } else {
                String module = moduleName_att.getValue();
                ModuleConfiguration moduleConfiguration =
                        new ModuleConfiguration(new QName(module),parent);
                Iterator paramters=  moduleConfig.getChildrenWithName(new QName(PARAMETERST));
                processParameters(paramters,moduleConfiguration,parent);
                service.addModuleConfig(moduleConfiguration);
View Full Code Here

    protected void processOperationModuleConfig(Iterator moduleConfigs ,
                                                ParameterInclude parent, OperationDescription opeartion)
            throws DeploymentException {
        while (moduleConfigs.hasNext()) {
            OMElement moduleConfig = (OMElement) moduleConfigs.next();
            OMAttribute moduleName_att = moduleConfig.getAttribute(
                    new QName(ATTNAME));
            if(moduleName_att == null){
                throw new DeploymentException("Invalid module configuration");
            } else {
                String module = moduleName_att.getValue();
                ModuleConfiguration moduleConfiguration =
                        new ModuleConfiguration(new QName(module),parent);
                Iterator paramters=  moduleConfig.getChildrenWithName(new QName(PARAMETERST));
                processParameters(paramters,moduleConfiguration,parent);
                opeartion.addModuleConfig(moduleConfiguration);
View Full Code Here

     */
    protected void processModuleRefs(Iterator moduleRefs) throws DeploymentException {
        try {
            while (moduleRefs.hasNext()) {
                OMElement moduleref = (OMElement) moduleRefs.next();
                OMAttribute moduleRefAttribute = moduleref.getAttribute(
                        new QName(REF));
                if(moduleRefAttribute !=null){
                    String refName = moduleRefAttribute.getValue();
                    if(engine.getModule(new QName(refName)) == null) {
                        throw new DeploymentException(Messages.getMessage(
                                DeploymentErrorMsgs.MODEULE_NOT_FOUND, refName));
                    } else {
                        service.addModuleref(new QName(refName));
View Full Code Here

            Iterator serviceitr = servcice.getChildrenWithName(new QName(SERVICE_ELEMENT));
            while (serviceitr.hasNext()) {
                OMElement service = (OMElement) serviceitr.next();

                OMAttribute serviceNameatt = service.getAttribute(
                        new QName(ATTNAME));
                String serviceName = serviceNameatt.getValue();
                if(serviceName == null){
                    throw new DeploymentException("Service Name required");
                } else {
                    ServiceDescription serviceDecs = engine.getCurrentFileItem().getService(
                            serviceName);
View Full Code Here

TOP

Related Classes of org.apache.axis2.om.OMAttribute

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.