Examples of createUnmarshaller()


Examples of javax.xml.bind.JAXBContext.createUnmarshaller()

    List<SoapEventMap> events = new ArrayList<SoapEventMap>();

    try {
      JAXBContext jcontext = JAXBContext.newInstance(this.eventPkg);

      Unmarshaller unmarshaller = jcontext.createUnmarshaller();

      if (this.elements != null) {
        for (Element element : this.elements) {
          if (element != null) {
            SoapEventMap event = new SoapEventMap();
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createUnmarshaller()

  static public Object unmarshall(String path, String pkg, ClassLoader loader)
      throws Exception {
    LOGGER.debug("Unmarshalling " + path + " in package " + pkg); //$NON-NLS-1$ //$NON-NLS-2$
    JAXBContext jc = JAXBContext.newInstance(pkg, loader);
    Unmarshaller u = jc.createUnmarshaller();
    InputStream istream = ClassLoader.getSystemResourceAsStream(path);

    return u.unmarshal(istream);
  }
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createUnmarshaller()

  {
    try {
      if (_handlerChainUnmarshaller == null) {
        JAXBContext context =
          JAXBContext.newInstance("com.caucho.soap.jaxws.handlerchain");
        _handlerChainUnmarshaller = context.createUnmarshaller();
      }

      if (log.isLoggable(Level.FINER)) {
        log.finer("Creating handler chain for " + cl +
                  " from file " + handlerChain.file());
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createUnmarshaller()

    _serviceClass = serviceClass;

    try {
      JAXBContext context =
        JAXBContext.newInstance("com.caucho.soap.jaxws.handlerchain");
      _handlerUnmarshaller = context.createUnmarshaller();
    }
    catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createUnmarshaller()

    List<String> getHandlerNames(SOAPBody soapBody) throws Exception {
       
        Element elNode = DOMUtils.getFirstElement(soapBody);
        List<String> stringList = null;
        JAXBContext jaxbCtx = JAXBContext.newInstance(PingResponse.class);
        Unmarshaller um = jaxbCtx.createUnmarshaller();
        Object obj = um.unmarshal(elNode);

        if (obj instanceof PingResponse) {
            PingResponse pr = PingResponse.class.cast(obj);
            stringList = pr.getHandlersInfo();
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createUnmarshaller()

    @SuppressWarnings("unchecked")
    public static synchronized void init(URI uri, Class<?> callingClass) throws XMLSecurityException {
        if (initialized == null || uri != null && !uri.equals(initialized)) {
            try {
                JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
                final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
                SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
                Schema schema = schemaFactory.newSchema(
                        ClassLoaderUtils.getResource("schemas/security-config.xsd", Init.class));
                unmarshaller.setSchema(schema);
                final UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
View Full Code Here

Examples of javax.xml.bind.JAXBContext.createUnmarshaller()

        marshalAndUnmarshal(Connector.class, "connector-example.xml");
    }

    private <T> void marshalAndUnmarshal(Class<T> type, String xmlFileName) throws JAXBException, IOException {
        JAXBContext ctx = JAXBContext.newInstance(type);
        Unmarshaller unmarshaller = ctx.createUnmarshaller();

        InputStream in = this.getClass().getClassLoader().getResourceAsStream(xmlFileName);
        String expected = readContent(in);

        Object object = unmarshaller.unmarshal(new ByteArrayInputStream(expected.getBytes()));
View Full Code Here

Examples of org.apache.ws.jaxme.impl.JAXBContextImpl.createUnmarshaller()

    public void select(Observer pObserver, String pQuery, PMParams pParams) throws PMException {
        TConnection conn = null;
        try {
            JAXBContextImpl c = getManager().getFactory();
            setJAXBContext(c);
            JMUnmarshallerHandlerImpl h = (JMUnmarshallerHandlerImpl) c.createUnmarshaller().getUnmarshallerHandler();
            DocumentDefaultHandler.setUnmarshallerHandler(h);
            ElementDefaultHandler.initData();
            conn = getTConnection();
            TXMLObjectAccessor accessor = conn.newXMLObjectAccessor(TAccessLocation.newInstance(collection), model);
            TResponse response = accessor.query(TQuery.newInstance(pQuery));
View Full Code Here

Examples of org.eclipse.persistence.jaxb.JAXBContext.createUnmarshaller()

    }

    protected SessionBeanCall unmarshallSessionBeanCall(InputStream data) throws JAXBException {
        Class<?>[] jaxbClasses = new Class[] { SessionBeanCall.class };
        JAXBContext context = (JAXBContext) JAXBContextFactory.createContext(jaxbClasses, null);
        Unmarshaller unmarshaller = context.createUnmarshaller();
        unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT, Boolean.FALSE);
        unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE, MediaType.APPLICATION_JSON);
        StreamSource ss = new StreamSource(data);
        return unmarshaller.unmarshal(ss, SessionBeanCall.class).getValue();
    }
View Full Code Here

Examples of org.eclipse.persistence.oxm.XMLContext.createUnmarshaller()

     */
    public void loadXMLSchema(InputStream xrSchemaStream) {

        SchemaModelProject schemaProject = new SchemaModelProject();
        XMLContext xmlContext = new XMLContext(schemaProject);
        XMLUnmarshaller unmarshaller = xmlContext.createUnmarshaller();
        Schema schema = (Schema)unmarshaller.unmarshal(xrSchemaStream);
        NamespaceResolver nr = schema.getNamespaceResolver();
        String targetNamespace = schema.getTargetNamespace();
        nr.put(TARGET_NAMESPACE_PREFIX, targetNamespace);
        xrService.schema = schema;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.