Package org.apache.soap.encoding

Examples of org.apache.soap.encoding.SOAPMappingRegistry


  public ServiceManagerClient (URL routerURL) {
    Serializer bs = new org.apache.soap.encoding.soapenc.BeanSerializer ();

    this.routerURL = routerURL;
    SOAPMappingRegistry smr = call.getSOAPMappingRegistry ();

    // register serializer/deserializer for DeploymentDescriptor.class
    // and TypeMapping.class
    smr.mapTypes (Constants.NS_URI_SOAP_ENC,
                  new QName (Constants.NS_URI_XML_SOAP,
                             "DeploymentDescriptor"),
                  DeploymentDescriptor.class, bs, (Deserializer) bs);
    bs = new TypeMappingSerializer ();
    smr.mapTypes (Constants.NS_URI_SOAP_ENC,
                  new QName (Constants.NS_URI_XML_SOAP, "TypeMapping"),
                  TypeMapping.class, bs, (Deserializer) bs);
  }
View Full Code Here


   * If one isn't there, then create one and store it in there and then
   * return it.
   */
  public static SOAPMappingRegistry
       getSMRFromContext (ServletContext context) {
    SOAPMappingRegistry smr = null;
    synchronized (context) {
      smr =
  (SOAPMappingRegistry) context.getAttribute ("__cached_servlet_SMR__");
      if (smr == null) {
  smr = new SOAPMappingRegistry ();
  context.setAttribute ("__cached_servlet_SMR__", smr);
      }
    }
    return smr;
  }
View Full Code Here

            Trc.exit(deep());
    }

    public static SOAPMappingRegistry createSOAPMappingRegistry(Call call) {
        Trc.entry(null,call);
        SOAPMappingRegistry smr = call.getSOAPMappingRegistry();

        // Add mapping registry entry for dateTime
        DateSerializer dateSer = new DateSerializer();
        // 1999 deserializer
        smr.mapTypes(
            Constants.NS_URI_SOAP_ENC,
            new org.apache.soap.util.xml.QName(
                Constants.NS_URI_1999_SCHEMA_XSD,
                "dateTime"),
            java.util.Date.class,
            null,
            dateSer);
        // 2000 deserializer
        smr.mapTypes(
            Constants.NS_URI_SOAP_ENC,
            new org.apache.soap.util.xml.QName(
                Constants.NS_URI_2000_SCHEMA_XSD,
                "dateTime"),
            java.util.Date.class,
            null,
            dateSer);
        // 2001 deserializer
        smr.mapTypes(
            Constants.NS_URI_SOAP_ENC,
            new org.apache.soap.util.xml.QName(
                Constants.NS_URI_2001_SCHEMA_XSD,
                "dateTime"),
            java.util.Date.class,
            null,
            dateSer);
        // Use current serializer for serialization
        smr.mapTypes(
            Constants.NS_URI_SOAP_ENC,
            new org.apache.soap.util.xml.QName(
                Constants.NS_URI_CURRENT_SCHEMA_XSD,
                "dateTime"),
            java.util.Date.class,
            dateSer,
            null);

        // Add mapping registry entry for base64
        Base64Serializer base64Ser = new Base64Serializer();
        // 1999 deserializer
        smr.mapTypes(
            Constants.NS_URI_SOAP_ENC,
            new org.apache.soap.util.xml.QName(
                Constants.NS_URI_1999_SCHEMA_XSD,
                "base64Binary"),
            byte[].class,
            null,
            base64Ser);
        // 2000 deserializer
        smr.mapTypes(
            Constants.NS_URI_SOAP_ENC,
            new org.apache.soap.util.xml.QName(
                Constants.NS_URI_2000_SCHEMA_XSD,
                "base64Binary"),
            byte[].class,
            null,
            base64Ser);
        // 2001 deserializer
        smr.mapTypes(
            Constants.NS_URI_SOAP_ENC,
            new org.apache.soap.util.xml.QName(
                Constants.NS_URI_2001_SCHEMA_XSD,
                "base64Binary"),
            byte[].class,
            null,
            base64Ser);
        // Use current serializer for serialization
        smr.mapTypes(
            Constants.NS_URI_SOAP_ENC,
            new org.apache.soap.util.xml.QName(
                Constants.NS_URI_CURRENT_SCHEMA_XSD,
                "base64Binary"),
            byte[].class,
View Full Code Here

        return call;
    }

    public SOAPMappingRegistry getSOAPMappingRegistry() {
        Trc.entry(this);
        SOAPMappingRegistry smr = getCall().getSOAPMappingRegistry();
        Trc.exit(smr);
        return smr;
    }
View Full Code Here

     */
    void prepare(WSIFMessage inputMessage, WSIFMessage outputMessage)
        throws WSIFException {
        Trc.entry(this, inputMessage, outputMessage);
        HashMap mapOfUserTypes = portInstance.getLocalTypeMap();
        SOAPMappingRegistry smr = portInstance.getSOAPMappingRegistry();

        // Instantiate serializers once for the entire prepare
        BeanSerializer beanSer = new BeanSerializer();
        PartSerializer partSer = null;
        if (partSerializerName != null) {
            try {
                partSer =
                    (PartSerializer) Class
                        .forName(
                            partSerializerName,
                            true,
                            Thread.currentThread().getContextClassLoader())
                        .newInstance();
            } catch (Throwable ignored) {
                Trc.ignoredException(ignored);
            }
        }

        // first determine list of arguments
        Input input = operation.getInput();
        if (input != null) {
            List parts;
            if (partNames != null) {
                parts = new Vector();
                for (Iterator i = partNames.iterator(); i.hasNext();) {
                    String partName = (String) i.next();
                    Part part = input.getMessage().getPart(partName);
                    if (part == null) {
                        throw new WSIFException(
                            "no input part named "
                                + partName
                                + " for binding operation "
                                + getName());
                    }
                    parts.add(part);
                }
            } else {
                parts = input.getMessage().getOrderedParts(null);
            }
            int count = parts.size();
            names = new String[count];
            types = new Class[count];

            // get parts in correct order
            for (int i = 0; i < count; ++i) {
                Part part = (Part) parts.get(i);
                names[i] = part.getName();
                QName partType = part.getTypeName();
                if (partType == null)
                    partType = part.getElementName();
                if (partType == null) {
                    throw new WSIFException(
                        "part " + names[i] + " must have type name declared");
                }

                org.apache.soap.util.xml.QName qname =
                    new org.apache.soap.util.xml.QName(
                        partType.getNamespaceURI(),
                        partType.getLocalPart());
                try {
                    types[i] = (Class) mapOfUserTypes.get(qname);
                } catch (Throwable ignored) {
                    Trc.ignoredException(ignored);
                }
                if (types[i] == null) {
                    try {
                        types[i] =
                            (Class) smr.queryJavaType(
                                qname,
                                inputEncodingStyle);
                    } catch (Throwable exn) {
                        if (types[i] == null) {
                            try {
                                String packageName =
                                    WSIFUtils.getPackageNameFromNamespaceURI(
                                        qname.getNamespaceURI());
                                String className =
                                    WSIFUtils.getJavaClassNameFromXMLName(
                                        qname.getLocalPart());
                                Class inputClass = null;
                                try {
                                    inputClass =
                                    Class.forName(
                                        packageName + "." + className,
                                        true,
                                        Thread
                                            .currentThread()
                                            .getContextClassLoader());
                                } catch (ClassNotFoundException exn5) {
                                    inputClass =
                                        Class.forName(
                                            packageName
                                                + "."
                                                + className
                                                + "Element",
                                            true,
                                            Thread
                                                .currentThread()
                                                .getContextClassLoader());
                                }
                                types[i] = inputClass;
                                if ("literal".equals(inputUse)) {
                                  smr.mapTypes("literal", qname, inputClass, partSer, partSer);
                                } else {
                                smr.mapTypes(
                                    Constants.NS_URI_SOAP_ENC,
                                    qname,
                                    inputClass,
                                    beanSer,
                                    beanSer);
                                }
                                mapSubtypes(inputClass, beanSer, partSer, smr, inputUse);
                            } catch (ClassNotFoundException exn1) {
                              Trc.ignoredException(exn1);
                            }
                        }
                    }

                }
            }
        } else {
            names = new String[0];
            types = new Class[0];
        }

        // now prepare return value
        Output output = operation.getOutput();
        if (output != null) {
            Part returnPart = null;
            if (returnName != null) {
                returnPart = output.getMessage().getPart(returnName);
                if (returnPart == null) {
                    throw new WSIFException(
                        "no output part named "
                            + returnName
                            + " for bining operation "
                            + getName());
                }
            } else {
                List parts = output.getMessage().getOrderedParts(null);
                if (parts.size() > 0) {
                    returnPart = (Part) parts.get(0);
                    returnName = returnPart.getName();
                }
            }

            if (returnPart != null) {
                QName partType = returnPart.getTypeName();
                if (partType == null)
                    partType = returnPart.getElementName();

                org.apache.soap.util.xml.QName qname =
                    new org.apache.soap.util.xml.QName(
                        partType.getNamespaceURI(),
                        partType.getLocalPart());

                try {
                    returnType = (Class) mapOfUserTypes.get(qname);
                } catch (Throwable ignored) {
                    Trc.ignoredException(ignored);
                }

                if (returnType == null) {
                    try {
                        returnType =
                            (Class) smr.queryJavaType(
                                qname,
                                outputEncodingStyle);
                    } catch (Throwable exn) {
                        if (returnType == null) {
                            try {
                                String packageName =
                                    WSIFUtils.getPackageNameFromNamespaceURI(
                                        qname.getNamespaceURI());
                                String className =
                                    WSIFUtils.getJavaClassNameFromXMLName(
                                        qname.getLocalPart());
                                try {
                                    returnType =
                                        Class.forName(
                                            packageName + "." + className,
                                            true,
                                            Thread
                                                .currentThread()
                                                .getContextClassLoader());
                                } catch (ClassNotFoundException exn5) {
                                    returnType =
                                        Class.forName(
                                            packageName
                                                + "."
                                                + className
                                                + "Element",
                                            true,
                                            Thread
                                                .currentThread()
                                                .getContextClassLoader());
                                }
                                if ("literal".equals(outputUse)) {
                                    smr.mapTypes(
                                        "literal",
                                        qname,
                                        returnType,
                                        partSer,
                                        partSer);
                                } else {
                                    smr.mapTypes(
                                        Constants.NS_URI_SOAP_ENC,
                                        qname,
                                        returnType,
                                        beanSer,
                                        beanSer);
View Full Code Here

        if (!(msg instanceof javax.jms.TextMessage)) {
            throw new WSIFException("response not a javax.jms.TextMessage");
        }

        HashMap mapOfUserTypes = new HashMap();
        SOAPMappingRegistry smr =
            WSIFPort_ApacheSOAP.createSOAPMappingRegistry(new Call());
         
        // clear port to ensure setupTypeMappings does something
        setDynamicWSIFPort( null );
View Full Code Here

  public ServiceManagerClient (URL routerURL) {
    Serializer bs = new org.apache.soap.encoding.soapenc.BeanSerializer ();

    this.routerURL = routerURL;
    SOAPMappingRegistry smr = call.getSOAPMappingRegistry ();

    // register serializer/deserializer for DeploymentDescriptor.class
    // and TypeMapping.class
    smr.mapTypes (Constants.NS_URI_SOAP_ENC,
      new QName (Constants.NS_URI_XML_SOAP,
           "DeploymentDescriptor"),
      DeploymentDescriptor.class, bs, (Deserializer) bs);
    bs = new TypeMappingSerializer ();
    smr.mapTypes (Constants.NS_URI_SOAP_ENC,
      new QName (Constants.NS_URI_XML_SOAP, "TypeMapping"),
      TypeMapping.class, bs, (Deserializer) bs);
  }
View Full Code Here

 
  public void connect() throws Exception {
    connect(factParams, identity);

    // Building the Call object for sending the requests:
    SOAPMappingRegistry mappingReg = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();

    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "AbstractJmsRequest"),
                                  AbstractJmsRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "CnxConnectRequest"),
                                  CnxConnectRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "CnxStartRequest"),
                                  CnxStartRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "CnxStopRequest"),
                                  CnxStopRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "CnxCloseRequest"),
                                  CnxCloseRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "ConsumerAckRequest"),
                                  ConsumerAckRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "ConsumerDenyRequest"),
                                  ConsumerDenyRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService",
                                  "ConsumerReceiveRequest"),
                                  ConsumerReceiveRequest.class, beanSer,
                                  beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService",
                                  "ConsumerSetListRequest"),
                                  ConsumerSetListRequest.class, beanSer,
                                  beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService",
                                  "ConsumerUnsetListRequest"),
                                  ConsumerUnsetListRequest.class, beanSer,
                                  beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "ConsumerSubRequest"),
                                  ConsumerSubRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "ConsumerUnsubRequest"),
                                  ConsumerUnsubRequest.class,
                                  beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService",
                                  "ConsumerCloseSubRequest"),
                                  ConsumerCloseSubRequest.class, beanSer,
                                  beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "QBrowseRequest"),
                                  QBrowseRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "SessAckRequest"),
                                  SessAckRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "SessDenyRequest"),
                                  SessDenyRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "SessCreateDestRequest"),
                                  SessCreateDestRequest.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "TempDestDeleteRequest"),
                                  TempDestDeleteRequest.class, beanSer,
                                  beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "GetAdminTopicRequest"),
                                  GetAdminTopicRequest.class, beanSer,
                                  beanSer);

    sendCall = new Call();
    sendCall.setSOAPMappingRegistry(mappingReg);
    sendCall.setTargetObjectURI("urn:ProxyService");
    sendCall.setMethodName("send");
    sendCall.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

    mappingReg = new SOAPMappingRegistry();
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "AbstractJmsReply"),
                                  AbstractJmsReply.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "CnxConnectReply"),
                                  CnxConnectReply.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "ServerReply"),
                                  ServerReply.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "SessCreateTDReply"),
                                  SessCreateDestReply.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "CnxCloseReply"),
                                  CnxCloseReply.class, beanSer, beanSer);
    mappingReg.mapTypes(Constants.NS_URI_SOAP_ENC,
                        new QName("urn:ProxyService", "GetAdminTopicReply"),
                                  GetAdminTopicReply.class, beanSer, beanSer);

    receiveCall = new Call();
    receiveCall.setSOAPMappingRegistry(mappingReg);
View Full Code Here

  public ServiceManagerClient (URL routerURL) {
    Serializer bs = new org.apache.soap.encoding.soapenc.BeanSerializer ();

    this.routerURL = routerURL;
    SOAPMappingRegistry smr = call.getSOAPMappingRegistry ();

    // register serializer/deserializer for DeploymentDescriptor.class
    // and TypeMapping.class
    smr.mapTypes (Constants.NS_URI_SOAP_ENC,
                  new QName (Constants.NS_URI_XML_SOAP,
                             "DeploymentDescriptor"),
                  DeploymentDescriptor.class, bs, (Deserializer) bs);
    bs = new TypeMappingSerializer ();
    smr.mapTypes (Constants.NS_URI_SOAP_ENC,
                  new QName (Constants.NS_URI_XML_SOAP, "TypeMapping"),
                  TypeMapping.class, bs, (Deserializer) bs);
  }
View Full Code Here

TOP

Related Classes of org.apache.soap.encoding.SOAPMappingRegistry

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.