Package railo.runtime.net.rpc

Examples of railo.runtime.net.rpc.RPCException


        parameters = (Parameters)bEntry.getParameters().get(tmpOp);
                break;
      }
    }
    if(operation == null || parameters == null)
      throw new RPCException("Cannot locate method " + methodName + " in webservice " + wsdlUrl);
   
        org.apache.axis.client.Call call = (Call)axisService.createCall(QName.valueOf(port.getName()), QName.valueOf(tmpOp.getName()));
       
        if(!StringUtil.isEmpty(username,true)){
          call.setUsername(username);
          call.setPassword(password);
        }
       
        org.apache.axis.encoding.TypeMapping tm = (org.apache.axis.encoding.TypeMapping)
          axisService.getTypeMappingRegistry().getDefaultTypeMapping();
        //TypeMappingRegistry reg=(TypeMappingRegistry) axisService.getTypeMappingRegistry();
       
        //tm=reg.getOrMakeTypeMapping("http://schemas.xmlsoap.org/soap/encoding/");
        tm=call.getMessageContext().getTypeMapping();
       
        Vector<String> inNames = new Vector<String>();
    Vector<Parameter> inTypes = new Vector<Parameter>();
    Vector<String> outNames = new Vector<String>();
    Vector<Parameter> outTypes = new Vector<Parameter>();
    for(int j = 0; j < parameters.list.size(); j++) {
      p = (Parameter)parameters.list.get(j);
      map(pc,secondChanceConfig,call,tm,p.getType());
      switch(p.getMode()) {
            case Parameter.IN:
                inNames.add(p.getQName().getLocalPart());
                inTypes.add(p);
            break;
            case Parameter.OUT:
                outNames.add(p.getQName().getLocalPart());
                outTypes.add(p);
            break;
            case Parameter.INOUT:
                inNames.add(p.getQName().getLocalPart());
                inTypes.add(p);
                outNames.add(p.getQName().getLocalPart());
                outTypes.add(p);
            break;
            }
    }

    // set output type
    if (parameters.returnParam != null) {
          QName rtnQName = parameters.returnParam.getQName();
          TypeEntry rtnType = parameters.returnParam.getType();
          map(pc,secondChanceConfig,call,tm,rtnType);
            outNames.add(rtnQName.getLocalPart());
            outTypes.add(parameters.returnParam);
           
        }
       
       
       
        //Iterator it = outTypes.iterator();
      
        // check arguments
        Object[] inputs = new Object[inNames.size()];
        TimeZone tz;
    if(pc==null)tz=ThreadLocalPageContext.getTimeZone(secondChanceConfig);
    else tz=ThreadLocalPageContext.getTimeZone(pc);
        if(arguments!=null) {
        if(inNames.size() != arguments.length)
          throw new RPCException("Invalid arguments count for operation " + methodName+" ("+arguments.length+" instead of "+inNames.size()+")");
       
            for(int pos = 0; pos < inNames.size(); pos++) {
          p = inTypes.get(pos);
          inputs[pos]=getArgumentData(tm,tz, p, arguments[pos]);
        }
        }
        else {
          UDFUtil.argumentCollection(namedArguments);
            if(inNames.size() != namedArguments.size())
                throw new RPCException("Invalid arguments count for operation " + methodName+" ("+namedArguments.size()+" instead of "+inNames.size()+")");
           
           
            Object arg;
            for(int pos = 0; pos < inNames.size(); pos++) {
                p = inTypes.get(pos);
                arg=namedArguments.get(KeyImpl.init(p.getName()),null);
               
                if(arg==null) {
                    throw new RPCException("Invalid arguments for operation " + methodName,
                            getErrorDetailForArguments(inNames.toArray(new String[inNames.size()]),CollectionUtil.keysAsString(namedArguments)));
                }
                inputs[pos]=getArgumentData(tm,tz, p, arg);
            }
        }
View Full Code Here


      }

    }

    if(symTabEntry == null)
      throw new RPCException("Can't locate service entry in WSDL");
    return ((ServiceEntry)symTabEntry).getService();
  }
View Full Code Here

          if(list.get(i) instanceof SOAPAddress)
            return port;

      }
    }
    throw new RPCException("Can't locate port entry for service " + service.getQName().toString() + " WSDL");
  }
View Full Code Here

        return strType;
  }

  @Override
    public String castToString() throws ExpressionException {
        throw new RPCException("can't cast Webservice to a string");
    }
View Full Code Here

    return defaultValue;
  }

    @Override
    public boolean castToBooleanValue() throws ExpressionException {
        throw new RPCException("can't cast Webservice to a boolean");
    }
View Full Code Here

        return defaultValue;
    }

    @Override
    public double castToDoubleValue() throws ExpressionException {
        throw new RPCException("can't cast Webservice to a number");
    }
View Full Code Here

        return defaultValue;
    }

    @Override
    public DateTime castToDateTime() throws RPCException {
        throw new RPCException("can't cast Webservice to a Date Object");
    }
View Full Code Here

    return new ObjectsEntryIterator(keyIterator(), this);
  }

  @Override
    public String castToString() throws ExpressionException {
        throw new RPCException("can't cast Webservice to a string");
    }
View Full Code Here

    return defaultValue;
  }

    @Override
    public boolean castToBooleanValue() throws ExpressionException {
        throw new RPCException("can't cast Webservice to a boolean");
    }
View Full Code Here

        return defaultValue;
    }

    @Override
    public double castToDoubleValue() throws ExpressionException {
        throw new RPCException("can't cast Webservice to a number");
    }
View Full Code Here

TOP

Related Classes of railo.runtime.net.rpc.RPCException

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.