Package org.jboss.ws.core.utils

Examples of org.jboss.ws.core.utils.JBossWSEntityResolver


   {
      if (locs == null || locs.size() == 0)
         throw new IllegalArgumentException("Illegal schema location map");

      JBossXSErrorHandler xserr = new JBossXSErrorHandler();
      JBossWSEntityResolver resolver = new JBossWSEntityResolver();
      JBossXSEntityResolver xsresolve = new JBossXSEntityResolver(resolver, locs);
      XMLSchemaLoader loader = (XMLSchemaLoader)schemautils.getXSLoader(xserr, xsresolve);

      int index = 0;
      SchemaGrammar[] gs = new SchemaGrammar[locs.size()];
      Iterator<String> it = locs.keySet().iterator();
      while (it.hasNext())
      {
         try
         {
            String nsURI = it.next();
            URL orgURL = locs.get(nsURI);
            URL resURL = resolveNamespaceURI(resolver, nsURI);
            URL url = resURL != null ? resURL : orgURL;
           
            log.debug("Load schema: " + nsURI + "=" + url);
            XMLInputSource inputSource = new XMLInputSource(null, url.toExternalForm(), null);

            InputSource tmpSrc = resolver.resolveEntity(null, url.toExternalForm());
            InputStream in = tmpSrc.getByteStream() != null ? tmpSrc.getByteStream() : new ResourceURL(url).openStream();
            inputSource.setByteStream(in);
           
            SchemaGrammar grammar = (SchemaGrammar)loader.loadGrammar(inputSource);
            if (grammar == null)
View Full Code Here


      if (wsdlLocation == null)
         throw new IllegalArgumentException("URL cannot be null");

      log.trace("parse: " + wsdlLocation.toExternalForm());
     
      EntityResolver entityResolver = new JBossWSEntityResolver();
     
      // Set EntityResolver in patched version of wsdl4j-1.5.2jboss
      // [TODO] show the usecase that needs this
      // ((WSDLReaderImpl)wsdlReader).setEntityResolver(entityResolver);
      Definition wsdlDefinition = wsdlReader.readWSDL(new WSDLLocatorImpl(entityResolver, wsdlLocation));
View Full Code Here

    factory.setValidating(false);

    try
    {
      DocumentBuilder builder = factory.newDocumentBuilder();
      builder.setEntityResolver( new JBossWSEntityResolver() );
      Document doc = builder.parse(inputSource);

      return doc;
    }
    catch (RuntimeException e)
View Full Code Here

         throw new IllegalArgumentException("URL cannot be null");

      if (log.isDebugEnabled())
         log.debug("parse: " + wsdlLocation.toExternalForm());

      EntityResolver entityResolver = new JBossWSEntityResolver();
      WSDLDefinitions wsdlDefinitions = null;
      try
      {
         Document wsdlDoc = getDocument(wsdlLocation);
         String defaultNamespace = getDefaultNamespace(wsdlDoc);
View Full Code Here

   /**
    * Creates and initializes an instance of SchemaBinding
    */
   public SchemaBinding buildSchemaBinding(XSModel model, JavaWsdlMapping wsdlMapping)
   {
      JBossEntityResolver resolver = new JBossWSEntityResolver();
      SchemaBinding schemaBinding = XsdBinder.bind(model, new DefaultSchemaResolver(resolver));

      schemaBinding.setIgnoreLowLine(false);
      schemaBinding.setIgnoreUnresolvedFieldOrClass(false);
      schemaBinding.setUnmarshalListsToArrays(true); // note: default jaxb2.0 is false!
View Full Code Here

      try
      {
         Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
         unmarshaller.setValidation(true);
         unmarshaller.setSchemaValidation(true);
         unmarshaller.setEntityResolver(new JBossWSEntityResolver());

         String nsURI = getNamespaceURI(configURL);
         is = configURL.openStream();
         if (URN_JAXRPC_CONFIG.equals(nsURI))
         {
View Full Code Here

      XSLoader xsloader = utils.getXSLoader();
      Map map = new HashMap();
      map.put(typeNS,new File("resources/tools/wsdlfixture/customtype/CustomTypeObj.xsd").toURL());
      map.put(arrTypeNS,new File("resources/tools/wsdlfixture/customtype/CustomTypeArrays.xsd").toURL());

      ((XMLSchemaLoader)xsloader).setEntityResolver(new JBossXSEntityResolver(new JBossWSEntityResolver(), map));
      //Construct a StringList
      StringList slist = new StringListImpl(arr, 2);
      XSModel xsmodel = xsloader.loadURIList(slist);
      assertNotNull("XSModel is null?", xsmodel);
View Full Code Here

      XSLoader xsloader = utils.getXSLoader();
      Map map = new HashMap();
      map.put(typeNS,getResourceURL("/tools/wsdlfixture/customtype/CustomTypeObj.xsd"));
      map.put(arrTypeNS,getResourceURL("/tools/wsdlfixture/customtype/CustomTypeArrays.xsd"));

      ((XMLSchemaLoader)xsloader).setEntityResolver(new JBossXSEntityResolver(new JBossWSEntityResolver(), map));
      //Construct a StringList
      StringList slist = new StringListImpl(arr, 2);
      XSModel xsmodel = xsloader.loadURIList(slist);
      assertNotNull("XSModel is null?", xsmodel);
View Full Code Here

         try
         {
            Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
            unmarshaller.setValidation(true);
            unmarshaller.setSchemaValidation(true);
            unmarshaller.setEntityResolver(new JBossWSEntityResolver());
            ObjectModelFactory factory = new HandlerChainsObjectFactory();
            handlerChainsMetaData = (UnifiedHandlerChainsMetaData)unmarshaller.unmarshal(is, factory, null);
         }
         finally
         {
View Full Code Here

         try
         {
            Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
            unmarshaller.setValidation(true);
            unmarshaller.setSchemaValidation(true);
            unmarshaller.setEntityResolver(new JBossWSEntityResolver());
            ObjectModelFactory factory = new HandlerChainsObjectFactory();
            handlerChainsMetaData = (UnifiedHandlerChainsMetaData)unmarshaller.unmarshal(is, factory, null);
         }
         finally
         {
View Full Code Here

TOP

Related Classes of org.jboss.ws.core.utils.JBossWSEntityResolver

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.