Package javax.xml.rpc.namespace

Examples of javax.xml.rpc.namespace.QName


            if (wsdlLocation != null) {
                addr = new StringRefAddr(
                        ServiceFactory.WSDL_LOCATION, wsdlLocation.toString());
                reference.add(addr);
            }
            QName serviceName = getServiceName();
            if (serviceName != null) {
                addr = new StringRefAddr(ServiceFactory.SERVICE_NAMESPACE,
                        serviceName.getNamespaceURI());
                reference.add(addr);
                addr = new StringRefAddr(ServiceFactory.SERVICE_LOCAL_PART,
                        serviceName.getLocalPart());
                reference.add(addr);
            }
        }
        if (maintainSession) {
            addr = new StringRefAddr(ServiceFactory.MAINTAIN_SESSION, "true");
View Full Code Here


        super(e);
       
        String name = e.getAttribute("name");
        if (name != null && !name.equals("")) {
//            qname = XMLUtils.getQNameFromString(name, e);
            qname = new QName("", name);
        }
       
        String typeStr = e.getAttribute("type");
        if (typeStr != null && !typeStr.equals("")) {
            type = XMLUtils.getQNameFromString(typeStr, e);
View Full Code Here

     *
     * @param name XXX
     */
    public void setName(String name)
    {
        qname = new QName(null, name);
    }
View Full Code Here

     * @throws ClassNotFoundException XXX
     */
    public Class getJavaClass()
        throws ClassNotFoundException
    {
        QName type = getType();
        if (type != null &&
                WSDDConstants.WSDD_JAVA.equals(type.getNamespaceURI())) {
            return Class.forName(type.getLocalPart());
        }
        return null;
    }
View Full Code Here

        // This is a param.
        currentParam = new RPCParam(namespace, localName, null);
        rpcElem.addParam(currentParam);
       
        MessageElement curEl = context.getCurElement();
        QName type = null;
        QName qname = new QName(namespace, localName);
        ParameterDesc paramDesc = null;

        // Grab xsi:type attribute if present, on either this element or
        // the referent (if it's an href).
        if (curEl.getHref() != null) {
View Full Code Here

      String  symbol = args[0] ;
      Service  service = new Service();
      Call     call    = (Call) service.createCall();

      call.setTargetEndpointAddress( new java.net.URL(opts.getURL()) );
      call.setOperationName( new QName("urn:cominfo", "getInfo") );
      call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
      call.addParameter( "info", XMLType.XSD_STRING, ParameterMode.IN );
      call.setReturnType( XMLType.XSD_STRING );
      call.setUsername( opts.getUser() );
      call.setPassword( opts.getPassword() );
View Full Code Here

            // This may have changed, so get it again...
            // FIXME (there should be a cleaner way to do this)
            operation = msgContext.getOperation();

            if (operation == null) {
                QName qname = new QName(body.getNamespaceURI(),
                                        body.getName());
                operation = serviceDesc.getOperationByElementQName(qname);
            }

            if (operation == null) {
                throw new AxisFault(JavaUtils.getMessage("noSuchOperation",
                                                         methodName));
            }

            // Create the array we'll use to hold the actual parameter
            // values.  We know how big to make it from the metadata.
            Object[]     argValues  =  new Object [operation.getNumParams()];

            // A place to keep track of the out params (INOUTs and OUTs)
            ArrayList outs = new ArrayList();

            // Put the values contained in the RPCParams into an array
            // suitable for passing to java.lang.reflect.Method.invoke()
            // Make sure we respect parameter ordering if we know about it
            // from metadata, and handle whatever conversions are necessary
            // (values -> Holders, etc)
            if ( args != null && args.size() > 0 ) {
                for ( int i = 0 ; i < numArgs ; i++ ) {
                    RPCParam rpcParam = (RPCParam)args.get(i);
                    Object value = rpcParam.getValue();
                    ParameterDesc paramDesc = rpcParam.getParamDesc();
                    if (paramDesc != null && paramDesc.getJavaType() != null) {
                        value = JavaUtils.convert(value,
                                                  paramDesc.getJavaType());
                        rpcParam.setValue(value);
                        if (paramDesc.getMode() == ParameterDesc.INOUT)
                            outs.add(rpcParam);
                    }
                    if (paramDesc == null || paramDesc.getOrder() == -1) {
                        argValues[i= value;
                    } else {
                        argValues[paramDesc.getOrder()] = value;
                    }

                    if (log.isDebugEnabled()) {
                        log.debug("  " + JavaUtils.getMessage("value00",
                            "" + argValues[i]) );
                    }
                }
            }

            // Check if we can find a Method by this name
            // FIXME : Shouldn't this type of thing have already occurred?
            checkMethodName(msgContext, allowedMethods, operation.getName());

            // Now create any out holders we need to pass in
            if (numArgs < argValues.length) {
                ArrayList outParams = operation.getOutParams();
                for (int i = 0; i < outParams.size(); i++) {
                    ParameterDesc param = (ParameterDesc)outParams.get(i);
                    Class holderClass = param.getJavaType();
                    if (Holder.class.isAssignableFrom(holderClass)) {
                        argValues[numArgs + i] = holderClass.newInstance();
                        // Store an RPCParam in the outs collection so we
                        // have an easy and consistent way to write these
                        // back to the client below
                        outs.add(new RPCParam(param.getQName(),
                                              argValues[numArgs + i]));
                    } else {
                        // !!! Throw a fault here?
                    }
                }
            }

            // OK!  Now we can invoke the method
            Object objRes = operation.getMethod().invoke(obj, argValues);

            /* Now put the result in the result SOAPEnvelope */
            /*************************************************/
            RPCElement resBody = new RPCElement(methodName + "Response");
            resBody.setPrefix( body.getPrefix() );
            resBody.setNamespaceURI( body.getNamespaceURI() );
            resBody.setEncodingStyle(msgContext.getEncodingStyle());

            // Return first
            if ( operation.getMethod().getReturnType() != Void.TYPE ) {
                QName returnQName = operation.getReturnQName();
                if (returnQName == null) {
                    returnQName = new QName("", methodName + "Return");
                }
                RPCParam param = new RPCParam(returnQName, objRes);
                resBody.addParam(param);
            }

View Full Code Here

public class PrefixedQName implements Name {
    private String prefix;
    private QName qName;
   
    public PrefixedQName(String uri, String localName, String pre) {
        qName = new QName(uri, localName);
        prefix = pre;
    }
View Full Code Here

        if (nameStr != null && !nameStr.equals("")) {
            parameter.setQName(XMLUtils.getQNameFromString(nameStr, e));
        } else {
            nameStr = e.getAttribute("name");
            if (nameStr != null && !nameStr.equals("")) {
                parameter.setQName(new QName(null, nameStr));
            }
        }
       
        String modeStr = e.getAttribute("mode");
        if (modeStr != null && !modeStr.equals("")) {
View Full Code Here

     */
    public void writeToContext(SerializationContext context)
            throws IOException {
        AttributesImpl attrs = new AttributesImpl();
       
        QName qname = parameter.getQName();
        if (qname != null) {
            if (qname.getNamespaceURI() != null &&
                !qname.getNamespaceURI().equals("")) {
                attrs.addAttribute("", "qname", "qname",
                               "CDATA",
                               context.qName2String(parameter.getQName()));
            } else {
                attrs.addAttribute("", "name", "name", "CDATA",
                                   parameter.getQName().getLocalPart());
            }
        }

        // Write the mode attribute, but only if it's not the default (IN)
        byte mode = parameter.getMode();
        if (mode != ParameterDesc.IN) {
            String modeStr = ParameterDesc.getModeAsString(mode);
            attrs.addAttribute("", "mode", "mode", "CDATA", modeStr);
        }
       
        QName typeQName = parameter.getTypeQName();
        if (typeQName != null) {
            attrs.addAttribute("", "type", "type", "CDATA",
                               context.qName2String(typeQName));           
        }
       
View Full Code Here

TOP

Related Classes of javax.xml.rpc.namespace.QName

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.